473,657 Members | 2,592 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

radio button user settings

I am having problems on getting the radio button to work with my.settings
correctly. I want the program to check to see which one was last saved to use
at startup. The closest I have come is that I need to click the radio button
twice for it to be saved correctly.
Any idea on what to use? I think the code should be fairly simple but I am
missing it for some reason.
Apr 16 '06 #1
10 2616

"Scuba Rob" <Sc******@discu ssions.microsof t.com> wrote in message
news:6F******** *************** ***********@mic rosoft.com...
I am having problems on getting the radio button to work with my.settings
correctly. I want the program to check to see which one was last saved to
use
at startup. The closest I have come is that I need to click the radio
button
twice for it to be saved correctly.


Huh? You'd need to set a flag and persist that to reuse it.

Apr 16 '06 #2


"Homer J Simpson" wrote:

"Scuba Rob" <Sc******@discu ssions.microsof t.com> wrote in message
news:6F******** *************** ***********@mic rosoft.com...
I am having problems on getting the radio button to work with my.settings
correctly. I want the program to check to see which one was last saved to
use
at startup. The closest I have come is that I need to click the radio
button
twice for it to be saved correctly.


Huh? You'd need to set a flag and persist that to reuse it.

I save the new settings after clicking the other radio button. After clicking the radio button once the labels.text would update like it is supposed to but neither radio button would show as being selected. The second click would show the selected radio button andupon the next startup would correctly show as being correct.

Does this make any more sense? I'll post the code if you wish to see it.
Apr 16 '06 #3

"Scuba Rob" <Sc******@discu ssions.microsof t.com> wrote in message
news:47******** *************** ***********@mic rosoft.com...
I save the new settings after clicking the other radio button. After
clicking the radio button once the labels.text would update like it is
supposed to but neither radio button would show as being selected. The
second click would show the selected radio button and upon the next
startup would correctly show as being correct.
Does this make any more sense? I'll post the code if you wish to see it.


Looks like there is something wrong with the radio button setup in that
case. Try creating a new solution with just the radio buttons and see if
they work OK.

Apr 17 '06 #4
OK, thanks Homer. I'll try this tomorrow

"Homer J Simpson" wrote:

"Scuba Rob" <Sc******@discu ssions.microsof t.com> wrote in message
news:47******** *************** ***********@mic rosoft.com...
I save the new settings after clicking the other radio button. After
clicking the radio button once the labels.text would update like it is
supposed to but neither radio button would show as being selected. The
second click would show the selected radio button and upon the next
startup would correctly show as being correct.
Does this make any more sense? I'll post the code if you wish to see it.


Looks like there is something wrong with the radio button setup in that
case. Try creating a new solution with just the radio buttons and see if
they work OK.

Apr 17 '06 #5
Here is what I have for code but it still does not work. Any help would be
greatly appreciated:
Public Class Form1

Private Sub Button2_Click(B yVal sender As System.Object, ByVal e As
System.EventArg s) Handles Button2.Click
End
End Sub

Private Sub RadioButton1_Ch eckedChanged(By Val sender As System.Object,
ByVal e As System.EventArg s) Handles RadioButton1.Ch eckedChanged,
RadioButton2.Ch eckedChanged
Call settings()
End Sub

Public Sub settings()
If RadioButton1.Ch ecked = True Then
Me.Text = "Imperial"
My.Settings.Imp erial = True
ElseIf RadioButton2.Ch ecked = True Then
Me.Text = "Metric"
My.Settings.Met ric = True
End If
My.Settings.Sav e()
End Sub

Private Sub Form1_Load(ByVa l sender As Object, ByVal e As
System.EventArg s) Handles Me.Load
Call settings()
End Sub
End Class

"Scuba Rob" wrote:
OK, thanks Homer. I'll try this tomorrow

"Homer J Simpson" wrote:

"Scuba Rob" <Sc******@discu ssions.microsof t.com> wrote in message
news:47******** *************** ***********@mic rosoft.com...
I save the new settings after clicking the other radio button. After
clicking the radio button once the labels.text would update like it is
supposed to but neither radio button would show as being selected. The
second click would show the selected radio button and upon the next
startup would correctly show as being correct.
Does this make any more sense? I'll post the code if you wish to see it.


Looks like there is something wrong with the radio button setup in that
case. Try creating a new solution with just the radio buttons and see if
they work OK.

Apr 18 '06 #6

"Scuba Rob" <Sc******@discu ssions.microsof t.com> wrote in message
news:7F******** *************** ***********@mic rosoft.com...
Here is what I have for code but it still does not work. Any help would be
greatly appreciated:


I put both buttons in a GroupBox.

Private Sub RadioButton1_Ch eckedChanged(By Val sender As System.Object, _
ByVal e As System.EventArg s) Handles RadioButton1.Ch eckedChanged, _
RadioButton2.Ch eckedChanged
If RadioButton1.Ch ecked = True Then
Me.Text = "Imperial"
Else
Me.Text = "Metric"
End If
End Sub

