hi AC
that's what i did previously before i posted the message on this board
i was thinking because the code, although it's the same, appear twice in different method, C# compiler would do all the clean up automatically
i tried your suggestion below
no go
code doesn't even compile
err msg
C:\Form1.cs(694): The type or namespace name 'panel1' could not be found (are you missing a using directive or an assembly reference?
i think what happened here is that although the object got instantiated on the LOAD FORM method but it got destroyed when it exited LOAD FORM
when i click on another method which contained the same code, it looks for the INSTANCE
in this case, of course, i think it's out of scope
this is the reason why i added all enchilada again
obvioulsy, something didn't go as plan
i was thinking may be there's a DISPOSE() method somewhere i can call before create the new instance in the new method
may be that can take care of the problem
anyhow, i'm all open for any advice. :-
--Ad
----- Aravind C wrote: ----
Hi Ada
From what I undestand, in your Click handler, you call th
snippet of code that you posted. Correct ?
Actually, you must call the code that creates and adds th
status bar to the form's control collection only once
prefeably in the designer generated InitializeComponent(
called in the Form's Constructor or in Form's Load event handler
Otherwise we would end up creating and adding multiple instances of th
status bar to the windows form - which explains the behavio
you're seeing with the status bars being stacked one on top of another
For updating the status bar's text, it may be enough to call
panel1.Text = "....some text ...."; in your Click handler
Regards
Aravind
"Ada" <an*******@discussions.microsoft.com> wrote in messag
news:BC**********************************@microsof t.com..
hi AC below is the snippet note, this is the exact same code in MSDN // // Create a StatusBar control // StatusBar statusBar1 = new StatusBar()
/
// StatusBarPanel panel1 = new StatusBarPanel() // panel1.BorderStyle = StatusBarPanelBorderStyle.Sunken
// // Initialize the text of the panel
// panel1.Text = "Ready..."
// // Set the AutoSize property to use all remaining space on th
StatusBar // panel1.AutoSize = StatusBarPanelAutoSize.Spring
/
// // Display panels in the StatusBar control
// statusBar1.ShowPanels = true
/
// statusBar1.Panels.Add(panel1)
/
/
// // Add the StatusBar to the form
// this.Controls.Add(statusBar1)> ----- Aravind C wrote: ---- Hi Ada
Typically, the StatusBar.Text or the StatusBarPanel.Text property (i
usin panel
in the status bar) should take care of updating the status bar text
Can you post a snippet of code in your Click handler tha
updates the status bar text ?
That will help us track down the cause of the issu Regards Aravind "Ada" <an*******@discussions.microsoft.com> wrote in messag news:CC**********************************@microsof t.com.. i have a little bit of issue getting the status bar to wor
properly this is what happens now when the program loaded, the status is "READY...
the code is inside the FORM LOAD i also added the same code in another CLICK METHOD
everytime i click, the status got updated but the old "READY...
got move up one line above so, if i click 10 times, i got a stack of 10 rows of status bar the question is...... how do i destroy the old status bar and update the new info an
leaving i at the same position thanks in advance
Ada>