Link to home
Start Free TrialLog in
Avatar of emi_sastra
emi_sastra

asked on

How to Show Custom Icon each of the Forms at Runtime of a Project .

Hi,

I have a project with one mdiform and several forms.

My question is how to show all the forms custom icon at runtime  without have to change all the form's icon.

Thank you.
Avatar of AkisC
AkisC
Flag of Greece image

onLoad form type
Dim ico As New System.Drawing.Icon(myAppPAth & "myDefault.ico")
Avatar of emi_sastra
emi_sastra

ASKER

Hi,

That mean I have to write it in each of the form ?
Is there any other simple way?

Thank you.
emi_sastra,

I see that you have placed several questions in the VB.NET area, but you post examples from VB6. They are not the same, and if you ara indeed using VB6, then AkisC advice will be of no help.

VB6

me.icon = loadpicture(icon_path)

if you want to set sane icon for all the forms then you would something like

dim frm as forms
for each frm in forms
    form.icon = loadpicture(icon_path)
next

Its been a long time since I have been used VB6, but I believe it should work.

Goran
Hi,

Yes, I know it. I hope I could solve for both (vb6 and vb 2005). I still use vb6 for old app and try to use vb 2005 for new develop app.

It doesn't work.

Thank you.

ASKER CERTIFIED SOLUTION
Avatar of Priest04
Priest04
Flag of Serbia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
It works.

Thank you.

You are welcome

Goran