You are viewing our Forum Archives. To view or take place in current topics click here.
Visual basic program help
Posted:
Visual basic program helpPosted:
Status: Offline
Joined: Dec 23, 200915Year Member
Posts: 1,939
Reputation Power: 377
Status: Offline
Joined: Dec 23, 200915Year Member
Posts: 1,939
Reputation Power: 377
I have made a program but i want to to always to be at the front over all other applications are open. So if i click google chrome the application will still be there and not dissapear.
If anyone knows what code i would need todo or point me in the right direction.
Thanks
made in C++
If anyone knows what code i would need todo or point me in the right direction.
Thanks
made in C++
#2. Posted:
Status: Offline
Joined: Jul 14, 201410Year Member
Posts: 1,720
Reputation Power: 71
Status: Offline
Joined: Jul 14, 201410Year Member
Posts: 1,720
Reputation Power: 71
Read the title and saw "Visual Basic". Then the post said C++.
Ignore this
Here is info for C++
[ Register or Signin to view external links. ]
For future reference Visual Basic is a language. Visual STUDIO is what you are using to make programs.
Last edited by ProJimmyRustler ; edited 1 time in total
Ignore this
If by default you want this, it should be in the options.
Here is a manual way to do it.
If you want it user-driven
Here is a manual way to do it.
Form.TopMost = true;
If you want it user-driven
create a checkbox named chkAlwaysOnTop of course. It can also be easily stored in the user settings to keep it state-aware between instances.
Private Sub chkAlwaysOnTop_CheckedChanged(sender As System.Object, e As System.EventArgs) Handles chkAlwaysOnTop.CheckedChanged
Me.TopMost = chkAlwaysOnTop.Checked
End Sub
You'll want this in your program if you want to save said state for the user:
Private Sub MainActivity_FormClosing(sender As Object, e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing
My.Settings.AlwaysOnTop = chkAlwaysOnTop.Checked
My.Settings.Save()
End Sub
You'll also want this in your form load:
Me.TopMost = My.Settings.AlwaysOnTop
chkAlwaysOnTop.Checked = My.Settings.AlwaysOnTop
Here is info for C++
[ Register or Signin to view external links. ]
For future reference Visual Basic is a language. Visual STUDIO is what you are using to make programs.
Last edited by ProJimmyRustler ; edited 1 time in total
- 1useful
- 0not useful
#3. Posted:
Status: Offline
Joined: Dec 23, 200915Year Member
Posts: 1,939
Reputation Power: 377
Status: Offline
Joined: Dec 23, 200915Year Member
Posts: 1,939
Reputation Power: 377
ProJimmyRustler wrote If by default you want this, it should be in the options.
Here is a manual way to do it.
Form.TopMost = true;
If you want it user-driven
create a checkbox named chkAlwaysOnTop of course. It can also be easily stored in the user settings to keep it state-aware between instances.
Private Sub chkAlwaysOnTop_CheckedChanged(sender As System.Object, e As System.EventArgs) Handles chkAlwaysOnTop.CheckedChanged
Me.TopMost = chkAlwaysOnTop.Checked
End Sub
You'll want this in your program if you want to save said state for the user:
Private Sub MainActivity_FormClosing(sender As Object, e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing
My.Settings.AlwaysOnTop = chkAlwaysOnTop.Checked
My.Settings.Save()
End Sub
You'll also want this in your form load:
Me.TopMost = My.Settings.AlwaysOnTop
chkAlwaysOnTop.Checked = My.Settings.AlwaysOnTop
Ended up working with Me.TopMost = True
thanks!
- 0useful
- 0not useful
You are viewing our Forum Archives. To view or take place in current topics click here.