jxharding
asked on
can i change app.config file so that value of key changes when MenuItem gets checked / unchecked
hi , this is my key in the app.config file
<add key="AppendTextBoolean" value="True" />
this is how i read it
Dim bConcatenateOutput As Boolean = System.Configuration.Confi gurationSe ttings.App Settings(" AppendText Boolean")
this is the Menu_click event
Private Sub mnuAppendToOutput_Click(By Val sender As System.Object, ByVal e As System.EventArgs) Handles mnuAppendToOutput.Click
If mnuAppendToOutput.Checked = True Then
mnuAppendToOutput.Checked = False
System.Configuration.Confi gurationSe ttings.App Settings(" AppendText Boolean") = "False"
Else
mnuAppendToOutput.Checked = True
System.Configuration.Confi gurationSe ttings.App Settings(" AppendText Boolean") = "True"
End If
End Sub
can i set the value of the Key to to change, because currently it says it is read only when i try to run the above code
thanks
<add key="AppendTextBoolean" value="True" />
this is how i read it
Dim bConcatenateOutput As Boolean = System.Configuration.Confi
this is the Menu_click event
Private Sub mnuAppendToOutput_Click(By
If mnuAppendToOutput.Checked = True Then
mnuAppendToOutput.Checked = False
System.Configuration.Confi
Else
mnuAppendToOutput.Checked = True
System.Configuration.Confi
End If
End Sub
can i set the value of the Key to to change, because currently it says it is read only when i try to run the above code
thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
hi ronald, i'm doing great thanks!
is there an easy way perhaps of reading the value when the application starts?
because currently i'll prob have to read it into a dataset, then make a dataview,sort it / filter it
locate the key i need e.g. MyBoolean , and then set the menu item to checked or not.
thanks for the help!
is there an easy way perhaps of reading the value when the application starts?
because currently i'll prob have to read it into a dataset, then make a dataview,sort it / filter it
locate the key i need e.g. MyBoolean , and then set the menu item to checked or not.
thanks for the help!
ASKER
please ignore last comment from myself, it was really stupid of myself. i haven't done this in a while.
thanks for the help again!
thanks for the help again!
yes you can,
something like
dim ds as new dataset
ds.ReadXml(Application.Sta
ds.Tables(1).Rows(0).Item(