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

Icon question...

Status
Not open for further replies.

pzmgmb

Programmer
Apr 2, 2003
115
US
If I add an Icon to my Solution how do I reference it in code?

Code:
Dim oIcon As New Icon("..\open.ico")

I understand the above is the way to load it from outside the solution.

Once I add it to the solution how can I reference it?

Also how can i create a resource file, then add an icon to it and then reference the icon from the resource file?
 
Like this perhaps?
Code:
Dim [b]oIcon[/b] As New Icon("SampIcon.ico")
' Create rectangle for icon.
Dim rect As New Rectangle(100, 100, 200, 200)
' Draw icon to screen.
e.Graphics.DrawIconUnstretched([b]oIcon[/b], rect)

__________________________________________
Try forum1391 for lively discussions
 
No, I mean how do i reference the icon that is in the solution explorer?
 
Here are two quick links that may be of interest. The examples are not in VB.NET, though.

__________________________________________
Try forum1391 for lively discussions
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top