I have a little log in screen that pops up if a user selects a certain item on my main form. How do I get my code to stop executing til my log in form closes?This is what I am doing so far. Basically i want o execute the code after MyLogin closes.
BMSSplash.MyLogin.Show() If isLoggedIn Then BMSSplash.MyBuddy.Show() Cursor.Current = Cursors.WaitCursor End If
I'm trying to run a batch file via VB and I need to wait for it to complete/exit before progressing. The issue I believe I am having is that when a batch file is executed, it opens cmd.exe and not the batch file.
This is what I am executing with VB My.Computer.FileSystem.DeleteFile(My.Application.Info.DirectoryPath & "PingCheckmachines.txt") FileCopy(My.Application.Info.DirectoryPath & "machines.txt", My.Application.Info.DirectoryPath & "PingCheckmachines.txt") Dim psi As New ProcessStartInfo(My.Application.Info.DirectoryPath & "PingCheckgo.bat") psi.RedirectStandardError = True psi.RedirectStandardOutput = True psi.CreateNoWindow = False .....
The problem I am having is that it will just delete ping.bat before it completes. How do I go about monitoring the process from the batch file I call. Then once it exits, continue with the script?
Can i put my app in some kind of wait state for a certain key on the keyboard before continuing? But that key can be targeted to any window, not just my app. My app would be out of focus and i hit that key on the keyboard and it would act.
making verified accounts for my marketing and now I am hooked into improving as it is turning into a very good program I am just stuck with one thing which I can see being a very simple solution but I have search forum after forum and tonnes of Google searches all worded different to solve my my.It really is simple at present I use different buttons to automate different parts/pages of the account creation I am now setting it up so I click say for example a "go" button and it fills in the first page (and heres where I'm stuck waits for a specific url or even just a new url to load before continuing with the next bit of code
In my program I use WebBrowser control for OAuth. It's located on vk_auth_window form. So in the code I call vk_auth_window.WebBrowser1.Navigate(vkauthurl). If authentication is successful, I silently get token, but if user is not authenticated a form vk_auth_window is showed to them to enter username and password. To check this I catch _DocumentComplete event and check for the right URL. I need no other code being executed until the user finished authentication or closed authentication form. ShowDialog() does the trick, but it somehow hides cursor from username and password fields in WebBrowser control. So I introduced a variable Dim showform as Boolean=True in and set it to False from the _DocumenComplete event and in the main code I use infinite loop.
While showform System.Threading.Thread.Sleep(100) Application.DoEvents() End While
However it makes userinput slow due to thread sleeps. And If i remove them, it loads CPU quite a lot. Is there a better way to wait for form to close? What is it?
My end result is that I want to launch another setup project after the first setup project closes. The problem is that since setup.exe is just a wrapper for the msi package.WaitForExit is quitting when the setup.exe is finished and not foo.msi.
Using Process As New System.Diagnostics.Process Process.StartInfo.FileName = "setup.exe" Process.StartInfo.WindowStyle = ProcessWindowStyle.Normal
In my MDI Application code I have a form that launches a second form then hides itself until the spawned form closes. It works great unless I choose to close the application while the spawned form is still up.
The following is some example code.
Dim ChildForm as New frmTaskWindow With { .MDIParent = Me, .AddingNew = True } ChildForm.Show Me.Hide()
[Code].....
Me.Show() ' error occurs here because my form is already closed by the system. Is there a way to get around this without just an error catcher?
I have a main form that has a button with which a smaller form is shown. Think of the smaller form as the Find/Replace dialog in many applications, such as Notepad. It's important that the form is (what I believe is called) modal. What I mean is that it always stays on top of the main form. I ensure that by calling the Show method with "Me" as the owner argument. Whenever the small form loses focus it will not disappear into the background but stay visible (albeit out of focus). If you don't understand open up Notepad and have a look at the behavior of the Find/Replace dialog.
Here's my problem: instead of actually closing the form when the X is pressed, I want it to simply Hide itself, so its position and the state of any controls (checkboxes etc) is preserved automatically.To achieve this I simply cancel the FormClosing event and Hide it:
vb.net Private Sub Form2_FormClosing(ByVal sender As System.Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles MyBase.FormClosing
[code]....
To show the form, I use the following (note the (Me) to make the main form the owner of the form; this ensures that it remains visible even when it is out of focus):
vb.net Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Form2.Show(Me) End Sub
Now. When I run my project, and open the Form2 (small form), then hide it again (by 'closing' it), I can no longer close the main form (Form1)! It seems the main form cannot close when the small form still exists (albeit invisible)...?? When I don't use the Me argument in the Show method, I don't get the behavior I want. I know I can set the TopMost property to True but that will also cause it to become visible on top of all the other forms, even windows not part of my application.
I have set up a notify icon for my form. I want to make it so that when the user clicks the close button that it doesn't close the form it just takes it to shows the notify icon. They can exit the program from the notify icon. Can someone tell me how to keep it running?
sometimes, when I use Form.close() when debugging my program, although the form is closed, the application is still running. I noticed this behaviour when using the msgbox function.
I try to transfer a vb6 application to vb2010. In the vb6 I start with a login panel that the user enter uid and password autenticate with the DBServer if ok show application main menu and close the login form. the order of the me.close() after the mainform.show() does not change, The application ends.
I have a situation where me.close() doesn't close the form. I have a form with a button with the code seen below. What happens when the button is clicked is the new form shows, but the original form(calling form) is still there. When I go into debug mode, I can see the me.close() execute, but nothing happens (calling form stays open). When I close the second form both forms close. If I comment out the call for the second form to open the first form closes without problem.
Private Sub cmdNext_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdNext.Click Dim f As New frmOrder3
In VB.NET I've got two forms, on first one I have button, on second - two textboxes and "OK" button. I want to run procedure (Sub) on first form, then stop in the middle of it and wait for input on the second form. After that i want to process the data received from second form.
It looks something like this:
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
'Open form2 for input
[CODE]...
The question is how to call the Form2 so that procedure is stoped till the second form is closed?
While navigating to a series of sites at one site the WebBrowser control's DocumentCompleted EVENT is tripped and no other recorded Browser events occur after that. When this happens the hour glass cursor indicates the browser is waiting. From this point it take 120 to 250 seconds of wall clock time before the browser resumes. I am looking for a way to force an abnormal termination without destroying the control. I have tried "Stop", "nav to about:blank" repeatedly without success. How can I force an abnormal termination when the Cntrl is in a wait state?
Consider the following: The last known Browser event to be tripped is a Document Complete event; nothing else occurs after this. When this transpires the Cntrl is waiting.
1:50:657: ============================= ENTER WebBrowser1_DocumentCompleted EVENT ======================================== 31:50:657: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^THE NEW WEBBROWSER STATEMENT
I have a VB .Net windows form application.On a button click I call a Function, say FunctionA ..and want to freeze all the controls on my main form and display a wait graphic, until FunctionA has finished executing.
I have 2 forms, form1 is my main form and form2 is a "Do this or do this" form (Form with 2 buttons like a are you sure form). When the user tries to close form1 if their is more than 1 tab open, it shows form2 which ask if they want to close the whole program or just the current tab. How to revive what button the user clicks on form2. How would I need to do this?
''Form1: Private Sub frmMain_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing If (tc1.TabPages.Count > 1) And (My.Settings.AskClseTab = True) Then If frm_Closemain.ActionTakin = "Exit" Then GoTo Cont [Code] .....
The problem: as soon as the form loads it becomes "Not responding" I believe this is caused by my do while loop, what other way could I go about doing this?
I am trying to fetch some specific data from a file which is updated frequently. So, i am trying to make my form wait till i get a particular data. i am using Threading.Thread.Sleep(10000)to wait and again check the data.
but form is getting hanged (showing NOT RESPONDING)
I have a form with voice prompts on it for entering data into the textboxes. I use the enter event of the textboxes for my prompts. When the form opens, the first textboxe's voice prompt is heard, like it should be, but it is heard before the form actually appears. How can I get the first prompt to wait until the form has fully loaded before it starts?
In my vb program, I have two forms that work together to allow you to define an almost arbitrary amount of designs. In the first form, there is a two-dimensional array, storing an integer (not important) and an ID class that I defined as a public inner class in another form. Clicking on the "Define ID" button in this form will take you to the next form, where you will define a new ID or edit an old one based off of an index in the array you selected or entered in the first form's combo box, using multiple fields in the second form to define its different aspects.
What I want to happen is the first form's code to be suspended as the user defines the ID in the second form, then they click on the Continue button on the second form. After a bit of error-checking, the form either is momentarily hidden (which is how I originally implemented it) or returns the edited ID object, but only if the error-checking does not indicate any input is incorrect.
Originally, I simply grabbed the ID by using newForm.curID and set that to its spot in the array, waiting for the user to finish by using newForm.showDialog(), but sometimes the program would return a null exception because I don't think I copy the IDs correctly.Also, though the errors show up for a small amount of time, the Continue button saves the ID regardless of its correctness. Is there a way to manipulate the showDialog to get a result response out of it?
Short version: I need to either return an object of an inner class in one form to an array in a calling form or wait for a form to finish and use the calling form to copy its object, then close the callee form.First Form's "Define" button method
Private Sub DesignButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DesignButton.Click Me.totalCoilBox.Focus() 'calls validating method, makes textbox yellow if invalid' If totalCoilBox.BackColor = Color.White Then Dim newForm As New IVD_DesignData 'creates an object of ID called curID as well'
Private Sub wb_DocumentCompleted(ByVal sender As Object, ByVal e As System.Windows.Forms.WebBrowserDocumentCompletedEventArgs) Handles wb.DocumentCompleted
But I need to navigate to another page after Logging in to the website How can I wait the first page to be loaded fully then navigate to another page?
I'm currently in the process of building a text editor type program, and have run into a brick wall. I haven't done VB in years, so I may just need a little reminder on some things. I have coded everything so far as far as opening files, saving them, changing fonts, colors, etc. However, I'm looking to add a Close button to my menu strip that will just close the currently opened file, and not the entire program, while also ask the user if he/she would like to save before closing the file, and then if they select yes, it will show the save dialog, and if not, it will go ahead and close the currently opened item.
I have coded a low-level mouse hook. Each time the user clicks (let's say) the left mouse button, a custom event gets fired which is then handled by a form in my application. On the form is a ListView control with the following columns: Time - Application - Button.
I want that ListView to contain the last 1000 mouseclicks made, so each time the CustomMouseClickEvent gets fired, I check for the itemcount of the ListView, I add an item to the ListView and I resize all three columns. Problem is however that this extremely delays the processing of the mouseclick messages.
I'm wondering if it's possible to raise the CustomMouseClickEvent and then handle it in my application while at the same time the mouseclick message is passed on to the next hook to get processed by the systen?
I've been having a problem lately where if I call a sub with a msgbox.styleyesno, it won't go back to the original sub that called it. This is my code: