473,785 Members | 2,137 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

To make dynamic labels

14 New Member
hi,


I am making a dynamic form which i have to put some labels which r 2 b dynamic.n i have to make 'n' number of labels dynamically.

label me = new label();

This is the line im using to make it. how do i pass the value of 'n' in the code.
if someone can help me 2 do this.

plz help to do this.
Reply soon........
Feb 23 '07 #1
2 1272
kuzen
20 New Member
Hi,
I don' know what language you're using. Here is a version in VB
Expand|Select|Wrap|Line Numbers
  1.         For i As Integer = 0 To n ' as many as you need
  2.             Dim label As New System.Windows.Forms.Label
  3.             Me.SuspendLayout()
  4.             label.Location = New System.Drawing.Point(112, 96 + i * 96) 'you can change the location to your preference, just make sure they don't overlap 
  5.             label.Name = "label" + i.ToString
  6.             label.TabIndex = 0
  7.             label.Text = "label" + i.ToString
  8.             Me.Controls.Add(label)
  9.         Next
  10.  
I hope this helps
Feb 23 '07 #2
anniejacob
14 New Member
hi,

Thank u so much 4 the reply but my prob got solved before that. but this was almost wat i wrote but in C#
Feb 26 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

7
1952
by: pizzy | last post by:
PROBLEM: I CAN'T GET THE LAST RESUTS TO WORK CORRECTLY. I WOULD PROVIDE THE CODE (AND WILL IF REQUESTED). BUT IN MY OWN WORDS I AM TRYING TO HAVE THE FIRST FORM DYNAMICALLY CREATE INPUT BOXES BASED ON THE NUMBER ENTERED. THEN ON THE SECOND FORM (WHICH IS CREATED BY THE FIRST FORM CALLING A FUNCTION) I WANT THE USER TO BE ABLE TO CLICK ON ONE OF THE CHECKBOXES AND SEE MORE INPUT BOXES APPEAR. HAS ANYONE DONE SOMETHING LIKE THIS? IF SO,...
5
8830
by: hzgt9b | last post by:
Is it possible to dynamically add controls (speciifcally System.Windows.Forms.ProgressBar and System.Windows.Forms.Label) to a panel to a form and have them display (and fucntion) at run time? I've been trying todo this by creating arrays of progressbars and labels. Then for each item in the root nods of a treeView that I need to track progress on, I create a bar and label and add them to a panel. The problem is that when I display the...
1
17673
by: Nathan Bloomfield | last post by:
Does anyone know if there is any documentation which relates to Access2k + ? or can anyone help adjust the code? I am having trouble converting the DAO references. TITLE :INF: How to Create a Dynamic Crosstab Report PRODUCT :Microsoft Access PROD/VER:1.00 1.10 OPER/SYS:WINDOWS
1
5164
by: Brad | last post by:
Thanks for taking the time to read my question. I have a table of data that has Date, Data and Category. I need to show, in a report, each Categories Data by Date. The Date has to be it's own column across the top and Category down the left side. As data is entered, the number of unique dates increases. As a result the
1
1828
by: Mike Collins | last post by:
I have a web form that has most of the UI designed. On this form, some of the labels, textboxes, dropdowns, etc. will be added dynamically, depending on what extra bits of data the user decides they want to see. The question I have is when retrieving the dynamic fields for my form, should I get everything in one grab (dynamic fields and data) or keep the form dataset separate from the actual data dataset? Also, please excuse my ignorance,...
1
5532
by: nsvmani | last post by:
Hi, i am trying to get the FileOpen dialogue window as soon as clicked href link I am using IE6 with ActiveX enabled. Just need to get the File Open dialogue window when i click on the HREF links.It would be great , if i know how to create the dynamic HREF links like it should be getting different document based on each userid. Here is my part of jsp code for your reference: <%@ page...
8
2519
markryan57
by: markryan57 | last post by:
Greetings, I searched for this, but cannot find exaclty what I am looking for. I am trying to dynamically create labels on a form just before it opens. I am reading from a database, building the labels then opening the form. Currently I have put the labels (in a control array) on the form I want to receive the variables. Then I create a loop to read in the db and build the labels, then open the form. I have like 300 control arrays to...
1
2211
by: dazzler | last post by:
I have application which creates data table from loaded data, table cells are created using labels. I am trying to do following: when the mouse cursor is over the one label it will be highlighted using brighter background color def mouse_enter(event): self.label = "#FFFFFF" def mouse_leave(event): self.label = "#888888"
2
1400
by: bharathi228 | last post by:
my code for retrieving values from database Dim da As New SqlDataAdapter("select parameter_name,parameter_units from sys_params", con) If con.State = ConnectionState.Closed Then con.Open() End If Dim ds As New DataSet Dim name, unit ,namunt As String da.Fill(ds, "sys_params")
0
9647
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9489
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
10100
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9959
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7509
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6744
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5396
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4061
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 we have to send another system
2
3665
muto222
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.