Click here to Skip to main content
15,920,503 members
Home / Discussions / C#
   

C#

 
GeneralRe: Online Verification Pin
Andrei Ungureanu8-Oct-07 5:02
Andrei Ungureanu8-Oct-07 5:02 
QuestionDataGridView Selections Pin
ffowler8-Oct-07 3:59
ffowler8-Oct-07 3:59 
AnswerRe: DataGridView Selections Pin
Anthony Mushrow8-Oct-07 4:05
professionalAnthony Mushrow8-Oct-07 4:05 
AnswerRe: DataGridView Selections Pin
Andrei Ungureanu8-Oct-07 4:07
Andrei Ungureanu8-Oct-07 4:07 
GeneralRe: DataGridView Selections Pin
ffowler8-Oct-07 4:15
ffowler8-Oct-07 4:15 
GeneralRe: DataGridView Selections Pin
Andrei Ungureanu8-Oct-07 4:22
Andrei Ungureanu8-Oct-07 4:22 
GeneralRe: DataGridView Selections Pin
ffowler8-Oct-07 5:39
ffowler8-Oct-07 5:39 
QuestionReflection Pin
karoitay8-Oct-07 3:49
karoitay8-Oct-07 3:49 
Hi,

Consider the next situation

I Have this Attribute
<br />
[AttributeUsage(BlaBlaBla)]<br />
public class myattribute:Attribute<br />
{<br />
...<br />
...<br />
...<br />
}<br />


Now - Inside My Form
<br />
public class MyForm:Form<br />
{<br />
  [myattribute]<br />
  Button button1;<br />
<br />
  Public MyForm()<br />
  {<br />
    button1 = new Button();<br />
  }<br />
}<br />


now - using reflection - how can i get this attribute from button1?

the next gode does not work
<br />
Type Y = button1.GetType();<br />
object[] obj = T.GetCustomAttributes(typeof(myattribute),false);<br />


obj.Length is 0

(I Guess it because T.GetCustomAttributes returns the attributes of Type Button and not of its instance button1)

so... how can i get this attribute from button1?

Thanks
AnswerRe: Reflection Pin
Judah Gabriel Himango8-Oct-07 4:31
sponsorJudah Gabriel Himango8-Oct-07 4:31 
GeneralThanks Pin
karoitay8-Oct-07 5:29
karoitay8-Oct-07 5:29 
AnswerRe: Reflection Pin
Pete O'Hanlon8-Oct-07 4:32
mvePete O'Hanlon8-Oct-07 4:32 
GeneralRe: Reflection Pin
karoitay8-Oct-07 5:27
karoitay8-Oct-07 5:27 
QuestionDrag and Drop Text Pin
Jinwah508-Oct-07 3:20
Jinwah508-Oct-07 3:20 
AnswerRe: Drag and Drop Text Pin
c#_keithy8-Oct-07 3:23
c#_keithy8-Oct-07 3:23 
QuestionKeyChar reference, does it vary with keyboard? Pin
c#_keithy8-Oct-07 3:13
c#_keithy8-Oct-07 3:13 
AnswerRe: KeyChar reference, does it vary with keyboard? Pin
Andrei Ungureanu8-Oct-07 3:27
Andrei Ungureanu8-Oct-07 3:27 
GeneralRe: KeyChar reference, does it vary with keyboard? Pin
c#_keithy8-Oct-07 3:35
c#_keithy8-Oct-07 3:35 
QuestionHow to determine provider type Pin
jpasher8-Oct-07 2:41
jpasher8-Oct-07 2:41 
QuestionCommunicating with a service Pin
Lars Lie8-Oct-07 2:30
Lars Lie8-Oct-07 2:30 
AnswerRe: Communicating with a service Pin
Judah Gabriel Himango8-Oct-07 4:34
sponsorJudah Gabriel Himango8-Oct-07 4:34 
Questionusing events as arguments Pin
Bekjong8-Oct-07 2:30
Bekjong8-Oct-07 2:30 
AnswerRe: using events as arguments Pin
Pete O'Hanlon8-Oct-07 2:41
mvePete O'Hanlon8-Oct-07 2:41 
GeneralRe: using events as arguments Pin
Bekjong8-Oct-07 3:11
Bekjong8-Oct-07 3:11 
GeneralRe: using events as arguments Pin
Scott Dorman8-Oct-07 3:57
professionalScott Dorman8-Oct-07 3:57 
GeneralRe: using events as arguments Pin
Pete O'Hanlon8-Oct-07 4:00
mvePete O'Hanlon8-Oct-07 4:00 

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.