can't get value from xml

  • Thread starter Thread starter Supra
  • Start date Start date
S

Supra

how do i get value from xml file to checkbox1.checked ( 1 or 0) .

i stored value to xml:
rw.WriteConfigInfo("UserModes", "InvisibleOnServer",
CStr(chkInvisible.CheckState), "PirateChat.xml")

get value from xml and store in checkbox1.checked . but i couldn't get
value from xml:

'load user modes
Dim szInvisible As Collection =
clsReader.GetConfigInfo("PirateChat", "InvisibleOnServer", " ",
"PirateChat.xml")
Dim getInvisible As String
For Each getInvisible In szInvisible
chkInvisible.Checked = Val(getInvisible)
Debug.WriteLine("state :" & Val(getInvisible))
Next

all i got 0 value.

regards
 
this is what i got from xml file :
<UserModes>
<InvisibleOnServer>1</InvisibleOnServer>
<ReceiveServerMsg>1</ReceiveServerMsg>
<Wallop>1</Wallop>
</UserModes>
 
how do i get value from xml file to checkbox1.checked ( 1 or 0) .

i stored value to xml:
rw.WriteConfigInfo("UserModes", "InvisibleOnServer",
CStr(chkInvisible.CheckState), "PirateChat.xml")

get value from xml and store in checkbox1.checked . but i couldn't get
value from xml:

'load user modes
Dim szInvisible As Collection =
clsReader.GetConfigInfo("PirateChat", "InvisibleOnServer", " ",
"PirateChat.xml")
Dim getInvisible As String
For Each getInvisible In szInvisible
chkInvisible.Checked = Val(getInvisible)
Debug.WriteLine("state :" & Val(getInvisible))
Next

all i got 0 value.

regards

You could do this:

chkInvisible.Checked = (Val(getInvisible) = 1)

If Val(getInvisible) is 0 then the condition will evaluate at false
--
Chris

dunawayc[AT]sbcglobal_lunchmeat_[DOT]net

To send me an E-mail, remove the "[", "]", underscores ,lunchmeat, and
replace certain words in my E-Mail address.
 
Back
Top