If Statement not working (Properties.Settings)
Have a quick question:
I have some Properites.Settings set up. One setting is passwordhint.
On one form I have a textbox (textbox1) and a label (label3)
The user will enter the password hint in the textbox1 and the label3 will show the Properties.Settings.pass
I do know in VB.NET it is
Code:
If Textbox1.Text = My.Settings.passhin Then
Label3.Text = My.Settings.passhin
End If
However, I am very new to C# and this is kinda confusing.......
I have right now:
Code:
{
If(textBox1.Text = Properties.Settings.Default.passhin);
{
label3.Text = Properties.Settings.Default.passhin;
}
but it wont work....... Can someone help me with the syntax needed??
Thanks in advanced.
daveofgv
Re: If Statement not working (Properties.Settings)
Code:
if (Textbox1.Text == My.Settings.passhin) {
Label3.Text = My.Settings.passhin;
}
http://www.developerfusion.com/tools.../vb-to-csharp/
Re: If Statement not working (Properties.Settings)
Erors say:
The name 'Textbox1' does not exist in the current context
The name 'My' does not exist in the current context
The name 'Label3' does not exist in the current context
The name 'My' does not exist in the current context
Am I suppose to delcare the above? If so, how?
Re: If Statement not working (Properties.Settings)
Sound slike you are trying to reference these outside the class they are in. In which case you would get the same errors in VB.Net
Re: If Statement not working (Properties.Settings)
Thanks. I will look into it and let you know. :)