Text Box Control

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi

I would like to programatically create a new textbox control - and then copy about a dozen of the properties of a "template" textbox control into it. Right now I'm doing it property by property - I was wondering if there was a "for each" type of approach. If I could copy ALL of the properties from my template textbox, that would also be okay

I'd appreciate any suggestions

Thanks
 
Arthlan said:
I would like to programatically create a new textbox control - and
then copy about a dozen of the properties of a "template" textbox
control into it. Right now I'm doing it property by property - I was
wondering if there was a "for each" type of approach. If I could
copy ALL of the properties from my template textbox, that would also
be okay.

I think you must do it manually because not all properties can be copied,
for example the Handle or the Controls properties.


--
Armin

How to quote and why:
http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html
 
Arthlan,

why don't you simply inherit TextBox inbto
Arthlan said:
Hi,

I would like to programatically create a new textbox control - and then
copy about a dozen of the properties of a "template" textbox control into
it. Right now I'm doing it property by property - I was wondering if there
was a "for each" type of approach. If I could copy ALL of the properties
from my template textbox, that would also be okay.
 
Whopsy,

shouldn't be watching tv while answering to newsgroups - obviously hit the
send button too early...
My answer keeps being thrilling that way, doesn't it? ;-)

Anyway, what I was going to write, wasn't right, anyway.

Armin is right, AFAIK TextBox isn't completely serializable, so you have to
copy property settings the way you already do it.
Using Reflection could be another approach, but that would be breaking a fly
on the wheel...
(God, I love http://dict.leo.org/)

Klaus
 
* "=?Utf-8?B?QXJ0aGxhbg==?= said:
I would like to programatically create a new textbox control - and
then copy about a dozen of the properties of a "template" textbox
control into it. Right now I'm doing it property by property - I was
wondering if there was a "for each" type of approach. If I could copy
ALL of the properties from my template textbox, that would also be
okay.

Why not create a control which inherits from 'TextBox' and sets the
property values?
 
Back
Top