Source code generation in VS.NET IDE

  • Thread starter Thread starter Yaser Zia Sistani
  • Start date Start date
Y

Yaser Zia Sistani

I have wrriten a custom combobox control which
only have the name of months in it.

public class MonthCombo:ComboBox
{

MonthCombo()
{
base.add("Jan");
base.add(.....
.....
}
}

and nothing more than this

When I Used this control in mt form
Every time that i load the project to the IDE
the IDE Adds a code block which adds the month names
to combo box in the forms InitializeComponent()


WHAT SHOULD I DO ABOUT THIS
PLEASE AND PLEASE HELP ME
THIS BUG HURT ME VERY MUCH
IT IS SO ABUSING ME THAT MAKE ME CRY OF IT
PLEASE AND PLEASE HELP ME MICROSOFT MAN
 
Hi Yaser,

Try adding the following method:
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]

public new System.Windows.Forms.ComboBox.ObjectCollection Items

{

get { return base.Items; }

}
 
blablablaabla
WHAT SHOULD I DO ABOUT THIS
PLEASE AND PLEASE HELP ME
THIS BUG HURT ME VERY MUCH
it's not a bug
problem is by your side
IT IS SO ABUSING ME THAT MAKE ME CRY OF IT
PLEASE AND PLEASE HELP ME MICROSOFT MAN
just read documentation

using System;
using System.Windows.Forms;
using System.ComponentModel;

namespace WindowsApplication5
{
public class MonthCombo:ComboBox
{
public MonthCombo()
{
base.Items.Add("Jan");
base.Items.Add("Feb");
//...
}
[DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)]
new public System.Windows.Forms.ComboBox.ObjectCollection Items
{
get
{
return base.Items;
}
}
}
}

pozdrawiam


Przemek Sulikowski
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top