Click here to Skip to main content
15,914,111 members
Home / Discussions / C#
   

C#

 
GeneralRe: How do I use one form showing to different look Pin
darkelv22-Feb-06 0:59
darkelv22-Feb-06 0:59 
QuestionCustomizing controls Pin
madhusri21-Feb-06 19:48
madhusri21-Feb-06 19:48 
AnswerRe: Customizing controls Pin
AB777121-Feb-06 21:09
AB777121-Feb-06 21:09 
GeneralRe: Customizing controls Pin
madhusri21-Feb-06 21:38
madhusri21-Feb-06 21:38 
GeneralRe: Customizing controls Pin
AB777121-Feb-06 21:43
AB777121-Feb-06 21:43 
Questionregistry Pin
papa198021-Feb-06 19:37
papa198021-Feb-06 19:37 
AnswerRe: registry Pin
gnjunge21-Feb-06 23:26
gnjunge21-Feb-06 23:26 
GeneralRe: registry Pin
papa198022-Feb-06 3:20
papa198022-Feb-06 3:20 
GeneralRe: registry Pin
gnjunge22-Feb-06 6:14
gnjunge22-Feb-06 6:14 
Questionchange of size of PictureBox? (error in code, or in .NET2.0?) Pin
dorwin21-Feb-06 19:18
dorwin21-Feb-06 19:18 
AnswerRe: change of size of PictureBox? (error in code, or in .NET2.0?) Pin
Robin Panther21-Feb-06 22:44
Robin Panther21-Feb-06 22:44 
GeneralRe: change of size of PictureBox? (error in code, or in .NET2.0?) Pin
dorwin21-Feb-06 23:02
dorwin21-Feb-06 23:02 
Questionhandling unicode Pin
cshivaprasad21-Feb-06 17:48
cshivaprasad21-Feb-06 17:48 
AnswerRe: handling unicode Pin
Christian Graus21-Feb-06 17:54
protectorChristian Graus21-Feb-06 17:54 
GeneralRe: handling unicode Pin
cshivaprasad21-Feb-06 18:45
cshivaprasad21-Feb-06 18:45 
AnswerRe: handling unicode Pin
Malli_S22-Feb-06 1:45
Malli_S22-Feb-06 1:45 
GeneralRe: handling unicode Pin
cshivaprasad22-Feb-06 2:19
cshivaprasad22-Feb-06 2:19 
AnswerRe: handling unicode Pin
Christian Graus21-Feb-06 17:56
protectorChristian Graus21-Feb-06 17:56 
GeneralRe: handling unicode Pin
Le centriste22-Feb-06 1:22
Le centriste22-Feb-06 1:22 
Questionwhy do i get "object reference not set to an instance of an object" Pin
aqui_i21-Feb-06 16:07
aqui_i21-Feb-06 16:07 
AnswerRe: why do i get "object reference not set to an instance of an object" Pin
Christian Graus21-Feb-06 16:15
protectorChristian Graus21-Feb-06 16:15 
QuestionAbout Windows Service. Pin
tianwei0221-Feb-06 16:04
tianwei0221-Feb-06 16:04 
Questiondeserialize to C# class from external config file? Pin
Tom Paluzzi21-Feb-06 15:50
Tom Paluzzi21-Feb-06 15:50 
QuestionUgh! Property Grid Pin
gantww21-Feb-06 14:01
gantww21-Feb-06 14:01 
Hello all,
Does anyone know how to add commands to the bottom of a property grid at runtime? Let me describe my situation.

I've created a class called PropertyGridProxy that implements ICustomTypeDescriptor and can be initialized with any object. At the moment, most things simply pass through to the default TypeDescriptor implementation. However, that's soon to change, as I will be creating some attributes that help me in working with the property grid. This ICustomTypeDescriptor implementation will read those attributes to produce the list of possible values for some of the properties exposed in the grid (instead of just using the default implementation).

Now, I've also created a designer that should (theoretically) wrap PropertyGridProxy for the property grid's consumption. It inherits from System.ComponentModel.Design.ComponentDesigner and overrides the Verbs property, which should return a DesignerVerb collection. I've applied the following attribute to the top of the PropertyGridProxy class:

[Designer(typeof(PropertyGridProxyDesigner))]

This should work according to the (rather useless) documentation I've found so far on MSDN, but it doesn't seem to be picking up the PropertyGridProxyDesigner class. I even had the designer throw an exception in its constructor, but nothing ever came of it. I therefore suspect that it isn't being called at all. Needless to say, the verbs property is never being used. Have I done something wrong?

Oh, the code in the Verbs property is as follows. ActionVerb is a custom attribute class that lets you tack a string name onto a method for calling it from a UI:

<br />
public override DesignerVerbCollection Verbs<br />
        {<br />
            get<br />
            {<br />
                System.Diagnostics.Debug.Write("Verbs collection accessed.");<br />
                DesignerVerbCollection ret = new DesignerVerbCollection();<br />
                PropertyGridProxy pGrid = this.Component as PropertyGridProxy;<br />
                if (pGrid != null)<br />
                {<br />
                    Type t = pGrid.TargetType;<br />
                    foreach (MethodInfo mi in t.GetMethods())<br />
                    {<br />
                        foreach (object o in mi.GetCustomAttributes(true))<br />
                        {<br />
                            ActionVerb attrib = o as ActionVerb;<br />
                            if (attrib != null)<br />
                            {<br />
                                Delegate handler = EventHandler.CreateDelegate(t, this.Component, mi);<br />
                                EventHandler eh = (EventHandler)handler;<br />
                                DesignerVerb verb = new DesignerVerb(attrib.VerbText, eh);<br />
                                ret.Add(verb);<br />
                            }<br />
                        }<br />
                    }<br />
                }<br />
<br />
                return ret;<br />
            }<br />
        }<br />


Thanks,
Will
QuestionNeed Help Creating Pop Up WinForm Pin
ilan_dalal21-Feb-06 11:55
ilan_dalal21-Feb-06 11:55 

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.