Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Showing text on a StatusStrip control

Status
Not open for further replies.

IlyaRabyy

Programmer
Nov 9, 2010
571
US
Colleagues,
I continue to get acquainted with (new to me) VS 2019 / VB.
I took existing project (made in VS 2012), re-named and opened and saved in VS 2019. Then I added Status Strip control to frmMain, made very simple procedure in the VB module (where I have all the common Subs and Funcs):

Code:
'====================================================================================================================================
Public Sub Show_Form_Name_On_frmMain_StatusBar(Optional ByVal pcFrmName As String = "")
'====================================================================================================================================
' Purpose       : Displays the name of the function (Form) on the form Main's Status Bar (Strip)
' Description   : 
' Side effects  : Shan't be any.
' Notes         : 1. Company- and application-specific.
'                 2. Complies with .NET Framework ver. 2.0 and higher.
'		  3. No parameter's verification, presumed valid.
'		  4. Parameter was made Optional for "cleaning" the status bar when this Sub is called w/o a parameter.
' Author        : Ilya I. Rabyy
' Revisions     : by Ilya on 2021-12-23 – started 1st draft.
'====================================================================================================================================
frmMain.objStatusStrip.Text = pcFrmName

End Sub
'====================================================================================================================================

Then added call to this Sub to the bar menu item's Sub (in green):
Code:
'====================================================================================================================================
Private Sub YearEnd1099NECToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles YearEnd1099NECToolStripMenuItem.Click
CloseAllChildren()
[b][COLOR=#4E9A06]Show_Form_Name_On_frmMain_StatusBar(frmYE1099NEC.Text)[/color][/b]
frmYE1099NEC.MdiParent = Me
frmYE1099NEC.Show()
End Sub
'====================================================================================================================================

Then I ran it in Debug, selected this 1099NEC item from the bar menu: the form did appear, but... this status strip stayed blank.
What am I doing wrong?
Please advise.

Regards,

Ilya
 
When you place breakpoint on the line:
[tt]
Show_Form_Name_On_frmMain_StatusBar(frmYE1099NEC.Text)
[/tt]
Run your app, and when you break on this line, move your mouse over [tt]frmYE1099NEC.Text[/tt], what do you see? Any text?

---- Andy

"Hmm...they have the internet on computers now"--Homer Simpson
 
Sorry for the delay with response, was on vacation all week from X-mas til New Year.
Here's the screenshot.

2022_01_03_09_20_OD_Tools_2022_frmMain_StatusStripNotShowingText_neqqxx.jpg


And this is what's shown on the Status Strip:

2022_01_03_09_20_OD_Tools_2022_frmMain_StatusStripNotShowingText_02_j7j3lx.jpg


What is this "ToolStripStatusLabel1" I've no idea: objStatusStrip's properties sheet shows no controls collection... and example on page ain't helping either: t's in ages-old-fashioned (IMHO) manner when visual design was not available.

What am I missing?
Please advise.

Regards,

Ilya
 
That was helpful!
When I clicked on the Items in the Properties sheet for this Status Strip - this dialog appeared:

2022_01_03_09_20_OD_Tools_2022_frmMain_StatusStripNotShowingText_05_isrnxx.jpg


And when I added label there (re-named it, too), then this code did work:

2022_01_03_09_20_OD_Tools_2022_frmMain_StatusStripNotShowingText_04_rlrp03.jpg


The sent as parameter text did show up:

2022_01_03_09_20_OD_Tools_2022_frmMain_StatusStripNotShowingText_05_aq1skx.jpg
2022_01_03_09_20_OD_Tools_2022_frmMain_StatusStripDoesShowText_06_nmb3jb.jpg


Thank you!

The issue's been resolved, case is closed.

Regards,

Ilya
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top