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

in code objects

How do you create objects like buttons and labels
with only code for example when you dont know how much buttons you need but
you can callculate it when teh programm runs and the program make the
buttons.

thaks

aterlamia
Jul 17 '05 #1
3 1389
aterlamia wrote:
How do you create objects like buttons and labels
with only code for example when you dont know how much buttons you
need but you can callculate it when teh programm runs and the program
make the buttons.


Try something like this:

Private Sub Command1_Click()
Controls.Add "VB.CommandButton", "btn1"
With Me!btn1
.Caption = "Test"
.Visible = True
.Width = Me.Width
.Height = 400
End With
Command1.Enabled = False ' Avoid creating another btn1 object
End Sub

BR,
Peter Kragh
Jul 17 '05 #2
On Mon, 13 Oct 2003 18:49:48 +0200, "aterlamia" <mp********@planet.nl>
wrote:
How do you create objects like buttons and labels
with only code for example when you dont know how much buttons you need but
you can callculate it when teh programm runs and the program make the
buttons.


Look at 'Control Arrays'
Jul 17 '05 #3
ok thanks to both i think this will help me :)
"aterlamia" <mp********@planet.nl> wrote in message
news:bm**********@reader11.wxs.nl...
How do you create objects like buttons and labels
with only code for example when you dont know how much buttons you need but you can callculate it when teh programm runs and the program make the
buttons.

thaks

aterlamia

Jul 17 '05 #4

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

Similar topics

6
by: Alfonso Morra | last post by:
I have written the following code, to test the concept of storing objects in a vector. I encounter two run time errors: 1). myClass gets destructed when pushed onto the vector 2). Prog throws a...
171
by: tshad | last post by:
I am just trying to decide whether to split my code and uses code behind. I did it with one of my pages and found it was quite a bit of trouble. I know that most people (and books and articles)...
17
by: tshad | last post by:
Many (if not most) have said that code-behind is best if working in teams - which does seem logical. How do you deal with the flow of the work? I have someone who is good at designing, but...
6
by: TPJ | last post by:
Help me please, because I really don't get it. I think it's some stupid mistake I make, but I just can't find it. I have been thinking about it for three days so far and I still haven't found any...
17
by: radhikams | last post by:
Hi I want to create a drag drop tool box using javascript... Can anyone please guide me in this regard Thanks
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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
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...

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.