zy_abc Posted May 16, 2003 Posted May 16, 2003 Private Sub MenuItem0_DrawItem(ByVal sender As Object, ByVal e As System.Windows.Forms.DrawItemEventArgs) Handles MenuItem0.DrawItem Mn_DrawItem(e, MenuItem0.Text) End Sub Private Sub MenuItem0_MeasureItem(ByVal sender As Object, ByVal e As System.Windows.Forms.MeasureItemEventArgs) Handles MenuItem0.MeasureItem Mn_MeasureItem(e, MenuItem0.Text) End Sub Private Sub MenuItem1_DrawItem(ByVal sender As Object, ByVal e As System.Windows.Forms.DrawItemEventArgs) Handles MenuItem1.DrawItem Mn_DrawItem(e, MenuItem1.Text) End Sub Private Sub MenuItem1_MeasureItem(ByVal sender As Object, ByVal e As System.Windows.Forms.MeasureItemEventArgs) Handles MenuItem1.MeasureItem Mn_MeasureItem(e, MenuItem1.Text) End Sub For each Menu Item i have to write code like this. If i delete the menu item then have to remove drawitem and measureitem for that menu. It is very tedious. Is there any easy way out. Any help will be appreciated. Quote Thanks & Regards, zy_abc
*Gurus* divil Posted May 16, 2003 *Gurus* Posted May 16, 2003 You might find VolteFace's code here useful, it illustrates dynamically attaching event handlers and even painting menus like you're doing. Quote MVP, Visual Developer - .NET Now you see why evil will always triumph - because good is dumb. My free .NET Windows Forms Controls and Articles
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.