|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
halt application flow until condition is metSorry for the poor topic name, i couldnt think how to word it any better. I have put below my code and I hope this makes what im trying to say, easier to understand. (I realise that the source isnt correct and won't work in its current form, its like this for ease of reading.) Basically start.vb trys to decide whether to continue or not depending on whether the global variables X and Y are equal to 1. My problem was that if i didnt put in - Do Until Accepted.Y = 1 Loop That the condition would never be met and X would always be equal to 0, and the program would terminate. But with this in the program doesnt work correctly, Is there a way to halt the program until Accepted.Y is equal to Y and then continue to the IF statement?? I hope you understand my question! Thanks David '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''start1.vb''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' Module startup Public Class Accepted Public Shared Y As Integer Public Shared X As Integer End Class Public Sub main() Do Until Accepted.Y = 1 Loop If Accepted.X = 1 Then splashregister.Close() Application.Run(frmapplication) Else MsgBox("Invalid Registration Key", MsgBoxStyle.Critical, " ") End If End Sub End Module ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''registration.vb'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' Public Class B Private Sub Continue_Click() Handles Continue.Click If validate() = true then Accepted.Y = 1 Accepted.X = 1 Else MsgBox("Invalid Registration Key", MsgBoxStyle.Critical, " ") End If End Sub end Class ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' More specifically I would suggest something similar to :
Public Sub main() Register.ShowDialog If Register.DialogResult=DialogResult.OK Then Application.Run(frmapplication) End If End Sub Private Sub Continue_Click() Handles Continue.Click If validate() = true then DialogResult=DialogResult.Ok Close Else MsgBox("Invalid Registration Key", MsgBoxStyle.Critical, " End If End Sub -- Show quoteHide quote<googlinggoog***@hotmail.com> a écrit dans le message de news:1139250896.902002.304830@g47g2000cwa.googlegroups.com... > Hi, > > Sorry for the poor topic name, i couldnt think how to word it any > better. > > I have put below my code and I hope this makes what im trying to say, > easier to understand. (I realise that the source isnt correct and won't > work in its current form, its like this for ease of reading.) > > Basically start.vb trys to decide whether to continue or not depending > on whether the global variables X and Y are equal to 1. My problem was > that if i didnt put in - > > Do Until Accepted.Y = 1 > > Loop > > That the condition would never be met and X would always be equal to 0, > and the program would terminate. > > But with this in the program doesnt work correctly, Is there a way to > halt the program until Accepted.Y is equal to Y and then continue to > the IF statement?? > > I hope you understand my question! > > Thanks > > David > > > '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' '''''''''''start1.vb'''''''''''''''''''''''''''''''''''''''''''''''''''''''' ''''''''''''''''''''''''''''''' > Module startup > > Public Class Accepted > Public Shared Y As Integer > Public Shared X As Integer > End Class > > > > Public Sub main() > > Do Until Accepted.Y = 1 > > Loop > > > If Accepted.X = 1 Then > splashregister.Close() > Application.Run(frmapplication) > Else > MsgBox("Invalid Registration Key", MsgBoxStyle.Critical, > " ") > End If > End Sub > > End Module > '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' ''''''''''' > > > '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' ''''''''''''registration.vb''''''''''''''''''''''''''''''''''''''''''''''''' ''''''''''''''''''''''''''''''''''''' > > Public Class B > > Private Sub Continue_Click() Handles Continue.Click > > If validate() = true then > Accepted.Y = 1 > Accepted.X = 1 > Else > MsgBox("Invalid Registration Key", MsgBoxStyle.Critical, " > ") > End If > > End Sub > > end Class > > > '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' ''''''''''' >
Lock statement in C#, Is there an equivalent in VB.NET?
For each Windows Shell Integration: how? File is busy Outlook Add-In: msoControlEdit: Textbox loses text when losing focus convert text to access mdb Structured files in VS 2005 VB.NET - How do I set and keep data in the clipboard? Concatenation - String.Concat halt application flow until condition is met |
|||||||||||||||||||||||