We help IT Professionals succeed at work.

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

244 Views
Last Modified: 2010-04-23
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.
Comment
Watch Question

CERTIFIED EXPERT

Commented:
onLoad form type
Dim ico As New System.Drawing.Icon(myAppPAth & "myDefault.ico")

Author

Commented:
Hi,

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

Thank you.

Commented:
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

Author

Commented:
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.

Commented:
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION

Author

Commented:
It works.

Thank you.

Commented:
You are welcome

Goran
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a sample view!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.