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

Adding Property like bool

Hi All,

I want to add a property to a user control with three or four option to
select how can I do it. I mean what type it should be to have a combo box
type get a combo box selection option.

If you take boolean type property it allow the user to select true/ false as
the control get added.

How I do some thing similar (for some other set of selections).

Nirosh.
Nov 15 '05 #1
2 1181
Use an enumeration. Let's say that you have an enum:

public enum myEnum: uint{

blah,
moreblah,
evenmoreblah;

}

private myEnum _myenum;

public myEnum{
get{return _myenum;}
set{_myenum = value;}

}

If you have your class defined w/ component model, it will show up in the
designer. Remember to set your attributes for Description and group so they
show up in the ControlGird and have definitions associated with them. Not
mandatory, but users will hate you if you don't.

HTH,

Bill
"Champika Nirosh" <cn*****@textcentric.lk> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
Hi All,

I want to add a property to a user control with three or four option to
select how can I do it. I mean what type it should be to have a combo box
type get a combo box selection option.

If you take boolean type property it allow the user to select true/ false as the control get added.

How I do some thing similar (for some other set of selections).

Nirosh.

Nov 15 '05 #2
Thanks William Ryan and that is what I wanted..

Nirosh.

"William Ryan" <do********@nospam.comcast.net> wrote in message
news:#N*************@TK2MSFTNGP10.phx.gbl...
Use an enumeration. Let's say that you have an enum:

public enum myEnum: uint{

blah,
moreblah,
evenmoreblah;

}

private myEnum _myenum;

public myEnum{
get{return _myenum;}
set{_myenum = value;}

}

If you have your class defined w/ component model, it will show up in the
designer. Remember to set your attributes for Description and group so they show up in the ControlGird and have definitions associated with them. Not
mandatory, but users will hate you if you don't.

HTH,

Bill
"Champika Nirosh" <cn*****@textcentric.lk> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
Hi All,

I want to add a property to a user control with three or four option to
select how can I do it. I mean what type it should be to have a combo box type get a combo box selection option.

If you take boolean type property it allow the user to select true/
false as
the control get added.

How I do some thing similar (for some other set of selections).

Nirosh.


Nov 15 '05 #3

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

Similar topics

9
by: James Geurts | last post by:
Hey all... I posted this in the vs.net ide group too, but people are not answering, so I figured that it might be more appropriate here. I'm not sure if I'm adding a designer to my code properly. ...
1
by: NuBBeR | last post by:
I have created a boolean property in a custom control and i would like that property to be visible in the control's property windows in the designer. Does anyone know how to do this? Thanks in...
3
by: MattC | last post by:
Hi, I found this code somewhere on the net and need to make some alterations. public class GenericSorter : IComparer { String sortProperty; bool sortOrder; public GenericSorter(String...
3
by: Jim Heavey | last post by:
Trying to figure out the technique which should be used to add rows to a datagrid. I am thinking that I would want an "Add" button on the footer, but I am not quite sure how to do that. Is that...
2
by: D Sheldon | last post by:
I am creating a server control that adds web controls (i.e. textboxes, etc) to a form. I use HtmlTable to build the table and insert the controls. Now I want to add validators to the textbox. Here...
1
by: sianan | last post by:
I tried to use the following example, to add a checkbox column to a DataGrid in an ASP.NET application: http://www.codeproject.com/aspnet/datagridcheckbox.asp For some reason, I simply CAN'T get...
2
by: Michel Lapointe | last post by:
Hi, I have a problem while creating a customized DataGridViewColumn with a custom property. The problem is that after defining the property, adding the column to my Datagridview and settings...
3
by: Kannan | last post by:
Hi, I am trying to created Outloook Add-in Com in outlook using C#. I have seen this URL for developing this sample http://support.microsoft.com/?kbid=302901 When I executed this program it...
11
by: Andrus | last post by:
I'm implementing entity object which should populate its properties from database when property is first referenced. In RDL reports I use object properties like MyObject.MyProperty MyObject...
10
by: oktayarslan | last post by:
Hi all; I have a problem when inserting an element to a vector. All I want is reading some data from a file and putting them into a vector. But the program is crashing after pushing a data which...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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...

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.