I am creating a user control to somewhat mimick the behavior of the left panel in Office 2003. I have a user control that contains a collection of custom objects that represent the panels seen in the navigation panel. My problem is I allow the user to specify an image for each panel but the code generated by the designer does not create a new resource bundle which causes the image to not be available.
Here's the code that is generated:
this.oL2003NavBar1 = new Outlook2003NavigationBar.OL2003NavBar();
this.sectionHeader1 = new Outlook2003NavigationBar.SectionHeader(((System.Drawing.Bitmap)(resources.GetObject("resource"))), "sh1");
Notice it is referencing a *resources* object but that it doesn't create an entry for that object. This is what I think it's supposed to generate:
1) a resources object if one does not exist:
System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(Form1));
this.oL2003NavBar1 = new Outlook2003NavigationBar.OL2003NavBar();
this.sectionHeader1 = new Outlook2003NavigationBar.SectionHeader(((System.Drawing.Bitmap)(resources.GetObject("sectionHeader1.Image"))),
What am I doing wrong here? Why doesn't the designer know it needs to generate the resource object?
Please anyone help!!!
TIA,
-=- Kevin
Kevin Cummings - 22 Feb 2005 21:28 GMT
More accurately, I'm having a problem getting the code generator to generate the proper code for an Image property.
I am creating a user control to somewhat mimick the behavior of the left panel in Office 2003. I have a user control that contains a collection of custom objects that represent the panels seen in the navigation panel. My problem is I allow the user to specify an image for each panel but the code generated by the designer does not create a new resource bundle which causes the image to not be available.
Here's the code that is generated:
this.oL2003NavBar1 = new Outlook2003NavigationBar.OL2003NavBar();
this.sectionHeader1 = new Outlook2003NavigationBar.SectionHeader(((System.Drawing.Bitmap)(resources.GetObject("resource"))), "sh1");
Notice it is referencing a *resources* object but that it doesn't create an entry for that object. This is what I think it's supposed to generate:
1) a resources object if one does not exist:
System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(Form1));
this.oL2003NavBar1 = new Outlook2003NavigationBar.OL2003NavBar();
this.sectionHeader1 = new Outlook2003NavigationBar.SectionHeader(((System.Drawing.Bitmap)(resources.GetObject("sectionHeader1.Image"))),
What am I doing wrong here? Why doesn't the designer know it needs to generate the resource object?
Please anyone help!!!
TIA,
-=- Kevin