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

Property in user control

how i can write some property form mycontrol that's can be expend.
when i use this cod :
property MyProp as integer
....
....
....
end property
its only add one property to my control
but there are some property thats are has + in left side.
for example Font Or Margin property

Jun 23 '07 #1
2 1285
You need to specify the ExpandableObjectConvertor using the TypeConvertor
attribute to your property.

However,since the type of your property is int, it will not be expandable.
In this case, you can derive your own class from TypeConvertor and override
the GetPropertiesSupported and GetProperties method. Than specify this
derived class in the TypeConvertor attribute.

---------
- G Himangi, Sky Software http://www.ssware.com
Shell MegaPack : GUI Controls For Drop-In Windows Explorer like Shell
Browsing Functionality For Your App (.Net & ActiveX Editions).
EZNamespaceExtensions.Net : Develop namespace extensions rapidly in .Net
EZShellExtensions.Net : Develop all shell extensions,explorer bars and BHOs
rapidly in .Net
---------
"saeed rezaei" <sr*********@yahoo.comwrote in message
news:11*********************@k79g2000hse.googlegro ups.com...
how i can write some property form mycontrol that's can be expend.
when i use this cod :
property MyProp as integer
...
...
...
end property
its only add one property to my control
but there are some property thats are has + in left side.
for example Font Or Margin property

Jun 25 '07 #2
saeed rezaei wrote:
how i can write some property form mycontrol that's can be expend.
...
for example Font Or Margin property
The property needs to return an Object that contains the "inner"
properties, as in

Class c1
Property myProp As c2
...
Return New Class2(Me)
...
End Property

Public Sub Class2
Friend Sub New( c1 as Class1 )
End Sub
Public Property Left() As Integer
...
End Property
Public Property Top() As Integer
...
End Property
End Class
End Class

HTH,
Phill W.
Jun 25 '07 #3

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

Similar topics

3
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)> _...
1
by: Steven.Xu | last post by:
Hi, everyone. I am writting an user control. There has some properties on it. At the design time, the properties will disply on the property windows and user could change it's value after selected...
3
by: Karl Lang | last post by:
Hi, I'm trying to set a property of a user control that is part of another user control. So I have a control A which contains control B, and I'm trying to set a property in B from within the...
15
by: Mark Goldin | last post by:
I have main aspx page with a number of user controls. How can I create a global property that will be visible in every user control? Thanks
1
by: Nathan Sokalski | last post by:
I have a problem that is driving me crazy. I have a User Control composed of three DropDownLists that will be used to select a date. I have everything working except for one thing. When I select a...
6
by: active | last post by:
In VB6 I could invoke a tool ( don't remember how right now) that would enable me to create properties in my user control that passed through properties of components on the user control. I...
1
by: Will Gillen | last post by:
I know this has probably been asked before, but I can't seem to find a solid answer in any of the archives. First, before my question, please forgive my limited knowledge of the event lifecycle...
1
by: shapper | last post by:
Hello, I am creating a user control where an Asp.Net control is used. It can be either a button, an image button or a label. I am trying to "expose" the Asp.Net control properties and events...
2
by: Benton | last post by:
Hi there, I'm creating a custom server control, inheriting from TextBox. It has this AsDateTime property that returns the textbox contents converted to the nullable DateTime data type, as...
18
by: Academia | last post by:
I let the use modify the text of a combobox and then I replace the selected item with the new text (in Keyup event). But if he sets the Text property to an empty string ("") that sets the...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.