473,218 Members | 1,448 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,218 software developers and data experts.

Form Property

How do you add a property to a form that will show up in the properties
window in the IDE? I can add the property to the form, but haven't been
able to see it in the properties window. I'm using the VS2005 if it makes
any difference... TIA
Dec 15 '05 #1
3 1104
Making designable controls is a bit more advanced than that. But for
something simple, try this:

Create a BASEFORM class which is just a standard windows form. Add your
public property to it.
Then add a second class to your project that inherits from your
BASEFORM class, instead of System.Windows.Forms.Form

Now you will see your new form has the property you created in your
base class.

When you say Property, make sure it really is a PROPERTY, not just a
public variable.
Ie.
private string _testProperty = "";
public string TestProperty {
get {
return _testProperty;
}
set {
_testProperty = value;
}
}

Hope this gives you a good starting point.
I used the help walktroughts in MSDN to learn more about creating
custom controls.
You might like these too.

Steven Nagy

Dec 15 '05 #2
Thanks a lot for the reply --- you hit the nail on the head! I'm psyched
for c#, but I'm finding the learning curve fun/challenging at the same time.

"Steven Nagy" <le*********@hotmail.com> wrote in message
news:11*********************@f14g2000cwb.googlegro ups.com...
Making designable controls is a bit more advanced than that. But for
something simple, try this:

Create a BASEFORM class which is just a standard windows form. Add your
public property to it.
Then add a second class to your project that inherits from your
BASEFORM class, instead of System.Windows.Forms.Form

Now you will see your new form has the property you created in your
base class.

When you say Property, make sure it really is a PROPERTY, not just a
public variable.
Ie.
private string _testProperty = "";
public string TestProperty {
get {
return _testProperty;
}
set {
_testProperty = value;
}
}

Hope this gives you a good starting point.
I used the help walktroughts in MSDN to learn more about creating
custom controls.
You might like these too.

Steven Nagy

Dec 15 '05 #3
No problems!

Slowly you'll learn to unlock the power and come to realise that OOP is
very easy in C#

Dec 15 '05 #4

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

Similar topics

10
by: Gregory A Greenman | last post by:
I'm trying to write a program in vb.net to automate filling out a series of forms on a website. There are three forms I need to fill out in sequence. The first one is urlencoded. My program is...
4
by: Stuart Perryman | last post by:
Hi, I have the following code which works just fine in IE6 but not in Firefox. It is an extract of several table rows each with an individual form. It is generated by php. <form...
11
by: Brian D | last post by:
I have been searching for a while to find an answer to this and I must be searching on the wrong keywords. Below is a snippet of my form. There are other form items on it, but I need to submit...
2
by: Jason G | last post by:
** Any assistance you can provide would be greatly appreciated ** I have a main form with multiple sub-forms. On the main form, I have a checkbox that corresponds with each sub-form, and this...
5
by: RAJ | last post by:
hi plz tell me how to know "how window is going to close"... i have to right code for X button of forms... plz telll me thanks bye
3
by: ApexData | last post by:
I'm starting a new project. A Personnel System. I have considered opening a single bound form to the main employee table. The user can scroll the records to any individual. I would like to have a...
12
by: Rob | last post by:
Let's say you open Form1 that contains TabControl1 There are several tabs on TabControl1 Now you open a new Form2 that contains a User Control How can you determine the Selected tab in Form1...
6
by: Greg Strong | last post by:
Hello All, Is is possible to use an ADO recordset to populate an unbound continuous Subform? I've done some Googling without much luck, so this maybe impossible, but let me try to explain...
16
by: Mike | last post by:
Hi, I have a form with some controls, and a different class that needs to modify some control properties at run time. Hoy can I reference the from so I have access to its controls and...
9
by: dhtml | last post by:
I have written an article "Unsafe Names for HTML Form Controls". <URL: http://jibbering.com/faq/names/ > I would appreciate any reviews, technical or otherwise. Garrett --...
1
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
0
by: veera ravala | last post by:
ServiceNow is a powerful cloud-based platform that offers a wide range of services to help organizations manage their workflows, operations, and IT services more efficiently. At its core, ServiceNow...
0
by: VivesProcSPL | last post by:
Obviously, one of the original purposes of SQL is to make data query processing easy. The language uses many English-like terms and syntax in an effort to make it easy to learn, particularly for...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
0
by: mar23 | last post by:
Here's the situation. I have a form called frmDiceInventory with subform called subfrmDice. The subform's control source is linked to a query called qryDiceInventory. I've been trying to pick up the...
2
by: jimatqsi | last post by:
The boss wants the word "CONFIDENTIAL" overlaying certain reports. He wants it large, slanted across the page, on every page, very light gray, outlined letters, not block letters. I thought Word Art...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...

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.