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

Need a clever solution.

I am building a Windows app (VB.NET) that has a form that contains a panel.
At runtime, the panel is populated with any number of labels that are
dynamically built from a database query and placed in the panel. I want to
be able to move the labels around so that none of them are overlapping. The
best example would be Outlook's Calendar. If you have multiple appointments
that overlap, they are staggered next to each other. I am really having
trouble coming up with a method for this that will function quickly.

THANKS!!!
Sep 28 '07 #1
4 1228
On Sep 28, 9:17 am, "Shawn" <shawn.cam...@ccci.orgwrote:
I am building a Windows app (VB.NET) that has a form that contains a panel.
At runtime, the panel is populated with any number of labels that are
dynamically built from a database query and placed in the panel. I want to
be able to move the labels around so that none of them are overlapping. The
best example would be Outlook's Calendar. If you have multiple appointments
that overlap, they are staggered next to each other. I am really having
trouble coming up with a method for this that will function quickly.

THANKS!!!
GDI+ has a method that will measure the length of text in screen
pixels, you can access it by calling MeasureString from a Graphics
object, but it may be overkill for what you are doing. Are your
labels placed in a list, multiple columns, or more like a tag cloud?
Do you want the end user to be able to move the labels around, or do
you want to do it only in code? In the end if you are looking for
something ala Outlook, then you may have to do some custom painting
using GDI+, or purchase / download a third party control.

Sep 28 '07 #2
"Shawn" wrote:
I am building a Windows app (VB.NET) that has a form that contains a panel.
At runtime, the panel is populated with any number of labels that are
dynamically built from a database query and placed in the panel. I want to
be able to move the labels around so that none of them are overlapping. The
best example would be Outlook's Calendar. If you have multiple appointments
that overlap, they are staggered next to each other. I am really having
trouble coming up with a method for this that will function quickly.

THANKS!!!
I'm not sure what exactly you are looking for, but maybe a 'FlowLayoutPanel'
or a 'TableLayoutPanel' will do the trick ?
Sep 28 '07 #3
I thought about it, but depending on the sizes and placement, the number of
rows is unknown.

Thanks.

"Oliver Tell" <Ol********@discussions.microsoft.comwrote in message
news:6D**********************************@microsof t.com...
"Shawn" wrote:
>I am building a Windows app (VB.NET) that has a form that contains a
panel.
At runtime, the panel is populated with any number of labels that are
dynamically built from a database query and placed in the panel. I want
to
be able to move the labels around so that none of them are overlapping.
The
best example would be Outlook's Calendar. If you have multiple
appointments
that overlap, they are staggered next to each other. I am really having
trouble coming up with a method for this that will function quickly.

THANKS!!!
I'm not sure what exactly you are looking for, but maybe a
'FlowLayoutPanel'
or a 'TableLayoutPanel' will do the trick ?

Sep 29 '07 #4
The user can move the labels up and down or increase the height by dragging
and the number of columns may change.
And, they are placed on the panel directly, I would like to use a container
that uses columns, but I can't. And, the text is also variable, but the
control would take up most of the panel, so I can't use text as an
identifier.

Thanks...

"Charlie Brown" <cb****@duclaw.comwrote in message
news:11**********************@n39g2000hsh.googlegr oups.com...
On Sep 28, 9:17 am, "Shawn" <shawn.cam...@ccci.orgwrote:
>I am building a Windows app (VB.NET) that has a form that contains a
panel.
At runtime, the panel is populated with any number of labels that are
dynamically built from a database query and placed in the panel. I want
to
be able to move the labels around so that none of them are overlapping.
The
best example would be Outlook's Calendar. If you have multiple
appointments
that overlap, they are staggered next to each other. I am really having
trouble coming up with a method for this that will function quickly.

THANKS!!!

GDI+ has a method that will measure the length of text in screen
pixels, you can access it by calling MeasureString from a Graphics
object, but it may be overkill for what you are doing. Are your
labels placed in a list, multiple columns, or more like a tag cloud?
Do you want the end user to be able to move the labels around, or do
you want to do it only in code? In the end if you are looking for
something ala Outlook, then you may have to do some custom painting
using GDI+, or purchase / download a third party control.

Sep 29 '07 #5

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

Similar topics

3
by: Scott Rifkin | last post by:
If anyone has a good, quick solution to the following in python2.3 I'd appreciate it: I have a dictionary with keys K1, K2, ..., K10000 Each entry looks like: dict= where the T's are...
2
by: Philip White | last post by:
Unfortunately I can't use the excuse of being a SQL newbie, but drawn a blank on the following "simple" problem. I have a table containing the following (extract) : ...
38
by: lawrence | last post by:
I'm just now trying to give my site a character encoding of UTF-8. The site has been built in a hodge-podge way over the last 6 years. The validator tells me I've lots of characters that don't...
4
by: Mark P | last post by:
I have a header file and want to expose only a limited portion of that file to SWIG (all you need to know is that when SWIG processes a file the preprocessor macro SWIG is defined). Otherwise I...
4
by: Bob Bedford | last post by:
Hello there, Little problem I can't solve. Its seems easy but I can't find out a simple solution. Maybe a clever way already exists: I've a site where people may have up to 5 pictures. They...
4
by: Eric Lilja | last post by:
Hello! Consider this code: const char ops = {'*', '/', '+', '-'};//, '(', ')' }; const int input_prio = { 3, 3, 1, 1 };//, 100, 0 }; const int stack_prio = { 4, 4, 2, 2...
24
by: user923005 | last post by:
The purpose is for a shellsort. I am experimenting with the increment for shellsort using a modified version of Pete's driver and this bit of code (shell_ratio is a floating point number for the...
1
by: blangela | last post by:
I apologize for being somewhat off topic, but I cannot resist making this post. One of my less gifted students submitted a better solution for the tictactoe problem I had assigned than I...
11
by: lakshmiram.saikia | last post by:
Hi, I need to do the following operation : '" I have two mac addresses, say X and Y,where X is the base mac address, and Y is the nth mac address from X, each incremented by one. Now,I want...
4
by: Holger | last post by:
I tried to do this elegantly, but did not come up with a good solution Sort strings like foo1bar2 foo10bar10 foo2bar3 foo10bar2 So that they come out: foo1bar2
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: 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
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
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,...

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.