473,748 Members | 2,595 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

property drop down control

I am trying to make a property that creates a drop down control that I
can fill with string options..."test 1", "test2", "test2"

I can make one with True false as shown here but I cant figure out how
to make it do a dropdown with custom strings
Private _numericTextBox As Boolean = False

<Category("MyCa tegory"), Description("Se ts the text box as
numeric")> _
Public Property NumericTextBox( ) As Boolean
Get
Return _numericTextBox
End Get
Set(ByVal Value As Boolean)
_numericTextBox = Value
End Set
End Property
Nov 20 '05 #1
2 1097
Try defining an ENUM.. then use the property as that..

Public Enum TestingEnum
Test1 = 0
Test2 = 1
Test3 = 2
End Enum

Private _dropDownProp As TestingEnum = TestingEnum.Tes t1

<Category("MyCa tegory"), Description("A drop down property")> _
Public Property DropDownProp() As TestingEnum
Get
Return _dropDownProp
End Get
Set(ByVal Value As TestingEnum)
_dropDownProp = Value
End Set
End Property

I hope that's what u mean't

Rigga.

"ECVerify.c om" <go****@gencode .com> wrote in message
news:20******** *************** ***@posting.goo gle.com...
I am trying to make a property that creates a drop down control that I
can fill with string options..."test 1", "test2", "test2"

I can make one with True false as shown here but I cant figure out how
to make it do a dropdown with custom strings
Private _numericTextBox As Boolean = False

<Category("MyCa tegory"), Description("Se ts the text box as
numeric")> _
Public Property NumericTextBox( ) As Boolean
Get
Return _numericTextBox
End Get
Set(ByVal Value As Boolean)
_numericTextBox = Value
End Set
End Property

Nov 20 '05 #2
"Rigga" <s@g.c> wrote in message news:<wN******* ************@st ones.force9.net >...
Try defining an ENUM.. then use the property as that..

Public Enum TestingEnum
Test1 = 0
Test2 = 1
Test3 = 2
End Enum

Private _dropDownProp As TestingEnum = TestingEnum.Tes t1

<Category("MyCa tegory"), Description("A drop down property")> _
Public Property DropDownProp() As TestingEnum
Get
Return _dropDownProp
End Get
Set(ByVal Value As TestingEnum)
_dropDownProp = Value
End Set
End Property

I hope that's what u mean't

Rigga.

"ECVerify.c om" <go****@gencode .com> wrote in message
news:20******** *************** ***@posting.goo gle.com...
I am trying to make a property that creates a drop down control that I
can fill with string options..."test 1", "test2", "test2"

I can make one with True false as shown here but I cant figure out how
to make it do a dropdown with custom strings
Private _numericTextBox As Boolean = False

<Category("MyCa tegory"), Description("Se ts the text box as
numeric")> _
Public Property NumericTextBox( ) As Boolean
Get
Return _numericTextBox
End Get
Set(ByVal Value As Boolean)
_numericTextBox = Value
End Set
End Property


Perfect, thanks
Nov 20 '05 #3

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

Similar topics

3
1572
by: Job Lot | last post by:
I have added a ProgressBar control to StatusBar control and created a custom property as below, to show the properties of the ProgressBar in Property Window of StatusBar. <Browsable(True)> _ Public Property ProgressBar() As ProgressBar Get Return ProgressBar1 End Get Set(ByVal Value As ProgressBar)
6
4129
by: MP | last post by:
Hello I want to have a public property (and Brows able) in one control, I use this code: public System.Windows.Forms.Form recordForm get { return _recordForm;} set {_recordForm = value;}
0
1687
by: Jason | last post by:
What interface do I need to implement in order to get a component with a public property to show up in the data binding drop down boxes at design time in VS.net? I've tried to look just about every where I can think and I can not find the solution. The closest I can come is to implement IBindingList or IListSource to expose a list for the DataSource property on controls. This works great for controls like a list box but doesn't work...
2
12622
by: Yoshitha | last post by:
hi I have 2 drop down lists in my application.1st list ontains itmes like java,jsp,swings,vb.net etc.2nd list contains percentage i.e it conatains the items like 50,60,70,80,90,100. i will select any skill in 1st drop down list then i'll select % of this skill in the 2nd list box , based on the percentage i've selected in the 2nd list box it has to display 2 sets of drop down list boxes at run time one for selecting skill and
3
1792
by: Nice Chap | last post by:
Is it possible to have custom property pages for a Component and if so how I can write one please ? Also, is it possible to reuse the drop down box that we get for Data Source and Data Member inside VS.net's property grid, for my component ? If so any pointers would be immensely appreciated. Thank you.
6
1663
by: Agnes | last post by:
I create my own usercontrol (textbox), I new a property 'Type' I will set this property during design mode, I will set 'I' OR 'C', i stands for integer, c stands for character, Now, In that usercontrol, I want to detect that property , if the propety set to "I", the textalign will set to 'right' iF ME.TYPE ='I" Me.textAlign = HorizontalAlignment.Right endif if Me.type = "C"
0
1424
by: tombow | last post by:
I created a custom control (call it MyWidget) in a C# web control library. MyWidget has a SqlDataSource property: public abstract class MyWidget : WebControl { // .... snipped private SqlDataSource myds;
1
2893
by: swapna.munukoti | last post by:
Hi all, Is there a way to display some text in html select control by default which when the control is clicked, will not be listed in the drop down that contains its options. For example: When I open a page, there is a combo box with "Select" displayed in that. It looks like that item is selected. But when I click that combo box, it does not list "Select" in the drop down. Instead it lists the
8
8805
Shashi Sadasivan
by: Shashi Sadasivan | last post by:
I am creating a clock control something that will display the time (unfortunately i could not see that in the control list) however, i created a property which is of string type, representing the format in which the time should be shown. I want the user to be able to choose a format from a drop down list in the property window. how do i go about doing this? PS. Seems to me that it would sit somewhere in the attribute for that...
0
8991
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8830
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9541
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9321
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
6796
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6074
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4602
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3312
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2215
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.