Solved

VB NET adding icons and text dynamically into status bar?

Posted on 2004-10-03
5
1,181 Views
Last Modified: 2010-05-18
1 - How can i add icons and text dynamically into status bar of my form in VB NET?
2 - I am adding picture in picture boxes but the files are external to my projet. How can i add these files in my projects resources?

I need a fast reply...... 400 points ;)
0
Comment
Question by:ascendit
  • 2
5 Comments
 
LVL 19

Expert Comment

by:arif_eqbal
ID: 12214725
I hope you have Added a Panel to the Status Bar (if not Add using Panels collection in the Property Window)

Then to Add Text
SBar.Panels(0).Text = "Text in the Status Bar"

Now Adding an Icon is a bit of work, And for using a Resource file just for Icons, I prefer ImageList, So add an Imagelist and add the icons into it then

SBar.Panels(0).Icon = Icon.FromHandle((New Bitmap(ImageList1.Images(0)).GetHicon))

See the SBar.Panels(0).Icon property takes an Icon to show on the StatusBar bar How to get an Icon, for this you need to use Icon.FromHandle method, Now for getting a Handle to the Icon you need to convert the Icon to BitMap... So all the code you see

I have cramped all the code in one line you could break it though say like creating a Bitmap object separately so on..
0
 

Author Comment

by:ascendit
ID: 12220925
Sorry but this pannel thing is not working. When i add panel from the collection window they appear in that but dont appear at all in the status neither do they appear at runtime, but the error is not thrown 2. So the panels object is present but cant be displayed. Now aht shuld i do :P
0
 
LVL 19

Accepted Solution

by:
arif_eqbal earned 400 total points
ID: 12223821
You have to set the property of the statusbar called ShowPanels=True
then only the Panels will be visible

0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A short article about a problem I had getting the GPS LocationListener working.
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …

831 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question