473,378 Members | 1,592 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

problem with my.settings

Hi, I have 2 questions about saving windows form settings.
I have a form with 1 textbox and 2 radiobuttons
I added application settings for :
textbox1, radiobutton1 and form location
I've set my.settings.save on form closing event.

I find :
-radiobutton doesn't remember its state but textbox remembers its
value
-if I minimize form then i close it by right menu, on next start it
won't show itself.
Any solutions?
Thanks.
Jan 6 '08 #1
5 1944
On Jan 6, 4:35 pm, Alcibiade <panda...@libero.itwrote:
Hi, I have 2 questions about saving windows form settings.
I have a form with 1 textbox and 2 radiobuttons
I added application settings for :
textbox1, radiobutton1 and form location
I've set my.settings.save on form closing event.

I find :
-radiobutton doesn't remember its state but textbox remembers its
value
-if I minimize form then i close it by right menu, on next start it
won't show itself.
Any solutions?
Thanks.
First right click on your app and go to settings then create 2
varibles named:

1)Radio1 as "boolean" type
2)Radio2 as "boolean" type
and leave value areas as blank or set true or false, doesn't matter.

This code works however you close your form, try:

Public Class Form1

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
With My.Settings
RadioButton1.Checked = .Radio1
RadioButton2.Checked = .Radio2
End With
End Sub

Private Sub Form1_closing(ByVal sender As System.Object, ByVal e As
System.Windows.Forms.FormClosingEventArgs) Handles MyBase.FormClosing
With My.Settings
.Radio1 = RadioButton1.Checked
.Radio2 = RadioButton2.Checked
End With
End Sub

End Class

Meanwhile," off-topic" maybe it's a bug or not, if there's more than
one radio button on a form (eg: two radio buttons), although both of
their default "checked" values are false, always one of them(usually
first) is checked as runtime. Why?

Hope this helps.
Jan 6 '08 #2

"kimiraikkonen" <ki*************@gmail.comkirjoitti viestissä
news:16**********************************@i3g2000h sf.googlegroups.com...
On Jan 6, 4:35 pm, Alcibiade <panda...@libero.itwrote:
>Hi, I have 2 questions about saving windows form settings.
I have a form with 1 textbox and 2 radiobuttons
I added application settings for :
textbox1, radiobutton1 and form location
I've set my.settings.save on form closing event.

I find :
-radiobutton doesn't remember its state but textbox remembers its
value
-if I minimize form then i close it by right menu, on next start it
won't show itself.
Any solutions?
Thanks.

First right click on your app and go to settings then create 2
varibles named:

1)Radio1 as "boolean" type
2)Radio2 as "boolean" type
and leave value areas as blank or set true or false, doesn't matter.

This code works however you close your form, try:
It would be easier to just create those settings and then bind them to
RadioButtons' properties. There is (Application Settings) in Properties
window where Checked property can be bound to created setting. Now the
settings will be loaded and saved without any code.
Meanwhile," off-topic" maybe it's a bug or not, if there's more than
one radio button on a form (eg: two radio buttons), although both of
their default "checked" values are false, always one of them(usually
first) is checked as runtime. Why?
I think there must be one radio button checked in every panel or container.

-Teemu

Jan 6 '08 #3
>
Meanwhile," off-topic" maybe it's a bug or not, if there's more than
one radio button on a form (eg: two radio buttons), although both of
their default "checked" values are false, always one of them(usually
first) is checked as runtime. Why?

I think there must be one radio button checked in every panel or container.
Maybe but this "problem" can be solved by setting radiobutton's
default value as "true" then back again "false" or something like
that. After playing with default menus and leaving both radio button's
"checked" value as "false" makes both radio buttons unchecked on
runtime by default.

However having one of radio buttons checked on form by default, may
apply pressure on user about selecting pre-selected radio button :-)
-Teemu
Jan 6 '08 #4

"kimiraikkonen" <ki*************@gmail.comkirjoitti viestissä
news:9f**********************************@u10g2000 prn.googlegroups.com...
However having one of radio buttons checked on form by default, may
apply pressure on user about selecting pre-selected radio button :-)
It is the main idea that always one of the radio buttons is selected. In my
opinion it's against UI design guidelines to make all of them unchecked.

-Teemu

Jan 6 '08 #5
On 6 Gen, 18:12, "Teemu" <tsir...@hotmail.comwrote:
It would be easier to just create those settings and then bind them to
RadioButtons' properties. There is (Application Settings) in Properties
window where Checked property can be bound to created setting. Now the
settings will be loaded and saved without any code.
Ithink it's a fast way binding settings to radiobutton's properties
but it doesn't work good!! I've 2 radiobuttons associated with 2
different settings. To select a different radiobutton I have to select
twice same radiobutton: for example, by first click the firts
radiobutton become unchecked, by second click the second radiobutton
become checked....
Jan 7 '08 #6

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

Similar topics

6
by: harry | last post by:
Hi, I have a program that runs on multiple client pc's. Occasionally one or more of those pc's use VPN to connect to another corporate network. When using VPN they need to set proxy server in...
12
by: SJD | last post by:
I've just read Christoph Schittko's article on XmlSerializer: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnxmlnet/html/trblshtxsd.asp . . . and very informative it is too....
2
by: Danny Springer | last post by:
I am trying to create the following xml file with VS 2005: <?xml version='1.0' encoding='utf-8'?> <SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings"...
5
by: Robbert van Geldrop | last post by:
Hello, I have a problem consuming a WebService which appears to be dependent of the type of network I am on: The following SOAP response is not processed when I am connected over the internet...
2
by: Jeff | last post by:
Hey asp.net 2.0 My asp.net 2.0 project has got a assembly load problem: Some of my web.config settings: <membership defaultProvider="AH_MembershipProvider" userIsOnlineTimeWindow="15">
0
by: Marc | last post by:
Hello, I have a problem with the settings (save and load) My.Settings in VB.NET2005. Actually, I have made a new application, then I have created a setting (with a default value) and then I...
7
by: siggi | last post by:
Hi all, when I do >>>sys.path in IDLE (winXP), i get a horrendously long list of paths, paths I may have used during a lot of trials and errors. How can I clean up sys.path? I mean, trim it of...
3
by: Jeff | last post by:
ASP.NET 2.0 These settings below (see PROBLEM SETTINGS) are causing my webproject to NOT connect with ASPNETDB.MDF. In this webproject have I created 3 users. I can see 3 users in the "ASP.NET...
0
by: james.mcdonagh | last post by:
Hi I am a newbie using nAnt for .net 2.0. As such I have not come across this bug before, and I would be happy of any help that you may be able to provide. In order to help I have included the...
19
by: foolsmart2005 | last post by:
I have written a snake game. There are 2 levels in the game(I finished 1st level). It can run in VC++ without problem but, when I run it on the dev C++ 4.9.9.2, it cannot run. I want to...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

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.