-
September 4th, 2011, 02:30 PM
#1
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
-
September 4th, 2011, 03:30 PM
#2
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/
Always use [code][/code] tags when posting code.
-
September 4th, 2011, 03:53 PM
#3
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?
-
September 4th, 2011, 06:01 PM
#4
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
Always use [code][/code] tags when posting code.
-
September 4th, 2011, 09:01 PM
#5
Re: If Statement not working (Properties.Settings)
Thanks. I will look into it and let you know.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|