By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,377 Members | 1,690 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,377 IT Pros & Developers. It's quick & easy.

Help User Control

P: n/a
How to create a group of property in a user control.
for examples size have two property width and height
thanks for helping..

best Regrads
NOC

Nov 20 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Hi Nicolaus,

Creating a Property in a UserControl is exactly the same as in any other
class.

Public Property Foo As FooType
Get ...
Set ...
End

If this the sort of Property you mean but with a compound value like Size:

Private _Size As Size

Property Width As Integer
Get
Return _Size.Width
End Get
Set
_Size = New Size (Value, _Size.Height)
End Set
End Property

Property Height As Integer
Get
Return _Size.Height
End Get
Set
_Size = New Size (_Size.Width, Value)
End Set
End Property

But I also wonder whether you mean one that can be displayed in the
Properties box at Design Time?

Regards,
Fergus
Nov 20 '05 #2

P: n/a
Thanks.. fergus.
with that way can i display my property in property box?
How Can i do that?

best regards,
NOC

-----Original Message-----
Hi Nicolaus,

Creating a Property in a UserControl is exactly the same as in any otherclass.

Public Property Foo As FooType
Get ...
Set ...
End

If this the sort of Property you mean but with a compound value like Size:
Private _Size As Size

Property Width As Integer
Get
Return _Size.Width
End Get
Set
_Size = New Size (Value, _Size.Height)
End Set
End Property

Property Height As Integer
Get
Return _Size.Height
End Get
Set
_Size = New Size (_Size.Width, Value)
End Set
End Property

But I also wonder whether you mean one that can be displayed in theProperties box at Design Time?

Regards,
Fergus
.

Nov 20 '05 #3

P: n/a
* "Nicolaus OC" <an*******@discussions.microsoft.com> scripsit:
with that way can i display my property in property box?
How Can i do that?


\\\
Public Property MyPosition() As Point
Get
...
End Get
Set(...)
...
End Set
End Property
///

Will add a property called 'MyPosition' of type 'Point' to your control.

--
Herfried K. Wagner
MVP VB Classic, VB.NET
<http://www.mvps.org/dotnet>
Nov 20 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.