Using Settings?

Post your questions regarding programming in C# in here.
4 posts Page 1 of 1
Contributors
User avatar
zachman61
VIP - Donator
VIP - Donator
Posts: 1892
Joined: Wed Dec 16, 2009 9:56 pm

Using Settings?
zachman61
I know in vb you use
my.settings.
who would you do this in c# for a if then
like
in vb it would be
Code: Select all
If my.settings.blah = "" then
Form1.show
i know i left out the end if
but how do i show a form also for that matter lol.
Nailing my feet to the floor is easier than using my own muscles to balance, but you don't see me doing that :)
User avatar
Axel
Coding God
Coding God
Posts: 1928
Joined: Sun Jun 27, 2010 9:15 pm

Re: Using Settings?
Axel
Code: Select all
if(Properties.Settings.Default.Blah == null)
{
Form1 frm = new Form1();
frm.Show();
}
Or if you want blah to be a specific text , just replace null with text between quotation marks

:D
http://vagex.com/?ref=25000
User avatar
zachman61
VIP - Donator
VIP - Donator
Posts: 1892
Joined: Wed Dec 16, 2009 9:56 pm

Re: Using Settings?
zachman61
Thanks Axel :)
Nailing my feet to the floor is easier than using my own muscles to balance, but you don't see me doing that :)
User avatar
Agust1337
Coding God
Coding God
Posts: 2456
Joined: Fri Feb 19, 2010 8:18 pm

Re: Using Settings?
Agust1337
or you can do
Code: Select all
using 'projectname'.Properties;
public class 'projectname'
{
private void button1_Click(object sender, eventargs e)
{
if (settings.default.something == null)
{
Form1 frm = new Form1();
frm.Show();
}
}
}
Top-notch casual Dating
4 posts Page 1 of 1
Return to “General coding help”