Hello,
How would i go about getting my application to run 2 times then show form 2 then once they close form2 it dosent show form 2 anymore once the program starts again after closing.?
Hello,
How would i go about getting my application to run 2 times then show form 2 then once they close form2 it dosent show form 2 anymore once the program starts again after closing.?
come back and mark your original post as resoved if your problem is fixed
Jamie Garland
If i understood well, you want to show form2 when the program run for first time and don't show it next runs, if so, use a flag saved in your settings file to check if form 2 was previously shown or not.
Pseudo code
vb Code:
read f from setting file if f = 0 then show form 2 f = 1 save f to setting file else ' continue end if
Sounds like you only want to show some other form the second time the app is run, you could try setting up an Integer in Project/Properties/Settings...
Code:Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load ' get value from my settings named "OpenCounter" (type = Integer, Value= 0). Dim i As Integer = My.Settings.OpenCounter + 1 ' increment counter If i < 2 Then ' dont show on first run My.Settings.OpenCounter = i ' save count to setting My.Settings.Save() ' save my settings ElseIf i = 2 Then ' show form2 just this once. My.Settings.OpenCounter = 3 ' increment to 3, never show form2 again! My.Settings.Save() ' save my settings Form2.ShowDialog() ' show form as dialog to force user to respond End If End Sub
That could really screw up if the app crashes without a chance to decrement the counter. Just beware of that.
Treeview with NodeAdded/NodesRemoved events | BlinkLabel control | Calculate Permutations | Object Enums | ComboBox with centered items | Create Sortable BindingList(not mine) | .Net Internals article(not mine) | Wizard Control | Understanding Multi-Threading
C++ programmers will dismiss you as a cretinous simpleton for your inability to keep track of pointers chained 6 levels deep and Java programmers will pillory you for buying into the evils of Microsoft. Meanwhile C# programmers will get paid just a little bit more than you for writing exactly the same code and VB6 programmers will continue to whitter on about "footprints". - FunkyDexter
There's just no reason to use garbage like InputBox. -jmcilhinney
Hello,
How would you do it?.
come back and mark your original post as resoved if your problem is fixed
Jamie Garland