Need a clever solution.

  • Thread starter Thread starter Shawn
  • Start date Start date
S

Shawn

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 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.
 
Shawn said:
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 ?
 
I thought about it, but depending on the sizes and placement, the number of
rows is unknown.

Thanks.
 
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...
 
Back
Top