473,402 Members | 2,055 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,402 software developers and data experts.

Run time control question

I'm working on a user defined control, with a simple label.

My control has this function:

Sub AddRow(ByVal Texto As String)

When I execute AddRow("Sample") I want that my control adds a label to
an array and sets the text to the latest label in the array.

This is what I've done:

Public Row(0) As String
Public List() As Label

Sub AddRow(ByVal Texto As String)
ReDim Preserve Row(UBound(Row) + 1)

Row(UBound(Row)) = Texto

Dim NewLabel As New Label

NewLabel.Name = Texto
NewLabel.Size = New System.Drawing.Size(39, 13)
NewLabel.TabIndex = 0
NewLabel.Text = Texto
NewLabel.Visible = True
NewLabel.Top = UBound(Row) * 10

Dim List(UBound(Row)) As Label
List(UBound(Row)) = NewLabel
Controls.Add(NewLabel)

End Sub

But I don't know what to do to add all new created labels to the public
array List

Of course, in my code, each time the function is called the List Array
is cleared, but I don't know how to use the Public List (If I delete
the "Dim List(UBound(Row)) As Label" then I get the error: Object
reference not set. How can I set this instance reference?

Thanks a lot.

Jan 5 '07 #1
0 756

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

Similar topics

1
by: Peter | last post by:
Hello Thanks for reviewing my question. I would like to know how do you select the time in the DateTime picker control? I have the control's format set to Time. When you click on the down...
3
by: Steven.Xu | last post by:
How can I know whether it is design state or run state of C#.
16
by: TB | last post by:
Hi all: If you think that the following comments are absolute amateurish, then please bear with me, or simply skip this thread. A couple of months back I made the decision to initiate a...
3
by: CsaaGuy | last post by:
Hi, i created a class that i have showing up at design time and i have to save some of the properties to the viewstate at runtime. It all works fine, however the issue is if i have more that one...
80
by: Charles Law | last post by:
Hi guys I have a time critical process, running on a worker thread. By "time critical", I mean that certain parts of the process must be completed in a specific time frame. The time when the...
7
by: Jerome | last post by:
Hallo, I know a lot has already been told about date/time fields in a database but still confuses me, specif when dealing with SQLserver(Express). It seems that sqlserver only accepts the date in...
0
by: tony | last post by:
Hello! I'm not sure if this is the right group to send my question in. I have one solution file that consist of three project. One project that build the exe file called A One project that...
6
by: Luvin lunch | last post by:
Hi, I'm new to access and am very wary of dates as I have limited experience in their manipulation and I know if they're not done properly things can turn ugly quickly. I would like to use a...
4
by: Mark Olbert | last post by:
I've written a composite custom control which I would like to have update its design-time display when one of several properties changes at design time. These custom properties are not simply the...
11
by: greg | last post by:
Hi all, Is there a way to get the current theme name at design time? I'm trying to write a custom control for which I need to use images from the current theme. I have asigned a theme to the...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
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...

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.