Click here to Skip to main content
15,913,854 members
Home / Discussions / Windows Forms
   

Windows Forms

 
GeneralRe: copy functionality does not work in CrystalReportViewer Pin
maryam.saboor8-Mar-10 18:07
professionalmaryam.saboor8-Mar-10 18:07 
QuestionNetAdvantage and Infragistics tools [modified] Pin
mikobi5-Oct-09 20:44
mikobi5-Oct-09 20:44 
AnswerRe: NetAdvantage and Infragistics tools Pin
Ashfield7-Oct-09 1:47
Ashfield7-Oct-09 1:47 
QuestionRichTextBox Scroll Problem Pin
NET/C++Developer5-Oct-09 2:56
NET/C++Developer5-Oct-09 2:56 
QuestionHow to Display DataSet.xsd Table in Report.rdlc Table Pin
Francis K Antony4-Oct-09 20:55
Francis K Antony4-Oct-09 20:55 
QuestionGetting Change Event of All controls on a WinForm Pin
εїзεїзεїз3-Oct-09 21:49
εїзεїзεїз3-Oct-09 21:49 
AnswerRe: Getting Change Event of All controls on a WinForm Pin
Eddy Vluggen3-Oct-09 22:02
professionalEddy Vluggen3-Oct-09 22:02 
QuestionUserControl properties don't match in designer and InitializeComponent Pin
dybs1-Oct-09 17:44
dybs1-Oct-09 17:44 
So here's a wierd one.... (sorry for the length, but this needs some 'splainin)

I have a UserControl consisting of a TextBox, a Label, and a CheckBox. I have a ShowCheckBox property like so:
C#
[Browsable(true),
DesignerSerializationVisibility(DesignerSerializationVisibility.Visible),
EditorBrowsable(EditorBrowsableState.Always),
Bindable(true),
Category("Behavior"),
DefaultValue(true)]
public bool ShowCheckBox
{
    get
    {
        return checkbox.Visible;
    }
    set
    {
        checkBox.Visible = value;
    }
}
(If you see any compile errors, ignore them, I'm typing this from memory. The code I actually have does compile).

This UserControl is part of the same project as my application. I can place several instances of these controls on my form and the ShowCheckBox property defaults to true, as it should. So far, so good.

Now the weird part...through a variety of actions (switching tabs on the form, recompiling or running the application, etc.), suddenly my ShowCheckBox properties all get set to false, so I don't see the CheckBox in any of my UserControls in the form's designer! Sure enough, the values are all set to false in InitializeComponent. I then go back and reset the properties to true in the designer, and I see the property settings disappear from InitializeComponent (i.e. the default value is being used). After a little while, it happens again - the values magically get set to false again. I'm thinking this has something to do with the DesignerSerializationVisibility attribute?

Even weirder...usually when something changes in InitializeComponent or in the designer, the change is automatically reflected in the other location. But when I see the property values set to false in InitializeComponent, I still see the property set to true in the designer! I probably spent about an hour or so searching Google and CP, and the only help I really found was in setting the attributes I have above.

Is this a bug in Visual Studio by any chance? Or is there some other attribute I'm missing? I'm using VS 2005 SP1, C#, Windows XP SP3, all the latest updates.

Thanks,

Dybs
AnswerRe: UserControl properties don't match in designer and InitializeComponent Pin
mp3141512-Oct-09 5:59
mp3141512-Oct-09 5:59 
QuestionWindows Forms: TreeView in SplitContainer flickers on Resizing the screen at runtime PinPopular
Poornima Naik1-Oct-09 3:24
Poornima Naik1-Oct-09 3:24 
QuestionWindows Forms, data, filter Pin
Ajay Fresher30-Sep-09 23:57
Ajay Fresher30-Sep-09 23:57 
AnswerRe: Windows Forms, data, filter Pin
Eddy Vluggen3-Oct-09 22:38
professionalEddy Vluggen3-Oct-09 22:38 
GeneralRe: Windows Forms, data, filter Pin
Ajay Fresher4-Oct-09 20:37
Ajay Fresher4-Oct-09 20:37 
GeneralRe: Windows Forms, data, filter Pin
Eddy Vluggen5-Oct-09 6:41
professionalEddy Vluggen5-Oct-09 6:41 
QuestionShow Loading Image Pin
swapnil_bhanagle26-Sep-09 0:42
swapnil_bhanagle26-Sep-09 0:42 
AnswerRe: Show Loading Image Pin
Richard MacCutchan26-Sep-09 4:05
mveRichard MacCutchan26-Sep-09 4:05 
GeneralRe: Show Loading Image Pin
swapnil_bhanagle28-Sep-09 16:23
swapnil_bhanagle28-Sep-09 16:23 
QuestionImage Effects in Windows Application Pin
Sachin Dubey25-Sep-09 21:07
Sachin Dubey25-Sep-09 21:07 
AnswerRe: Image Effects in Windows Application Pin
freakyit29-Sep-09 4:33
freakyit29-Sep-09 4:33 
QuestionHow to tell "cut" from "copy" upon pasting Pin
michalJ24-Sep-09 14:40
michalJ24-Sep-09 14:40 
AnswerRe: How to tell "cut" from "copy" upon pasting Pin
Luc Pattyn24-Sep-09 15:04
sitebuilderLuc Pattyn24-Sep-09 15:04 
GeneralRe: How to tell "cut" from "copy" upon pasting Pin
michalJ24-Sep-09 15:10
michalJ24-Sep-09 15:10 
GeneralRe: How to tell "cut" from "copy" upon pasting Pin
michalJ24-Sep-09 15:30
michalJ24-Sep-09 15:30 
GeneralRe: How to tell "cut" from "copy" upon pasting Pin
Luc Pattyn24-Sep-09 17:02
sitebuilderLuc Pattyn24-Sep-09 17:02 
AnswerRe: How to tell "cut" from "copy" upon pasting Pin
michalJ25-Sep-09 0:51
michalJ25-Sep-09 0:51 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.