
Signature
Bob Powell [MVP]
Visual C#, System.Drawing
Ramuseco Limited .NET consulting
http://www.ramuseco.com
Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm
Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm
All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.
On 22 feb, 14:21, "Bob Powell [MVP]" <bob@_spamkiller_bobpowell.net>
wrote:
> Don't pass parameters in the constructor of a user control and create
> properties for your user controls that are used instead. In this manner
[quoted text clipped - 28 lines]
> > Thanks
> > Stijn
Thanks for the fast reply.
I don't quite understand "create properties for your user controls
that are used instead". My user controls need a cennctionstring. The
connection string is stored in the app.config. How do I get the
connectionstring in the user control?
thanks
Simon Harvey - 22 Feb 2007 16:59 GMT
> On 22 feb, 14:21, "Bob Powell [MVP]" <bob@_spamkiller_bobpowell.net>
> wrote:
[quoted text clipped - 35 lines]
>
> thanks
Do something like:
class MyControl{
private string connectionString = null;
// Property Accessor
public string ConnectionString{
get{
return connectionString;
}
set{
connectionString = value;
}
}
// Note - no params
public MyControl(){
}
}