473,698 Members | 2,047 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to refer to status bar panels thru object syntax?

Is there any way to refer to the .text property of a status bar panel thru
object syntax,

like below (the inner "for" does not work):

Public Function FormStatusBarPa int(ByVal frm As Form) As Integer

Dim obj As New Control

Dim str As String

Dim pnl As StatusBar.Statu sBarPanelCollec tion

For Each obj In frm.Controls

str = obj.GetType.ToS tring

Select Case str

Case "System.Windows .Forms.StatusBa r"

For Each pnl In obj.Controls

pnl(0).Text = "Edit"

pnl(1).Text = "Ready for update"

pnl(2).Text = Today.ToShortDa teString

Next

End Select

Next

End Function

Thanks,

Dean Slindee
Nov 20 '05 #1
2 1393
On Mon, 24 Nov 2003 12:26:06 -0600, Dean Slindee wrote:

See Notes below
Is there any way to refer to the .text property of a status bar panel thru
object syntax,
Public Function FormStatusBarPa int(ByVal frm As Form) As Integer

Dim obj As New Control

Dim str As String
Dim pnl As StatusBarPanel
For Each obj In frm.Controls

str = obj.GetType.ToS tring

Select Case str

Case "System.Windows .Forms.StatusBa r"

You have to cast the obj variable to be a statusbar:

For Each pnl In CType(obj,Statu sBar).Panels
pnl.Text = "Edit"

--
Chris

To send me an E-mail, remove the underscores and lunchmeat from my E-Mail
address.
Nov 20 '05 #2
Dean,

I agree with Chris.
Or you can modify your code as follows.
Private Sub Form1_Load(ByVa l sender As System.Object, ByVal e As
System.EventArg s) Handles MyBase.Load
Dim obj As Control
Dim str As String
Dim pnl As StatusBar.Statu sBarPanelCollec tion
For Each obj In Me.Controls
str = obj.GetType.ToS tring
Select Case str
Case "System.Windows .Forms.StatusBa r"
pnl = CType(obj, StatusBar).Pane ls
pnl(0).Text = "Edit"
pnl(1).Text = "Ready for update"
pnl(2).Text = Today.ToShortDa teString
End Select
Next
End Sub

If you have any conern on this question, please post here.

Regards,
Peter Huang
Microsoft Online Partner Support
Get Secure! www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
--------------------
From: "Dean Slindee" <sl*****@mindsp ring.com>
Subject: How to refer to status bar panels thru object syntax?
Date: Mon, 24 Nov 2003 12:26:06 -0600
Lines: 44
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.3790.0
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
Message-ID: <OC************ *@tk2msftngp13. phx.gbl>
Newsgroups: microsoft.publi c.dotnet.langua ges.vb
NNTP-Posting-Host: 0-1pool36-40.nas14.milwau kee1.wi.us.da.q west.net 63.156.36.40Path: cpmsftngxa07.ph x.gbl!cpmsftngx a10.phx.gbl!TK2 MSFTNGXA05.phx. gbl!TK2MSFTNGP0 8
..phx.gbl!tk2ms ftngp13.phx.gblXref: cpmsftngxa07.ph x.gbl microsoft.publi c.dotnet.langua ges.vb:158717
X-Tomcat-NG: microsoft.publi c.dotnet.langua ges.vb

Is there any way to refer to the .text property of a status bar panel thru
object syntax,

like below (the inner "for" does not work):

Public Function FormStatusBarPa int(ByVal frm As Form) As Integer

Dim obj As New Control

Dim str As String

Dim pnl As StatusBar.Statu sBarPanelCollec tion

For Each obj In frm.Controls

str = obj.GetType.ToS tring

Select Case str

Case "System.Windows .Forms.StatusBa r"

For Each pnl In obj.Controls

pnl(0).Text = "Edit"

pnl(1).Text = "Ready for update"

pnl(2).Text = Today.ToShortDa teString

Next

End Select

Next

End Function

Thanks,

Dean Slindee


Nov 20 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
2990
by: Ada | last post by:
i have a little bit of issue getting the status bar to work 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 moved up one line above. so, if i click 10 times, i got a stack of 10 rows of status bar.
1
2527
by: William Oliveri | last post by:
Hi all, I'm writing some code for disaster recovery. I need to have an application which accesses Sql Server to determine if the local database is up or not and then if not go to the secondary server. So like this: 1. Determine if Sql Server A is up, if so is the database active. 2. If no on either count, go to Sql Server B/database.
1
4779
by: Ben | last post by:
Hi We have a number of Panels on our windows form, we have controls inside and outside of the panels. I am having problems tabbing between controls, it appers to be when the controls are within panels: It will tab though the controls outside the panels and then, tab into the panels. I have also tried setting the tab index at design time.
2
2872
by: =?Utf-8?B?Um9ja3k=?= | last post by:
If the network cable is unplugged I need to change an image on my main form status bar, however this does not work ' The computer has been connected or disconnected from the network If e.IsNetworkAvailable = False Then My.Forms.MainForm.usbtest.Panels(2).Appearance.Image = My.Resources.server_error Else My.Forms.MainForm.usbtest.Panels(2).Appearance.Image = My.Resources.server_ok
0
8674
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9157
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9026
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8861
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7723
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6518
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5860
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4366
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
2328
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.