Click here to Skip to main content
15,897,891 members
Home / Discussions / C#
   

C#

 
AnswerRe: Which richTextBox Event to use ? Pin
Heath Stewart5-Aug-04 2:55
protectorHeath Stewart5-Aug-04 2:55 
GeneralRe: Which richTextBox Event to use ? Pin
evdoxos5-Aug-04 3:09
evdoxos5-Aug-04 3:09 
GeneralRe: Which richTextBox Event to use ? Pin
Heath Stewart5-Aug-04 3:14
protectorHeath Stewart5-Aug-04 3:14 
GeneralRe: Which richTextBox Event to use ? Pin
evdoxos5-Aug-04 3:24
evdoxos5-Aug-04 3:24 
QuestionProbably Reflection... but how? Pin
matthias s.5-Aug-04 1:05
matthias s.5-Aug-04 1:05 
AnswerRe: Probably Reflection... but how? Pin
Heath Stewart5-Aug-04 2:47
protectorHeath Stewart5-Aug-04 2:47 
GeneralRe: Probably Reflection... but how? Pin
matthias s.5-Aug-04 3:26
matthias s.5-Aug-04 3:26 
GeneralRe: Probably Reflection... but how? Pin
Heath Stewart5-Aug-04 3:35
protectorHeath Stewart5-Aug-04 3:35 
Type.GetProperty returns a PropertyInfo, which defines a GetValue method. You pass this the instance of the object you're reflecting (or null for a static property) and either null for the second param (depending on which overload you call) or an object[] array for an indexer (the only property type that can accept arguments):
Button b = new Button();
b.Text = "Click me";
PropertyInfo prop = b.GetType().GetProperty("Text");
string text = prop.GetValue(b, null);
Console.WriteLine(text); // Prints "Click me"
I recommend looking at the System.Reflection namespace member documentation. I also recommend you take a look at System.ComponentModel. Using the ComponentModel encapsulates reflection in a way that's easier to use and design-time friendly (if applicable to what you're doing).

 

Microsoft MVP, Visual C#
My Articles
Generalget opened folder in Outlook Pin
Stephan Wright5-Aug-04 0:36
Stephan Wright5-Aug-04 0:36 
GeneralRe: get opened folder in Outlook Pin
Michael P Butler5-Aug-04 4:09
Michael P Butler5-Aug-04 4:09 
GeneralRe: get opened folder in Outlook Pin
Stephan Wright5-Aug-04 22:46
Stephan Wright5-Aug-04 22:46 
GeneralRe: get opened folder in Outlook Pin
Michael P Butler5-Aug-04 22:51
Michael P Butler5-Aug-04 22:51 
GeneralRe: get opened folder in Outlook Pin
Stephan Wright5-Aug-04 23:01
Stephan Wright5-Aug-04 23:01 
GeneralRe: get opened folder in Outlook Pin
Michael P Butler5-Aug-04 23:17
Michael P Butler5-Aug-04 23:17 
Generaldisable poweroff function Pin
JockerSoft4-Aug-04 22:57
JockerSoft4-Aug-04 22:57 
GeneralRe: disable poweroff function Pin
leppie5-Aug-04 0:45
leppie5-Aug-04 0:45 
GeneralRe: disable poweroff function Pin
Heath Stewart5-Aug-04 1:46
protectorHeath Stewart5-Aug-04 1:46 
GeneralRe: disable poweroff function Pin
Heath Stewart5-Aug-04 2:24
protectorHeath Stewart5-Aug-04 2:24 
GeneralRe: disable poweroff function Pin
Dave Kreskowiak5-Aug-04 8:10
mveDave Kreskowiak5-Aug-04 8:10 
GeneralRe: disable poweroff function Pin
JockerSoft5-Aug-04 22:25
JockerSoft5-Aug-04 22:25 
Questionhow to check if instance is running Pin
Stephan Wright4-Aug-04 22:48
Stephan Wright4-Aug-04 22:48 
AnswerRe: how to check if instance is running Pin
leppie4-Aug-04 22:57
leppie4-Aug-04 22:57 
AnswerRe: how to check if instance is running Pin
exhaulted4-Aug-04 23:09
exhaulted4-Aug-04 23:09 
GeneralRe: how to check if instance is running Pin
leppie5-Aug-04 0:48
leppie5-Aug-04 0:48 
GeneralRe: how to check if instance is running Pin
Heath Stewart5-Aug-04 1:44
protectorHeath Stewart5-Aug-04 1:44 

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.