Windows Develop Bookmark and Share   
 index > Windows Forms Designer > ToolStrip Problem
 

ToolStrip Problem

Hi All

In my application I have form has ToolStrip Control in this ToolStrip I added ToolStripStatusLabel and set its Text Property to "NUM".

When I run the application the ToolStripStatusLabel Text ("NUM") usually appears reversed and sometimes appears right but the number of reversed text appears more than of right text.

Could anybody helps me

Thanks

debuging  Sunday, June 01, 2008 2:11 PM

Hi debuging,

Sorry, I cannot reproduce your problem with the code below.

Code Snippet

public partial class Form15 : Form

{

public Form15()

{

InitializeComponent();

ToolStripStatusLabel label = new ToolStripStatusLabel();

label.Text = "NUM";

this.toolStrip1.Items.Add(label);

}

}

Usually, we use StatusStrip control and add ToolStripStatusLabel to StatusStrip control, you can try to use a StatusStrip control instead of the ToolStrip to see if the problem still happens.

Let me know if this helps, if not, could you please provide detailed steps to reproduce this problem?

Best regards.
Rong-Chun Zhang

Windows Forms General FAQs
Windows Forms Data Controls and Databinding FAQs

Rong-Chun Zhang  Thursday, June 05, 2008 8:28 AM

Hi debuging,

Sorry, I cannot reproduce your problem with the code below.

Code Snippet

public partial class Form15 : Form

{

public Form15()

{

InitializeComponent();

ToolStripStatusLabel label = new ToolStripStatusLabel();

label.Text = "NUM";

this.toolStrip1.Items.Add(label);

}

}

Usually, we use StatusStrip control and add ToolStripStatusLabel to StatusStrip control, you can try to use a StatusStrip control instead of the ToolStrip to see if the problem still happens.

Let me know if this helps, if not, could you please provide detailed steps to reproduce this problem?

Best regards.
Rong-Chun Zhang

Windows Forms General FAQs
Windows Forms Data Controls and Databinding FAQs

Rong-Chun Zhang  Thursday, June 05, 2008 8:28 AM

This reverseing on status strip happens often in my programs, but I can guarantee you there is nothing in the statusstrip displaying code that causes the effect.

It usually happens when I am using statusstrip in a timer while I am doing something else in the foreground, and disabling the form so that the user is blocked from starting another autonomous process and I don't want them to interfer.

Ironnically when the codeis handling other errors, which are handled fine and the form returns to the user to try to rerun this or anotherprocess properly is when the reversal of text can ocurr.

The user must have several conditions of files set up, and other applications properly installed as I am using the Process methods of executing applications, letting them run, and then returning control to the user.

My entireprogram, the use of Process methods, and everything else is working fine, its just unsettling to suddenly see the text in the statusstrip reversed, or mirrored.

I use process to start WinZip, Adobe Professional PDF maker, and a couple different Mentor CAD applications.

CiscoSAearl  Tuesday, September 30, 2008 3:10 PM
HI,

I encounter same problem in my program. It's very rigorous that the text is reversed sometimes. After some testing. I could 100% reproduce this problem in a small application. Could somebody help me on this. Apprecaited your help.


Debug in VSTS2005
Breakpoint on line of code -[label1.Text = "ABCDEFG";]

debug->run-> stop at breakpoint-> f5 , the display string is reversed.


public Form1()
{
InitializeComponent();
CreateStatusbar();
}

private void CreateStatusbar()
{
ToolStripStatusLabel label1 = new TestLabel();
//1st, only one label, the display string is correct
ToolStripStatusLabel label2 = new TestLabel();
// 2nd, No right to left, display string is correct;
this.statusStrip.RightToLeft = RightToLeft.Yes;
ToolStripContainer toolstripContrainer = new ToolStripContainer();
this.statusStrip.Items.Add(label1);
this.statusStrip.Items.Add(label2);

// Add breakpoint here, if no breakpoint, display string is correct;
label1.Text = "ABCDEFG";
label2.Text = "12345678";
}
class TestLabel : ToolStripStatusLabel
{
private TestBar bar1 = new TestBar();
}

public partial class TestBar : Form
{
public TestBar()
{
InitializeComponent();
FormBorderStyle = FormBorderStyle.None;
// no following line, display string is corect;
this.WindowState = FormWindowState.Minimized;
this.Show();
this.Hide();
WindowState = FormWindowState.Normal;
ShowInTaskbar = false;

// No following line, display string is correct;
TopMost = true;
MaximizeBox = false;
MinimizeBox = false;
ControlBox = false;
}
}
Nicolas Wang  Thursday, February 26, 2009 2:29 PM

You can use google to search for other answers

Custom Search

More Threads

• Loading panels too slow
• Change Font Color While Typing
• Control missing in runtime
• fade timer component
• Menu strip Help
• Form resized by IDE
• Alternate colors for cells in a table in RichTextBox?
• Support Multi Languages
• Adding a Custom Property to a TabPage
• Horizontal tabs (buttons) on left side