473,473 Members | 1,985 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Collection property and control owner

Hi,

I have a custom control in which i have a property called
"RowsCollection". This property is a CollectionBase class.
this class allows user to add new rows to the property.

I defined in my RowsCollection a private variable member which holds the
basic height of each row to 20;

when i create a row thanks the RowsCollection property, each row have a
property Height, but it is setup to 0.

How can i do to pass such default value (20) to each row, only during
row creation ?

thanks a lot,

RAF
Oct 16 '07 #1
2 3078
RAF,

You would have to declare a constructor that takes the height, and then
pass the value to the constructor when the instance is created.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"R.A.F." <no*****@nospam.comwrote in message
news:%2****************@TK2MSFTNGP06.phx.gbl...
Hi,

I have a custom control in which i have a property called
"RowsCollection". This property is a CollectionBase class.
this class allows user to add new rows to the property.

I defined in my RowsCollection a private variable member which holds the
basic height of each row to 20;

when i create a row thanks the RowsCollection property, each row have a
property Height, but it is setup to 0.

How can i do to pass such default value (20) to each row, only during row
creation ?

thanks a lot,

RAF
Oct 17 '07 #2
Hi Nicholas,

this i know, but how to do from a property which is in fact a collection ?

how the Add function from collectionBase can pass such information ?
or should it be done thanks my custom collection property editor ?
if yes, where and how ?

this i've never done before.

thanks a lot,

RAF

Nicholas Paldino [.NET/C# MVP] wrote:
RAF,

You would have to declare a constructor that takes the height, and
then pass the value to the constructor when the instance is created.

Oct 17 '07 #3

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

Similar topics

3
by: Marc L'Ecuyer | last post by:
Hi, I have a collection class derived from CollectionBase. This collection can add items of my class MyItem. In my class MyItem, I have a Selected property. When this property is set to true, I...
5
by: Kurt Bauer | last post by:
I have an ASP group calendar application which pulls calendar data from Exchange via webdav into an XML string. I then loop the XML nodes to populate a collection of appointments. Finally I use...
2
by: MLH | last post by:
A form named frmVehicleEntryForm has a number of textbox controls who's OnGotFocus property setting is an expression... =Change2Green() Change2Green() looks something like this... Dim MyControl...
2
by: Brian | last post by:
NOTE ALSO POSTED IN microsoft.public.dotnet.framework.aspnet.buildingcontrols I have solved most of my Server Control Collection property issues. I wrote an HTML page that describes all of the...
10
by: GP | last post by:
Is it possible to iterate through all the controls collection and make the textboxes alone as read only.I don't see a readonly property for the Control.Can some one help me in this context? I...
4
by: Michael | last post by:
Dear all .. If I want to use develop a user control and declare a public property which the type is System.Windows.Forms.GridTableStylesCollection For example : Public Class LookAndView...
19
by: Jamey Shuemaker | last post by:
I'm in the process of expanding my knowledge and use of Class Modules. I've perused MSDN and this and other sites, and I'm pretty comfortable with my understanding of Class Modules with the...
6
by: Erick | last post by:
I've created a class called Procs and a collection class called Processes which uses a hastable object to store the Procs. Now i want to enumerate with the "For each" to extract all the Procs in...
5
by: Academia | last post by:
I use to do this: Dim index As Integer = CType(sender, MenuItem).Index but ToolStripMenuItems do not have an Index property so I can set the Tag or MergeIndex property of those items and use...
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
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...
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...
1
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...
0
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...
0
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...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
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 ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.