I am making an app (sorta like a computer lock) that won't let you do anything on your computer until you type in the password. I am using
Public Sub w_setfocus()
Dim f As Boolean
While (1)
f = Me.ContainsFocus()
If f = True Then
Me.Focus()
f = Me.ContainsFocus()
End If
End While
End Sub
End Class
And w_setfocus is run on form1_load. The problem is, the form then never shows up.
If the application is already running, and someone tries to launch it again, set the focus on the already-running program, and exit the one recently launched. I found this, but I don't know how to get the already-running process hwnd. It should be Dim handle As IntPtr = Process.MainWindowHandle But that doesn't work.
I got a couple of issues with my windows application VB.Net. I seem to cannot set the form to be invisible before it shows up for a second, there is no option in the properties of a form and also if I set the form to visible = false before the form is loaded it doesn't work.
So this does not work:
Browser.Visible = False Browser.Show()
and this does work but the form shows up for a second which I am still not very happy with
I'm attempting to improve my MVVM abilities in my next WP7 App (which is written in Vb.NET). I have a textbox that has been given focus and has a WP7 keyboard displayed. I am using command binding and a xyzzer's bindable Application bar (which is excellent).[URL] I want to be able to cancel the focus of the TextBox from the ViewModel, by setting focus on the form. Normally (Non MVVM) I would do this from within the form by calling:
I have a splash form that opens in the following Sub of the main form of the app[code]...
The Splash Form opens and closes fine, but no controls (a text box and a graphic, on a panel) appear on the form. I knew I was probably missing something (this was far easier than anything I found searching), but at least the form opens and closes. The app actually starts with a SubMain, which is only used to control how it opens with it's registered file type.
I have a small non mdi form with only 3 controls. The user can select a name of an animal on a listbox and a thumbnail picture of it is shown on the picturebox. There is also a tton.The tooltip on the thumbnail is quite important as left/right click do different actions but for some reason the tooltip will not display unless the user clicks the form.
I was working on a project in vs 2005 and decided to see my project's form in microsoft blend, the form did not show and i closed blend and saved no changes. The next time i open my project in visual studio, my form1 design mode shows me some code for the windows form designer. How can i get my form back as i need to add more controls and change the orientation of some others?
When I try to open up a form designer, all I see is code and no form! How can I open up the designer, since the code says to modify using the designer and not the code editor?[code]....
I've written a small program that monitors the customer field in Quickbooks and query's a database to determine if there are any important notes for the selected customer. This works fine however, I either need the messagebox or a form to come to the front of all open windows on the system to inform the user that the selected customer needs to be reviewed.
How can I ensure that a form (or messages box) that opens in my program comes to the front of any and all application windows that are open?
Something happened to my project and it got all messed up. I am not sure what happened, but the form I was working on only shows the code and not the project itself(where you design it). I am working in VB2008 Express Edition and do not wish to start over. What happened to my form?
I've got a project that generates a sql query and returns the results. I want to place a time/counter on the form that shows how long it takes to return the query from the server. Basically to count up in seconds from 0 while that sub is executing. Would threading be the best way to do this or is there another way that I'm missing?
i add a rectangle and label to datagridview...my problem is that when i load the form the rectangle only shows on the last add data..how can i make all the data display in rectangle not only the last add data.[code]
I'm trying to make a progressbar that shows the load time of the next form.I've tried alot of different ways to do it, but it and the speed is always the same whether the next form loads faster or slower.I'm not sure what variables to use or anything.
I want to make an application that shows the calculation sequence consisting of 3 form.1 is an input form,form 2-step sequence of calculations can be saved as pdf,he calculation
I want to create a form that shows different pictureboxes, showing different images, when the "Next" or "Previous" button is clicked.Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click 'button 1 is the "Next" button PictureBox2.Show()End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click 'button 2 is the "Previous" button PictureBox1.Show() End Sub
I have a splash screen, the default from Visual studio. It loads up, is shown for a few seconds, then, when it disappears, the main form is loaded. Now here is the problem: the main form appears in the back, behind the windows explorer window I load the application from.
The weird thing is that this only happens on some computers, particularly Windows XP machines.I tried a lot of things like BringToFront() or TopMost = true in the on Load event of the form but nothing seems to change this.
I am having this strange thing happen where I have a Module that contains multiple classes in my project. In the Solution Explorer, the module shows up as a Windows Form and if I double click on it to open it, it tries to open the Form Designer. What could be causing VS to think that it is a Windows Form instead of a module?
i am trying to create a program that connects to a database and shows table fields in listview in windows form i manage to do that but i want now to have a button to take the total of a column in a list box ,lets say from the column "money"?
I'm writing a program that retrieves certain lines from a textfile. This textfile is rather large, so is it possible to have a progressbar that shows the progress when it retrieves?
I need a code (or a mini tutorial) for like a basically antivirus, but not everything, I only have these requirements:-to run on startup-when it runs, a image (with the AV logo) pops up, and after a while (like 2-3 seconds) it dissapears-when it runs on startup, the main screen of it dont' pop up, but will be shown on system tray
I have it set so when button3 is clicked that the listbox displays the textfiles in a designated folder.[code]Now what I would like to have happen is a way for: Selected listbox2.item (A.txt, B.txt, or C.txt) read the selected textfile into Textbox1.text(I want to click on A, B, or C and have it just open/read that textfile into the textbox.)I have a feeling this is something simple - but for some reason I am having trouble grasping it.
creating half-transparent not classic form window which could be shown in any fullscreen program, game or somethingi couldnt find how to do that (it would look like rectangular box with some text and buttons in it)
I have an admin section of my program to change particulars. To activate this you click the admin button the launch..then type a password. I dont want people to know there is even an admin button.... anyone know how i can assign a button combo (such as ALT+B) to show and hide that RBTN so other people cant see that admin is an option
Simply saying I've added an Notify Icon to my project and then added context menu showing up when the left mouse button is pressed. The problem is that with the context menu some blank form is showing in the taskbar. There is no such form within the project.Does anyone know why it may be happening or how to get rid of the effect? I might add that I have other context menu attached for mouse right click button and it works fine, no blank forms and such showing on the taskbar it's just the left mouse button that works that way.Here is the code that I am using to show the menu:(the visible state to false is necessary for the other menus not to pop up with the one i want... unless anyone knows better method)
Private Sub NotifyIcon_Click(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles NotifyIcon.Click If e.Button = MouseButtons.Right Then
I am using a background worker, it runs fine but it does not shows the result. i am using jmcilhinney source to work it out.. have a look.
VB Imports System.ComponentModelImports System.Text.RegularExpressionsImports System.NetImports System.IO Public Class WorkDialogue Private _result As Long = 0L Public ReadOnly Property Result() As Long Get Return Me._result End Get End Property Private Sub
[CODE]...
And the button codding in other form:
VB Using dialogue As New WorkDialogue dialogue.ShowDialog()TextBox2.Text = dialogue.Result.ToString() End Using
I am a first time poster and fairly new to using VB 2008.I was having some trouble with writing a program that shows the sales tax of items (i.e cars, food, etc).
[code]...
The buttons are in the middle and the four text boxes are marked with brackets and underscores.I know how to code the "clear" and "exit" button but I am having some difficulties with the calculate button.