Autor Beitrag
ChrisHa
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 30

Win 7 x64
VS 2010, 2008
BeitragVerfasst: Di 03.12.13 17:36 
Hallo liebe Programmierergemeinde,

habe hier ein kleines Problem:
Ich habe ein UserControl, welches nur aus einer Richtextbox besteht (siehe Anlage).
Auf das UserControl1 ansich zuzugreifen ist kein Problem.

Nur wie kann ich über einen Button zb Werte in die Textbox schreiben, welche in dem UserControl sind?

Schönen Abend euch noch :)
Einloggen, um Attachments anzusehen!
Th69
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Moderator
Beiträge: 4798
Erhaltene Danke: 1059

Win10
C#, C++ (VS 2017/19/22)
BeitragVerfasst: Di 03.12.13 17:56 
Hallo ChrisHa,

biete über das UserControl eine Schnittstelle an, welche die benötigte Funktionalität bereitstellt, also Methoden und/oder Eigenschaften - und leite die übergebenen Parameter dann an die interne RichTextBox weiter (keinesfalls mache die RichTextBox direkt public, da dies dem Kapselungsprinzip widerspricht).
ChrisHa Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 30

Win 7 x64
VS 2010, 2008
BeitragVerfasst: Mi 04.12.13 12:57 
Also ganz normal behandeln wie bei einer Klasse?
Th69
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Moderator
Beiträge: 4798
Erhaltene Danke: 1059

Win10
C#, C++ (VS 2017/19/22)
BeitragVerfasst: Mi 04.12.13 13:11 
Auch ein UserControl ist eine Klasse - also ja ;-)

Für diesen Beitrag haben gedankt: ChrisHa
ChrisHa Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 30

Win 7 x64
VS 2010, 2008
BeitragVerfasst: Mi 04.12.13 17:40 
Vielen Dank... für die Blumen. :)