By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
448,838 Members | 1,623 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 448,838 IT Pros & Developers. It's quick & easy.

Icon inheritance problem

P: n/a

I have posted a bug of the forms designer that overwrites always the Icon, thus preventing Icon inheritance when you derive from a form. I am trying to overcome this by adding an ImageList in the base class. However, this doesn't solve my problem about Icon inheritance. The idea is to put Icon showing code inside the base form class. I add this code to the new() sub:

'Show the inherited icon
Me.Icon = Icon.FromHandle((New System.Drawing.Bitmap(Me.IconImageList.Images(0))) .GetHicon)

The code works fine, but as you know, the new sub of the base class is called first and the new of the derived class overrides the icon definition in the InitializeComponent(). I don't want to repeat the code in all the derived form classes (what is inheritance for??). Any ideas of how to overcome this???


Nov 20 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.