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

Help User Control

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
3 1048
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
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
* "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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Patrick | last post by:
I'm working on a contact management application, and need a hand with one aspect... Here's what I want to create: ------------------------------------ A form split into two parts. There is a...
2
by: bie2 | last post by:
Hi, I need help on how to proceed with a multithreading. I have a main form, which depending on what the user click will load a user control. Some of these user controls will have a database...
13
by: Lloyd Sheen | last post by:
I have now spent 5 hours on google/msdn looking for something useful in the creation of user controls for asp.net. The VS 2003 has very limited support for things such as absolute positioning of...
1
by: Shourie | last post by:
I've noticed that none of the child controls events are firing for the first time from the dynamic user control. Here is the event cycle. 1) MainPage_load 2) User control1_Load user clicks a...
5
by: Dan Nash | last post by:
Hi all, I've got a page with a user control on, added via VS. I'm trying to get to a property of the user control (or more precisely, a public var). Here's the code at the top of my aspx...
3
by: Tim::.. | last post by:
Can someone please help.... I'm having major issues with a user control I'm tring to create! I an trying to execute a sub called UploadData() from a user control which I managed to do but for...
1
by: keith.walter | last post by:
My first asp.net app is almost "done" and I am stuck. Here is my situation: I have a "mother" page add_customer.aspx and a"child" user control add_group.ascx. On the mother page is an "add...
3
by: Joe | last post by:
Hello All, I am developing a webform which creates ArrayLists of people's names and addresses (the values are retrieved from an xml file) and dynamically drops a user control onto the webform...
0
by: davidr | last post by:
Hi, I have a panel that I load user Control in no problem. The problem arrises when I do a post back on one of these user controls. I have button it does a click event. In this click event I...
11
by: Brad Baker | last post by:
I'm building a small web application - I started out placing all my code in one file (config.aspx). As I continue to add code though it was becoming very unwieldy. After doing some searching...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
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...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
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)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
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....

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.