what it does is open other small applications within the form. I'm not using mdi I probably should.
Here is my problem
The application load - main form only contains a menu strip - once selecting a menu option another form opens within the main form.
What I want the app to do is; to check to make sure that the sub form is not already open. If it is bring it to front.
My code..
I created a class - clsOpenForms
this class only holds public booleans for each form they are all set to false
Expand|Select|Wrap|Line Numbers
- Public Class clsOpenForms
- Public isfrm_mathopen As Boolean = False
- End Class
[HTML]dim open_frm as new clsOpenfroms[/HTML]
Expand|Select|Wrap|Line Numbers
- Private Sub mnu_Math_app(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnu_Math_app.Click
- Dim objmath As New frmMath_app
- ' If isfrm_mathopen is false then frm is not open - so load form and bring to front
- if not open_frm.isfrm_mathopen then
- objmath.toplevel = false
- me.controls.add(objmath)
- objmath.show
- objmath.bringtofront
- 'form is now open set isfrm_mathopen to true
- open_frm.isfrm_mathopen = true
- else
- objmath.bringtofront
- end sub
Expand|Select|Wrap|Line Numbers
- dim open_frm as new clsOpenfroms
- Private Sub frmMath_app_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing
- open_frm.mathopen =false
- End Sub