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

How do i add a ico file to the form title bar?

Status
Not open for further replies.

r3b00t

Technical User
Aug 13, 2002
45
0
0
GB
Can anyone tell me?

Cheers

r3b00t
 
Yes,It`s simple:
In the Form properties window select "icon" and choose an icon from the dialog box.
note :You can select your icons from Icon folder where you installed VB. Behnam2204@yahoo.com
BehnamPro
 
Your original version of this question in thread222-345122 mentioned that you actually wanted to be able to place a small jpeg in the titlebar. CestusGW's reply that you can only use a .ico was a little misleading - it is possible to use any of the image files that can be loaded via LoadPicture.

The trick involves use of the ImageList control (which is one of the components of the Microsoft Common Controls library). Here's an example of a function to do this:
[tt]
Private Sub SetFormIcon(frmTargetForm As Form, ByVal strImageSource As String)
ImageList1.ListImages.Clear
ImageList1.ListImages.Add , "MyIconSource", LoadPicture(strImageSource)
frmTargetForm.Icon = ImageList1.ListImages("MyIconSource").ExtractIcon
End Sub
 
Yes,It`s simple:
In the Form properties window select "Icon" and select an icon for it.
Note:You can select your icons from Icon folder where you installed VB.(...\VB98\Graphics\Icons) Behnam2204@yahoo.com
BehnamPro
 
strongm,

?? my MSDN Help only shows 'ImageList' as a VC++ control. Of course, I have had a lot of trouoble with 'Ms. Help speak' since being rewarded with MSDN, but usually when I can find the topic, the VB references are at least there. Is this a VB object, or are you using an API which isn't shown?

MichaelRed
m.red@att.net

There is never time to do it right but there is always time to do it over
 
ImageList is a standard control in the Common Controls library. It has been there since W95. So, no special API calls. It is definitely documented on MSDN, under:

MSDN Library/Visual Studio 6.0 Documentation/Visual Basic Documentation/Reference/Controls Reference/ActiveX Controls/ImageList Control
 
strongm,

Thanks. Aparently I now have another topic to find a textbook for (MSDN?)

I had thought (ASS-U-ME-D?) that selecting "(Entire Collection)" in the active subset realy meant "ALL", but now, I'm completly UNSURE of this.

Of course, since MSDN has been added to my "Help" it appears to be a lot less helpful and a lot more confusing. It is surely another sign of advancing age ...

MichaelRed
m.red@att.net

There is never time to do it right but there is always time to do it over
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top