0

How do you make something happen everytime the program runs?

Dim CloseValue As String = Space(255)
        Win32.GetPrivateProfileString("Close", "value", "Default", CloseValue, 255, "C:/UserData.ini")

I need that to execute, I've tried
Public Sub Form_Load()
Public Sub Form_Initialize()
Public Sub Form_Active()

None works, I've tested with MsgBox("HELLO") to see if that pops up everytime the application is run.
But nothing, help someone?

I'm using Visual Studio 2010 Beta.

Edited by __avd: Added [code] tags. For easy readability, always wrap programming code within posts in [code] (code blocks).

1
Contributor
2
Replies
3
Views
7 Years
Discussion Span
Last Post by iou
0

Guess I can't edit for some reason, but anyway I solved it.
I used

Public Sub New()

End Sub
0

Guess I can't edit for some reason, but anyway I solved it.
I used

Public Sub New()

End Sub

Oops I ment

Private Sub New()
        InitializeComponent()
End Sub

It doesn't work without InitializeComponent()
Type the code you wish to execute just before the form displays.
Not saying anyone asked for help but, if someone experiences the same problem.

Private Sub New()
        InitializeComponent()
        MsgBox("This pops up just before the form displays, and the form doesn't load until you hit OK.")
End Sub
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.