473,387 Members | 1,585 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.

What container to dynamically display a bunch of labels?

I have a bunch of labels, and want to put in some container, which should be:

1. The number of labels for each column is fixed, say 16/row. And the number
of currently displaying rows is fixed, say 10.
2. The number of total rows is unknown before hand. So if it is larger than
10, the vertical scroll bar should be shown up and let the user view other
part of the rows.
3. In my program, I would add those labels one by one, from left to right,
from up to bottom.

What container should I use?

Thanks,

Jul 11 '06 #1
3 1593

Gary wrote:
I have a bunch of labels, and want to put in some container, which should be:

1. The number of labels for each column is fixed, say 16/row. And the number
of currently displaying rows is fixed, say 10.
2. The number of total rows is unknown before hand. So if it is larger than
10, the vertical scroll bar should be shown up and let the user view other
part of the rows.
3. In my program, I would add those labels one by one, from left to right,
from up to bottom.

What container should I use?

Thanks,
Is there a reason why you wouldn't just use a ListView, rather than
Labels?

Jul 11 '06 #2
Hello Gary,

In order to achieve the described, I belive it woould be best to write a
user control inheriting the System.Windows.Forms.Panel class. You could
override the OnLayout method and arrange the Label controls when necessary.
For instance, have a counter which counts the number of controls processed
and manipulates the X and Y values accordingly.

You can do the content scrolling by assigning True to the (custom) container
control's AutoScroll property. You could also set an appropriate
AutoScrollMargin, if necessary.

I hope this helps.
--
Best regards,

Stanimir Stoyanov
www.stoyanoff.info
"Gary" wrote:
I have a bunch of labels, and want to put in some container, which should be:

1. The number of labels for each column is fixed, say 16/row. And the number
of currently displaying rows is fixed, say 10.
2. The number of total rows is unknown before hand. So if it is larger than
10, the vertical scroll bar should be shown up and let the user view other
part of the rows.
3. In my program, I would add those labels one by one, from left to right,
from up to bottom.

What container should I use?

Thanks,
Jul 11 '06 #3
No. I am new to this field so that still wondering which way is the best.

My goal is to extract all available characters from a certain font, then
display each character in this table like control. If user changed the font,
every character should be changed as well. And I need to trap the events such
as mouse over a character so that I can display the tip and do something when
user clicked on that character.

Any suggestion?

Thanks,

"Bruce Wood" wrote:
>
Gary wrote:
I have a bunch of labels, and want to put in some container, which should be:

1. The number of labels for each column is fixed, say 16/row. And the number
of currently displaying rows is fixed, say 10.
2. The number of total rows is unknown before hand. So if it is larger than
10, the vertical scroll bar should be shown up and let the user view other
part of the rows.
3. In my program, I would add those labels one by one, from left to right,
from up to bottom.

What container should I use?

Thanks,

Is there a reason why you wouldn't just use a ListView, rather than
Labels?

Jul 11 '06 #4

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

Similar topics

1
by: Don Hames | last post by:
I have a windows application that has a split container in the client area. In the left panel, I added controls via the designer in VS 2005. In the right panel, I want to dynamically create and...
2
by: Tom Lee | last post by:
Hi all, I have the following problem and I cannot solve it. If anyone can help me solve this problem. I use the following code <%#DataBinder.Eval(Container.DataItem, "Property")%> to display...
0
by: venkat Murthy | last post by:
Hi, I have 10 regularexpression validators in my datagrid. my datagrid looks like; first5controls | boundcolumn | next5controls. Regularexpressionvalidator for first five controls works...
2
by: Wade | last post by:
Is there a way in VB.NET to use a PicureBox as a container like in VB 6? I have an image that I want to place in a container and have transparent labels "float" on top of the image and use them as...
2
by: silversurfer | last post by:
Hello, I am a little unsure whether this method really makes sense. The goal is to add an element to a vector. This is the struct and method I am using: std::vector<Entry> models; struct...
2
by: Steven C | last post by:
Hello: I'm trying to dynamically generate some labels for a form, and I can't seem to get it to work. The code is as follows. The first label is generated, but subsequent labels are not. Is...
0
by: rn5a | last post by:
Using SqlDataAdapter, I am retrieving records from a SQL Server 2005 DB table & binding them to a DataList. In the DataList, I want the first column to display the serial numbers starting from 1. I...
1
by: semomaniz | last post by:
I have a form where i have created the form dynamically. First i manually added a panel control to the web page. Then i added another panel dynamically and inside this panel i created tables. I have...
2
by: | last post by:
Hi, I have 2 scenarios: First, an aspx page that contains 300 controls with the labels of course in a table. Second, an empty aspx page that contains on loading a script that creates the 300...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
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
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
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
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.