Ok kkkk promise to fix the name of Button.
But I still have doubts is like MyOtherMethod () to do the check when Private Sub btn_Click (blah, blah) Handles btn.Click end its process
I'm trying to do is this
1 - click on the button
2 - click on the button triggers the event Private Sub btn_Click (blah, blah) Handles btn.Click
3 - The btn.Click event triggers the routine MyOtherMethod () the btn.Click however, have to continue running the remaining code
4 - MyOtherMethod () loop is waiting for the end of btn.Click
5 - When the event finished btn.Click, MyOtherMethod () loop that identifies that event ended btn.Click and runs a code that is out of the loop and ends
What i am not able to do is, call event btn.Click MyOtherMethod () and continue running the rest of the code, which waits btn.Click MyOtherMethod () finish to continue
and also I am not able to make the MyOtherMethod () identifies which ended btn.Click
OK, you didn't get it. There is NO other code after the call to MyOtherMethod. That is the last thing that happens inside the event handler.
I serisouly doubt you need to go call some method, then have it wait on the rest of the code in the handler to finish. It WILL NOT ever finish until the method you called finishes itself.
It sounds as though you need to restructure what you're doing, synchronously, to avoid this situation. When you make a method call, the code that does the calling does NOT continue to run while the method is executing. The calling code completely stops and waits for the method called to return. This is called a "blocking call".
Also, event handlers should return inside of about 250 milliseconds. While your event handler code is exectuing, your UI is copmletely hung waiting for it. The user cannot click on anything in your app until the handler returns.
But, in any case, the ONLY way to do what you describe to is use threading and a WaitHandle to signal the other thread. So, your event handler gets called, and in it you kick off another thread.
What are you doing that you think you need to do this??
I need guidance on how to start with this small project. I need to implement a web interface that will access applications that developed in vb.net with sql back end.
What I mean is the following: I have two small applications, one is fire arms registration and the other is logistic. Both apps reside on the same sql server. I want to have a web interface that will point to each one base on the user access. that is if the user is from fire arm than fire arm registration app will launch and so on..
of course this can for a number of applications.
The general purpose of this, is to have access to these applications via the web.
what best solution to use in order to accomplish this task.
I would like to know what i need to consider first in all aspect of this task.
I need to implement a web interface that will access applications that developed in vb.net with sql back end.
What do you mean 'access applications'? You want to give a WEB UI to it or launch an exe? If launch then, since it's a web interface, exe needs to be downloaded to client system and then launched. If you do a process.start on server, it will not be on client system and they will now see/know.
I did asked this too: If server, what's the use?
Can you share the expected workflow from logging in to returning back something to user.
I get that one executable needs to be picked, what after that, what role does it play and how does client come to know/use it. Since it will not be downloaded and will be launched on server side, what are you trying achieve?
I am Creating a Client that uses email to send and recieve text messages. I only have to problems when i recieve the mail from the server it goes into my listbox but how do i make that listbox string, when selected, open the body of the message in a richtextbox. Here is my code so far.
The messages are put into the Inbox i just cant display the body of the message in the richtext box when selected from the listbox. Any Help will be greatly appreciated! Thanks!
PrivateSub Button2_Click(sender AsObject, e As EventArgs) Handles Button2.Click
Dim strMailServer, strUsername, strPassword, strFrom, strSubject, strToo, strBody, strMailContent AsStringDim popConn As Text_Me_Now.POP3
Dim mailMess As Text_Me_Now.EmailMessage
Dim intMessCnt, i AsInteger'set the variables to the input boxes
strMailServer = "pop.gmx.com"
strUsername = "firstname.lastname@example.org"
strPassword = "xxxxxxx"'Disable the button when proccessing
Button2.Enabled = False'create the objects
popConn = New Text_Me_Now.POP3
mailMess = New Text_Me_Now.EmailMessage
'if we have got to this point, try and connect to the server
popConn.POPConnect(strMailServer, strUsername, strPassword)
'now we have a connection, see if there are any mails on the server
intMessCnt = popConn.GetMailStat()
'now, see if we have returned any messages
If intMessCnt > 0Then'clear contents of the list and add the heading
'if we returned some messages, loop through each one and get the details
For i = 1To intMessCnt
'load the entire content of the mail into a string
strMailContent = popConn.GetMailMessage(i)
'call the functions to get the various parts out of the email
strFrom = mailMess.ParseEmail(strMailContent, "From:")
strSubject = mailMess.ParseEmail(strMailContent, "Subject:")
strToo = mailMess.ParseEmail(strMailContent, "To:")
strBody = mailMess.ParseBody()
'add email details to the list box
ListBox1.Items.Add(strFrom & ", " & strSubject)
'un-comment to display full details of the email in a message box
'MsgBox("From: " & strFrom & vbNewLine & "Too: " & strToo & vbNewLine & "Subject: " & strSubject & _
'vbNewLine & "Body: " & strBody)
'call close method to delete the emails.
EndIf'Quit the connection to the server
Button2.Enabled = TrueEndSubPrivateSub ListBox1_SelectedIndexChanged(sender AsObject,