Hey, Well I was making a program and an options menu, so that is another form. And i want the user to check a checkbox to say if he wants to clear a box every time a math problem is solved... I am making a calculator. For now i have just made the checkbox in the same form as the main form, so its no problem. Help?????
Dhruv(BattleGuard)
: Hi, : : Can you give an example of what you're trying to do? : A possibility... : In Base Form declare a Protected Boolean variable : : Protected bLoading As Boolean : : This variable will be accessible in the base form and in the inherited form : : : How do I get a true boolean value from an inherited form to my main form? : : What function do i use??????? : : : : Thx : : Dhruv(BattleGuard) : : : : : :
One method to save and retrieve application settings is by storing them in the registry by using GetSetting and SaveSetting.
For example,
'On the Close/Save of your options form... Private Sub btnClose_Click('Arguments) Handles btnClose.Click Dim sValue as string
If chkClearBox.Checked then sValue = "TRUE" else sValue = "FALSE" end if 'Save to Registry SaveSetting(sAppName, "Options", "ClearBox", sValue) End Sub -- 'Somewhere in the Main Form code Dim sValue as string
'Retrieve From Registry sValue = GetSetting(sAppName, "Options", "ClearBox") If sValue = "TRUE" then 'Code to Clear Box else 'Do not clear box end if
***Please note that sAppName refers to the name of the application that you're running. You can retrieve the name of the application with the following code.
Dim s as string
s = System.Reflection.Assembly.GetExecutingAssembly.GetName.ToString sAppName = s.Substring(0, s.IndexOf(","))
***Another option might be to research the capabilites of adding an App.Config file and store values there rather than the registry.
Hope this helps,
Chris --------------------------------------------------------------------- : Hey, : Well I was making a program and an options menu, so that is another form. And i want the user to check a checkbox to say if he wants to clear a box every time a math problem is solved... I am making a calculator. For now i have just made the checkbox in the same form as the main form, so its no problem. Help????? : : Dhruv(BattleGuard) : : : : : Hi, : : : : Can you give an example of what you're trying to do? : : A possibility... : : In Base Form declare a Protected Boolean variable : : : : Protected bLoading As Boolean : : : : This variable will be accessible in the base form and in the inherited form : : : : : How do I get a true boolean value from an inherited form to my main form? : : : What function do i use??????? : : : : : : Thx : : : Dhruv(BattleGuard) : : : : : : : : : : : :
Hi, Thanx for that code but i just used a public boolean in a module then i just used that value to see if i could triffer. But i'm kinda new to all this .net stuff. Still 12 years old. I started about 3-4 weeks ago. I just happen to know the basic stuff. From the GUI to a litte bit of coding.
Thanx anyway, Dhruv(BattleGuard)
: Hi, : : One method to save and retrieve application settings is by storing them in the registry by using GetSetting and SaveSetting. : : For example, : : 'On the Close/Save of your options form... : Private Sub btnClose_Click('Arguments) Handles btnClose.Click : Dim sValue as string : : If chkClearBox.Checked then : sValue = "TRUE" : else : sValue = "FALSE" : end if : 'Save to Registry : SaveSetting(sAppName, "Options", "ClearBox", sValue) : End Sub : -- : 'Somewhere in the Main Form code : Dim sValue as string : : 'Retrieve From Registry : sValue = GetSetting(sAppName, "Options", "ClearBox") : If sValue = "TRUE" then : 'Code to Clear Box : else : 'Do not clear box : end if : : ***Please note that sAppName refers to the name of the application that you're running. You can retrieve the name of the application with the following code. : : Dim s as string : : s = System.Reflection.Assembly.GetExecutingAssembly.GetName.ToString : sAppName = s.Substring(0, s.IndexOf(",")) : : ***Another option might be to research the capabilites of adding an App.Config file and store values there rather than the registry. : : Hope this helps, : : Chris : --------------------------------------------------------------------- : : Hey, : : Well I was making a program and an options menu, so that is another form. And i want the user to check a checkbox to say if he wants to clear a box every time a math problem is solved... I am making a calculator. For now i have just made the checkbox in the same form as the main form, so its no problem. Help????? : : : : Dhruv(BattleGuard) : : : : : : : : : Hi, : : : : : : Can you give an example of what you're trying to do? : : : A possibility... : : : In Base Form declare a Protected Boolean variable : : : : : : Protected bLoading As Boolean : : : : : : This variable will be accessible in the base form and in the inherited form : : : : : : : How do I get a true boolean value from an inherited form to my main form? : : : : What function do i use??????? : : : : : : : : Thx : : : : Dhruv(BattleGuard) : : : : : : : : : : : : : : : : : : : :
Comments
Can you give an example of what you're trying to do?
A possibility...
In Base Form declare a Protected Boolean variable
Protected bLoading As Boolean
This variable will be accessible in the base form and in the inherited form
: How do I get a true boolean value from an inherited form to my main form?
: What function do i use???????
:
: Thx
: Dhruv(BattleGuard)
:
:
Well I was making a program and an options menu, so that is another form. And i want the user to check a checkbox to say if he wants to clear a box every time a math problem is solved... I am making a calculator. For now i have just made the checkbox in the same form as the main form, so its no problem. Help?????
Dhruv(BattleGuard)
: Hi,
:
: Can you give an example of what you're trying to do?
: A possibility...
: In Base Form declare a Protected Boolean variable
:
: Protected bLoading As Boolean
:
: This variable will be accessible in the base form and in the inherited form
:
: : How do I get a true boolean value from an inherited form to my main form?
: : What function do i use???????
: :
: : Thx
: : Dhruv(BattleGuard)
: :
: :
:
:
One method to save and retrieve application settings is by storing them in the registry by using GetSetting and SaveSetting.
For example,
'On the Close/Save of your options form...
Private Sub btnClose_Click('Arguments) Handles btnClose.Click
Dim sValue as string
If chkClearBox.Checked then
sValue = "TRUE"
else
sValue = "FALSE"
end if
'Save to Registry
SaveSetting(sAppName, "Options", "ClearBox", sValue)
End Sub
--
'Somewhere in the Main Form code
Dim sValue as string
'Retrieve From Registry
sValue = GetSetting(sAppName, "Options", "ClearBox")
If sValue = "TRUE" then
'Code to Clear Box
else
'Do not clear box
end if
***Please note that sAppName refers to the name of the application that you're running. You can retrieve the name of the application with the following code.
Dim s as string
s = System.Reflection.Assembly.GetExecutingAssembly.GetName.ToString
sAppName = s.Substring(0, s.IndexOf(","))
***Another option might be to research the capabilites of adding an App.Config file and store values there rather than the registry.
Hope this helps,
Chris
---------------------------------------------------------------------
: Hey,
: Well I was making a program and an options menu, so that is another form. And i want the user to check a checkbox to say if he wants to clear a box every time a math problem is solved... I am making a calculator. For now i have just made the checkbox in the same form as the main form, so its no problem. Help?????
:
: Dhruv(BattleGuard)
:
:
:
: : Hi,
: :
: : Can you give an example of what you're trying to do?
: : A possibility...
: : In Base Form declare a Protected Boolean variable
: :
: : Protected bLoading As Boolean
: :
: : This variable will be accessible in the base form and in the inherited form
: :
: : : How do I get a true boolean value from an inherited form to my main form?
: : : What function do i use???????
: : :
: : : Thx
: : : Dhruv(BattleGuard)
: : :
: : :
: :
: :
:
:
Thanx anyway,
Dhruv(BattleGuard)
: Hi,
:
: One method to save and retrieve application settings is by storing them in the registry by using GetSetting and SaveSetting.
:
: For example,
:
: 'On the Close/Save of your options form...
: Private Sub btnClose_Click('Arguments) Handles btnClose.Click
: Dim sValue as string
:
: If chkClearBox.Checked then
: sValue = "TRUE"
: else
: sValue = "FALSE"
: end if
: 'Save to Registry
: SaveSetting(sAppName, "Options", "ClearBox", sValue)
: End Sub
: --
: 'Somewhere in the Main Form code
: Dim sValue as string
:
: 'Retrieve From Registry
: sValue = GetSetting(sAppName, "Options", "ClearBox")
: If sValue = "TRUE" then
: 'Code to Clear Box
: else
: 'Do not clear box
: end if
:
: ***Please note that sAppName refers to the name of the application that you're running. You can retrieve the name of the application with the following code.
:
: Dim s as string
:
: s = System.Reflection.Assembly.GetExecutingAssembly.GetName.ToString
: sAppName = s.Substring(0, s.IndexOf(","))
:
: ***Another option might be to research the capabilites of adding an App.Config file and store values there rather than the registry.
:
: Hope this helps,
:
: Chris
: ---------------------------------------------------------------------
: : Hey,
: : Well I was making a program and an options menu, so that is another form. And i want the user to check a checkbox to say if he wants to clear a box every time a math problem is solved... I am making a calculator. For now i have just made the checkbox in the same form as the main form, so its no problem. Help?????
: :
: : Dhruv(BattleGuard)
: :
: :
: :
: : : Hi,
: : :
: : : Can you give an example of what you're trying to do?
: : : A possibility...
: : : In Base Form declare a Protected Boolean variable
: : :
: : : Protected bLoading As Boolean
: : :
: : : This variable will be accessible in the base form and in the inherited form
: : :
: : : : How do I get a true boolean value from an inherited form to my main form?
: : : : What function do i use???????
: : : :
: : : : Thx
: : : : Dhruv(BattleGuard)
: : : :
: : : :
: : :
: : :
: :
: :
:
: