Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

VB NET adding icons and text dynamically into status bar?

Posted on 2004-10-03
5
Medium Priority
?
1,221 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 1600 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

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

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

Q&A with Course Creator, Mark Lassoff, on the importance of HTML5 in the career of a modern-day developer.
When you discover the power of the R programming language, you are going to wonder how you ever lived without it! Learn why the language merits a place in your programming arsenal.
Progress
Introduction to Processes

916 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