473,396 Members | 1,877 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,396 software developers and data experts.

Data binding to My.Settings

How do I bind a value from My.Settings to a property on a control on a
Windows form?

I've created a setting called My.Settings.Value1 of type String. Now I want
to create a "Settings" dialog box that allows the user to view or change
My.Settings.Value1.

I added My.MySettings as a Data Source.
I created a simple dialog box with Ok and Cancel buttons.
I dragged Value1 from the Data Sources window to the form. The designer
dutifully created a TextBox with its Text property wired to a BindingSource,
plus a BindingNavigator (the purpose of which is a mystery to me).

I run my application, display the dialog box, type something into the
TextBox, and click the Ok button. In the Ok button's Click event handler,
My.Settings.Value1 contains an empty string. (Yes I called
MySettingsBindingSource.EndEdit before I examined the value of
My.Settings.Value1.)

Any suggestions? TIA!

- Bob
Aug 3 '06 #1
1 6404
I stumbled across the answer in the latest issue of CoDe Magazine
(http://www.code-magazine.com/Article...ickid=0607031). Simply select
the control, and, in the properties window open the (Application Settings)
property. Then click on the [...] button in the (Property Bindings)
property.

Apparently, trying to use the Data Source magic to create a binding doesn't
work. Looks like a bug to me...

- Bob

"Bob Altman" <rd*@nospam.nospamwrote in message
news:%2****************@TK2MSFTNGP02.phx.gbl...
How do I bind a value from My.Settings to a property on a control on a
Windows form?

I've created a setting called My.Settings.Value1 of type String. Now I
want
to create a "Settings" dialog box that allows the user to view or change
My.Settings.Value1.

I added My.MySettings as a Data Source.
I created a simple dialog box with Ok and Cancel buttons.
I dragged Value1 from the Data Sources window to the form. The designer
dutifully created a TextBox with its Text property wired to a
BindingSource,
plus a BindingNavigator (the purpose of which is a mystery to me).

I run my application, display the dialog box, type something into the
TextBox, and click the Ok button. In the Ok button's Click event handler,
My.Settings.Value1 contains an empty string. (Yes I called
MySettingsBindingSource.EndEdit before I examined the value of
My.Settings.Value1.)

Any suggestions? TIA!

- Bob


Aug 3 '06 #2

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

Similar topics

2
by: Jonathan | last post by:
I'm puzzled by Python's behavior when binding local variables which are introduced within exec() or execfile() statements. First, consider this simple Python program: # main.py def f() : x = 1...
0
by: Ann Morris | last post by:
INTRODUCTION One of the most powerful aspects of .NET and Windows Forms is data binding. Data binding is the process of associating user interface (UI) elements with a data source to generate a...
2
by: Grey | last post by:
I want to know how to dynamically bind the data in label field. My requirement is that I need to display a label with a data which is retrieved from preceding page and I want to use the data...
0
by: NicK chlam via DotNetMonster.com | last post by:
this is the error i get System.Data.OleDb.OleDbException: Syntax error in INSERT INTO statement. at System.Data.Common.DbDataAdapter.Update(DataRow dataRows, DataTableMapping tableMapping) at...
0
by: alan | last post by:
Dear all, I'm trying to do a data binding for a ListView and I rewrite the code from some example but there is a error while I execute. Can anybody tell me what's wrong with it?? Thank you!! ...
0
by: sonu | last post by:
I have following client side code which i have used in my asp.net project SummaryFeatured Resources from the IBM Business Values Solution Center WHITEPAPER : CRM Done Right Improve the...
1
by: h | last post by:
Hi, I am binding datetimepicker control in vb.net 2005, I set following property for the control. format -> custom, customformat -> dd/MM/yyy, Above control runs well if I set my system date...
14
by: Rolf Welskes | last post by:
Hello, I have an ObjectDataSource which has as business-object a simple array of strings. No problem. I have an own (custom) control to which I give the DataSourceId and in the custom-control...
0
by: =?Utf-8?B?Q3JhaWdo?= | last post by:
Background: I am currently using WCF for remoting (using CSLA hosted in IIS) with a binding config entry like this: <binding name ="default" transferMode="Buffered" messageEncoding="Text"...
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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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...
0
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.