B
Barry
A beginners question to someone that isn't a beginner
I've forgotton
a lot.
The code below isn't what I want to do but it demonstrates succinctly
my problem. I want to drop a "MyTextBox" control on a form at design
time, set the "DummyProperty" property to be "test value1", and I want
to see it showing at design and runtime "test value1". It shows a
blank. If I do this with the "Text" property it works but not with my
"DummyProperty" property. When I set the "DummyProperty" at runtime, it
sets the value and updates the textbox correctly. Why? I wouldn't
normally ask someone to correct my code but on this occasion I would
really appreciate it this jump start. Sample code below.
Thanks in advance
Barry
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;
namespace Test
{
public class MyTextBox : TextBox
{
public MyTextBox()
{
InitializeComponent();
this.Text="test value2";
}
[Browsable(true), NotifyParentProperty(true), Bindable(true),
Description("Dummy text control")]
public String Dummyproperty
{
set { this.Text = value; }
get { return this.Text; }
}
private void InitializeComponent()
{
this.SuspendLayout();
//Nothing here
this.ResumeLayout(false);
}
}
}

a lot.
The code below isn't what I want to do but it demonstrates succinctly
my problem. I want to drop a "MyTextBox" control on a form at design
time, set the "DummyProperty" property to be "test value1", and I want
to see it showing at design and runtime "test value1". It shows a
blank. If I do this with the "Text" property it works but not with my
"DummyProperty" property. When I set the "DummyProperty" at runtime, it
sets the value and updates the textbox correctly. Why? I wouldn't
normally ask someone to correct my code but on this occasion I would
really appreciate it this jump start. Sample code below.
Thanks in advance
Barry
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;
namespace Test
{
public class MyTextBox : TextBox
{
public MyTextBox()
{
InitializeComponent();
this.Text="test value2";
}
[Browsable(true), NotifyParentProperty(true), Bindable(true),
Description("Dummy text control")]
public String Dummyproperty
{
set { this.Text = value; }
get { return this.Text; }
}
private void InitializeComponent()
{
this.SuspendLayout();
//Nothing here
this.ResumeLayout(false);
}
}
}