473,403 Members | 2,183 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,403 software developers and data experts.

Changing a default property's value

I have a string which has been assigned the value of "OneTwoThree". I have
created a property because I want to be able to assign a new value to this
string.

I have:

string numbers = "OneTwoThree";

public string StringToCompare
{
get
{
return numbers;
}
set
{
numbers = value;
}
}

Obviously, this doesn't work.

My program will start up automatically when the user opens their PC and
won't give them the opportunity to set the value of numbers straight away.
Instead, they will have to enter the string "OneTwoThree" to make the form
visible and enable them to change it's value.

Is there a way to accomplish this?

Nov 17 '05 #1
4 4523
VJ
I don't understand your question.. why wont the property work? Are you
saying you want to use a property to show a Form, but you wont get the
oppurtunity becasue your program will start automatically on PC boot.. I am
confused

VJ

"cashdeskmac" <ca*********@discussions.microsoft.com> wrote in message
news:CD**********************************@microsof t.com...
I have a string which has been assigned the value of "OneTwoThree". I
have
created a property because I want to be able to assign a new value to this
string.

I have:

string numbers = "OneTwoThree";

public string StringToCompare
{
get
{
return numbers;
}
set
{
numbers = value;
}
}

Obviously, this doesn't work.

My program will start up automatically when the user opens their PC and
won't give them the opportunity to set the value of numbers straight away.
Instead, they will have to enter the string "OneTwoThree" to make the form
visible and enable them to change it's value.

Is there a way to accomplish this?

Nov 17 '05 #2
My application will start invisibly when the user starts their PC. It will
have a default key value of "OneTwoThree", and entering this key sequence
will make the form visible and editable. I then want to offer the user the
chance to change the key to a string of their choice.

"VJ" wrote:
I don't understand your question.. why wont the property work? Are you
saying you want to use a property to show a Form, but you wont get the
oppurtunity becasue your program will start automatically on PC boot.. I am
confused

VJ

"cashdeskmac" <ca*********@discussions.microsoft.com> wrote in message
news:CD**********************************@microsof t.com...
I have a string which has been assigned the value of "OneTwoThree". I
have
created a property because I want to be able to assign a new value to this
string.

I have:

string numbers = "OneTwoThree";

public string StringToCompare
{
get
{
return numbers;
}
set
{
numbers = value;
}
}

Obviously, this doesn't work.

My program will start up automatically when the user opens their PC and
won't give them the opportunity to set the value of numbers straight away.
Instead, they will have to enter the string "OneTwoThree" to make the form
visible and enable them to change it's value.

Is there a way to accomplish this?


Nov 17 '05 #3
Store the new value in the registry. Then, when the application starts,
ignore the key sequences until you check the registry. If no entry exists
in the registry, begin responding to the default value. If a value exists
in the registry, store that value in your property and begin responding to
the sequences. Here it is in psuedo code:

public MyApp() // this is your constructor or a method called by your
constructor.
{
string newKeySequence = checkRegistryForValue();
if (newKeySequence != null)
{
StringToCompare = newKeySequence;
}
}

HTH

Dale Preston
MCAD, MCDBA, MCSE

"cashdeskmac" <ca*********@discussions.microsoft.com> wrote in message
news:BC**********************************@microsof t.com...
My application will start invisibly when the user starts their PC. It will have a default key value of "OneTwoThree", and entering this key sequence
will make the form visible and editable. I then want to offer the user the chance to change the key to a string of their choice.

"VJ" wrote:
I don't understand your question.. why wont the property work? Are you
saying you want to use a property to show a Form, but you wont get the
oppurtunity becasue your program will start automatically on PC boot.. I am confused

VJ

"cashdeskmac" <ca*********@discussions.microsoft.com> wrote in message
news:CD**********************************@microsof t.com...
I have a string which has been assigned the value of "OneTwoThree". I
have
created a property because I want to be able to assign a new value to this string.

I have:

string numbers = "OneTwoThree";

public string StringToCompare
{
get
{
return numbers;
}
set
{
numbers = value;
}
}

Obviously, this doesn't work.

My program will start up automatically when the user opens their PC and won't give them the opportunity to set the value of numbers straight away. Instead, they will have to enter the string "OneTwoThree" to make the form visible and enable them to change it's value.

Is there a way to accomplish this?


Nov 17 '05 #4
"cashdeskmac" <ca*********@discussions.microsoft.com> a écrit dans le
message de news: CD**********************************@microsoft.com...
My program will start up automatically when the user opens their PC and
won't give them the opportunity to set the value of numbers straight away.
Instead, they will have to enter the string "OneTwoThree" to make the form
visible and enable them to change it's value.


You should initialise all fields that need non-default values in the
constructor of your class.

Joanna

--
Joanna Carter
Consultant Software Engineer
Nov 17 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: ehm | last post by:
I am working on creating an editable grid (for use in adding, deleting, and editing rows back to an Oracle database). I have a JSP that posts back to a servlet, which in turns posts to a WebLogic...
0
by: Job Lot | last post by:
How can I make a property change value of another property at design time? I have added HighlightRow property to custom DataGrid control. Now I want to assign this property similar to DataGrid’s...
8
by: horos | last post by:
hey all, Ok, a related question to my previous one on data dumpers for postscript. In the process of putting a form together, I'm using a lot of placeholder variables that I really don't care...
5
by: David Deacon | last post by:
Hi i was given the following advise,below my OriginalQuestion I am a little new to ADOX can you direct me to the following Do i place the code behind a button on a form? Or do i place it in the...
6
by: AMP | last post by:
Hello, I have an mdi program with a child form ("A") and another child ("B"). I want to change the text of a label on A by changing an item from a combobox on B. I can code the...
1
by: sunil | last post by:
Hi, I want to change the default installation folder to my own path. I did it by changing the application folder's DefaultLocation property. The installation works fine as long the path that I...
8
by: Steve | last post by:
Hi All Is there a way to change the colour of a Groupbox border in VB.net 2005 I want to change it to white Can it be done in the onpaint event? Regards Steve
0
by: waltvw | last post by:
I'm trying to change the default property for a check box field on a form as well as a a particular property of that form. After I run the code both the form and the control start behaving the way I...
0
by: ziketo | last post by:
Hi, I searched a lot about changing the DataGridView cell borders. BYTES helped me so I will write down the solution: 1. You should override the class DataGridViewTextBoxCell, and the new class...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.