Apr 18 '06 #7
This part always worked fine. I need to store the radio button setting state
in the settings so upon startup it remembers which system to use, metric or
imperial. I have the Metric and Imperial setup in the settings as boolean.

Rob

"Homer J Simpson" wrote:

"Scuba Rob" <Sc******@discu ssions.microsof t.com> wrote in message
news:7F******** *************** ***********@mic rosoft.com...
Here is what I have for code but it still does not work. Any help would be
greatly appreciated:


I put both buttons in a GroupBox.

Private Sub RadioButton1_Ch eckedChanged(By Val sender As System.Object, _
ByVal e As System.EventArg s) Handles RadioButton1.Ch eckedChanged, _
RadioButton2.Ch eckedChanged
If RadioButton1.Ch ecked = True Then
Me.Text = "Imperial"
Else
Me.Text = "Metric"
End If
End Sub

Apr 18 '06 #8

"Scuba Rob" <Sc******@discu ssions.microsof t.com> wrote in message
news:D2******** *************** ***********@mic rosoft.com...
This part always worked fine. I need to store the radio button setting
state
in the settings so upon startup it remembers which system to use, metric
or
imperial. I have the Metric and Imperial setup in the settings as boolean.


Some have suggested that using a .ini file is easier and more reliable than
using the 'settings'. Or you could use the registry which is also pretty
reliable.

If you want to use My.Settings consider storing the state of 'Imperial' only
(True or False).
Apr 18 '06 #9
Homer,
I finally have got it to work using the My.Settings. Took me a few hours
playing with different settings but seems to work fine in the test
application.
Thanks for the help. I can send the code if anyone wants it.

Rob

"Homer J Simpson" wrote:

"Scuba Rob" <Sc******@discu ssions.microsof t.com> wrote in message
news:D2******** *************** ***********@mic rosoft.com...
This part always worked fine. I need to store the radio button setting
state
in the settings so upon startup it remembers which system to use, metric
or
imperial. I have the Metric and Imperial setup in the settings as boolean.


Some have suggested that using a .ini file is easier and more reliable than
using the 'settings'. Or you could use the registry which is also pretty
reliable.

If you want to use My.Settings consider storing the state of 'Imperial' only
(True or False).

Apr 19 '06 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
3881
by: M.E. | last post by:
Hi I have 4 radio buttons. each button to determine which page to go to. But before page open user enters username in a text box. So when submitted, Page opens relevant to that user displaying selected page. I have no idea how to achieve this, and a good example would be greatly appreciated.
3
2294
by: elhombrebala | last post by:
With this script I can force the user to select the checkbox befor continuing, but now I have a menu with lots of radio unputs and I woul like the user to select at least 2 of them; how can I check it? <form name=formulario> <INPUT type=checkbox name=casilla> <INPUT type=button value="Salir" onclick="Goingout()"> </form>
1
454
by: Frank Xia | last post by:
I have a lot of grouped radio buttons on 7 tab pages (in one tab control). What I want to achieve is once user click "Complete" button all radio buttons get locked and user could not change any grouped radio button settings. Many thanks in advance for any feedback! have a nice day!
5
3094
by: Digital Puer | last post by:
I have the following HTML form: - radio button A (default selected) - radio button B - input field, of type "file" with "Choose" button - submit button I would like to have it so that if the user clicks on the "Choose" button of the input field (to select a file on the local disk), then radio button B is automatically
3
3119
by: John Davis | last post by:
I created a ASP.NET Web Form using VB.NET with a text box, 2 radio buttons. When the user click the first radio button, the text will change to uppercase. If the user clicks the other radio button, the text will change to lowercase. I added the following event, but still won't able to change the text to uppercase. Private Sub RadioButton1_CheckedChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles...
2
3478
by: NishSF | last post by:
Would anyone have any suggestions/javascript code so that if one clicks the Radio Button "Yes" below he has the option of selecting any of the six CheckBox below. If the user clicks on Radio Button "No", he should not have the option of clicking on any of the six checkboxes. See Code attached. Thank you so much in advance for your help as I can't get to make this combo work. <p>Did you have any problems finding any of the information...
1
2972
by: Joe Attardi | last post by:
Hi all, On a form on one of my pages I have two <select> elements, and each one is paired up with a radio button. The idea is to choose an item from one list or the other and select the radio button of the list you want to use. I'm using JavaScript to automatically select the radio button corresponding to a list when you click on the list (using the onclick event handler). Is that the best event to change on, or should this
10
6074
by: IchBin | last post by:
I am trying to set the state of a radio button. I do not see what I am doing wrong. Sorry, I am new at this.. I need another set of eyes to look at this snip of code. I am trying to set the radio button with this link of code: echo 'SCRIPT language=JavaScript setCheckedValue("'.$_SESSION.'");</SCRIPT>'; //? <snip of code>
2
12425
by: Eric Layman | last post by:
Hi, I have a radio button and a combo box. Upon changing a value for radio button, the combo box values will be dynamically updated. I have an idea on how to go abt doing it but Im stuck into converting into code.
0
8326
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8845
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8522
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7355
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6177
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5647
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4333
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2745
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1736
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.