StatusStrip Alignment of ToolStripLabels & ToolStripDropDownButton

G

Guest

I am using the StatusStrip control in my windows forms application and I am
having difficulty aligning my sub controls, which are ToolStripLables and
ToolStripDropdownButtons.

I have 3 sub controls located on my StatusStrip. In order, they are...
ToolStripStatusLabel (Displays fixed text 'Status:' on the left side)
ToolStripStatusLabel (Displays whatever status I want to display to user
left justified)
ToolStripDropDownButton (Has buttons on it that I want to ALWAYS show. This
is right justified on the StatusStrip.

Here are the problems I have found with different configurations...

- If the StatusStrip is in FlowLayout or StackWithFlow (Horizontal or
Vertical), when the user resizes my form, the overflow properties kick in and
my ToolStripDropDownButtons disappear when they resize it smaller than the
size of the status label and the status text are bigger than the width of the
form size

- If the StatusStrip is in Table Layout, then in addition to the problems
explained above, the ToolStripDropDownButton that is typically right
justified is now left justified and won't move over, regardless of the size
of the parent form

I tried setting the width of the controls on both end objects to fixed
values, then set the middle text to autosize and spring=true. That didn't
work and the overflow took over and made the ToolStripDropDownButtons
disappear.

This is what I want to do; I want it so that the Status label on the left
side is always left justified and always shows up. I want the
ToolStripDropDownButtons on the right to be right justified and to always
showup. I want the status text between the status text and the
ToolStripDropDownButtons to be left justified and take up the entire space
available between the two, but if there isn't enough room, then it would just
cut off the remaining text of the label and display ... on it. But, it
wouldn't hide the ToolStripDropDownButtons on the right.

Either I am using the wrong type of control to do what I want, or I'm just
messing the settings up somehow. Any help would be greatly appreciated.
Thanks in advance.
 
G

Guest

I'm sorry, maybe I'm not using the newsgroup correctly, but where is the
attachment you are referencing? Sorry for the problem...
 
G

Guest

Ok great! That seemed to work. I'm not sure what I was doing wrong the first
time...

On another note, is there a way to tell if part of a status label is
cuttoff? I have a really long label in the status bar that is being chopped
off at the end, which is exactly what I want to happen. I just need to know
whent he end of the text of the label is being chopped off visually, so I can
add three dots to the right of that label with another label.
 
L

Linda Liu [MSFT]

Hi Jon,

I am sorry that I don't think there's a simple way to know whether the text
of a ToolStripStatusLabel is chopped off.

Instead, I recommend you to use a tooltip to display the full text on the
toolstrip status label when the mouse is hovering on it.

To do this, set the ShowItemToolTips property of the StatusStrip True and
set the AutoToolTip property of the ToolStripStatusLabel True.

Run the program and hover the mouse on the toolstrip status label. You will
see a tooltip appears displaying the value of the Text or ToolTipText
property.

Hope this helps.
If you have any concerns, please feel free to let me know.


Sincerely,
Linda Liu
Microsoft Online Community Support
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top