T
Tom Scales
OK, this one has me stumped. I am reading XML into a Dataset and then
binding values to a label control. When displayed on the screen, the label
control has the correct value in it.
When I read back the value from the label control, the text field is "".
But ONLY if the label field is on a tab in a tab control. If the label
field is on the main form, the code works!
Here's my example code:
------------------------
Public dsConfig As New DataSet
Try
dsConfig.ReadXml(AppPath() & "default.config.xml")
' OK, we're attached to our file, let's put the values into the label
control
lblPath.DataBindings.Add("text", dsConfig, "Config.ConfigPath")
lblConfig.DataBindings.Add("text", dsConfig, "Config.ConfigFile")
Catch ex As Exception
MsgBox("Error Loading default configuration", MsgBoxStyle.OKOnly +
MsgBoxStyle.Critical, "Critical error")
Me.Close() ' get the heck out!
End Try
---------------------------------
So, if lblPath or lblConfig is on a tab, then lblPath.Text is empty. If it
is on the main form, it has the proper value from the XML. Either way, it
displays properly on the form
Any solutions?
Thanks in advance,
Tom
binding values to a label control. When displayed on the screen, the label
control has the correct value in it.
When I read back the value from the label control, the text field is "".
But ONLY if the label field is on a tab in a tab control. If the label
field is on the main form, the code works!
Here's my example code:
------------------------
Public dsConfig As New DataSet
Try
dsConfig.ReadXml(AppPath() & "default.config.xml")
' OK, we're attached to our file, let's put the values into the label
control
lblPath.DataBindings.Add("text", dsConfig, "Config.ConfigPath")
lblConfig.DataBindings.Add("text", dsConfig, "Config.ConfigFile")
Catch ex As Exception
MsgBox("Error Loading default configuration", MsgBoxStyle.OKOnly +
MsgBoxStyle.Critical, "Critical error")
Me.Close() ' get the heck out!
End Try
---------------------------------
So, if lblPath or lblConfig is on a tab, then lblPath.Text is empty. If it
is on the main form, it has the proper value from the XML. Either way, it
displays properly on the form
Any solutions?
Thanks in advance,
Tom