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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Application Icon.(Winforms)

Status
Not open for further replies.

Durkin

Programmer
Nov 6, 2000
304
GB
How can I retreive the application icon at runtime? Or, is there a way to set the default icon for all my forms to the same as my application icon?

Thanks in advance.

Durkin
 
You cannot set a default icon for all forms.

For the application icon, click on the vbproj file in your Solution Explorer pane in VB.Net. Click the far right icon at the top (properties).

Click Build.

You'll see the application icon there. Press the button with the elipsis and pull in the icon that you desire.

I hope this helps.


Ron Repp

If gray hair is a sign of wisdom, then I'm a genius.
 
Thanks for your help Ron. I have set the application icon already. However, I have a project which is to be used in multiple applications as a sort of template. I am inheriting in my applications from forms in this base project so I want to be able to get the current application's icon to be used in the base forms. Do you know of any way to retreive the app icon at runtime?

Durkin
 
Sorry, no, but I'm sure someone else does, if it's possible.

Good luck.

Ron Repp

If gray hair is a sign of wisdom, then I'm a genius.
 
Okay. Thanks anyway for your time.

Durkin
 
Would it work to add an icon file as a resource, then set the icon in the constructor of each of your base forms ... something similar to:
Code:
Me.Icon = My.Resources.Icon1
 
Thanks, I was thinking that was probably the only way. It's a shame you can't just set a default icon and then override it though:-(.

Durkin
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top