I know I am missing something conceptual here, probably pretty simple too.
I am trying to make a user preferences dialog box.
I have a Windows form with suitable textboxes on. In VB 2005 Express, I
created a datasource from the My.Settings object, and dragged the "fields"
from that datasource onto the textboxes. A bindingsource object appeared in
the tray, and the properties of the textboxes show the correct links in the
Bindings properties. So far so good.
On loading the form, however, I get a bunch of empty textboxes instead of
the values that are actually in the settings.
I can't see any code anywhere to make the bindingsource actually go and get
the data from the My.Settings object itself, nor how to make it send the
altered values back. I don't know whether I need a data.datatable
somewhere, but I'm not quite sure how to create it; or if it's just a
MySettingsBindingSource.Bindings.Refresh (no, that doesn't seem to do
anything).
Thanks in advance
Tim F
Jim Hughes - 23 Feb 2006 22:25 GMT
search MSDN help for "ChangeAndPersistSettings" or "How to: Persist User
Settings in Visual Basic"
and "How to: Create Property Grids for User Settings in Visual Basic" you
don't even need the textboxes!
"ms-help://MS.VSCC.v80/MS.MSDN.v80/MS.VisualStudio.v80.en/dv_vbcn/html/0e5e6415-b6e2-4602-9be0-a65fa167d007.htm"
>I know I am missing something conceptual here, probably pretty simple too.
>
[quoted text clipped - 22 lines]
>
> Tim F
Tim Ferguson - 24 Feb 2006 17:30 GMT
> search MSDN help for "ChangeAndPersistSettings" or "How to: Persist
> User Settings in Visual Basic"
>
> and "How to: Create Property Grids for User Settings in Visual Basic"
> you don't even need the textboxes!
Thank you Jim. The property grid is a very cool solution.
Actually, with a bit more experimentation, I found a way. Calling
MySettingsBindingSource.AddNew
gets the data out of the oject and into the textboxes, although I really
don't understand why.
Thanks for your help
Tim F