473,545 Members | 1,769 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to put a clickable button on a PropertyGrid ?

I'm using the PropertyGrid control, and I want it to show a button.
But I set the PropertyGrid.Se lectedObject with a object that as a Button
property, the PropertyGrid shows the buttons properties, and I want the
button to be shown as drawn and clickable button.

How can I do that?

--
Thanks
Sharon
Sep 20 '06 #1
5 15310
IIRC, you can just do grid.Controls.A dd(); [and be sure to bring your
control to the front afterwards]

Note that PropertyGrid.Co ntrols doesn't show in the list, but it works just
fine. A better approach, however, may be to add a "tab"; these (bizarrely)
display as buttons; they are implemented differently, but give you more
control - simply inherit from PropertyTab and implement the necessary
methods (such as GetProperties if you want to filter the list).

Just type "PropertyTa b Class" into MSDN2 (making sure you get
System.Windows. Forms.Design in 2.0) and you get a nice example. Note also
that the first tab seems to be always hidden, so you may need to add another
clone of PropertiesTab if you want to be able to swith back ;-p [just
subclass PropertiesTab and don't change anything (maybe the image) to
achieve this]

Marc
Sep 20 '06 #2
Thanks a lot for your help.
But I'm afraid that I did not explain my self as I should have.

When I implemented your suggestion, I got a button on the PropertyGrid frame
part on top, but I need the button to be shown on one of the cells at the
right column of the PropertyGrid.
I need the button to be shown instead of the value cell. The user should see
a clickable button that he'll be able to click on to perform some kind of
operation.

There may be some more buttons to be shown on another PropertyGrid cells.

Can you help me with that?
--------
Thanks
Sharon
Sep 20 '06 #3
Oh, that!

You need to implement a UITypeEditor, which can provide either a popup or a
drop-down (both drawing whatever you want). If fixed drop-down (text) lists
and text editing / parsing are what you want, then you also need to look at
TypeConverter.

See MSDN: http://msdn2.microsoft.com/en-us/library/ms171840.aspx

(note that although you can support painting a preview in the grid, you
can't really put a button there until the user selects the drop-down; think
of the Dock /Anchor propertes for forms and you'll get the picture).

Note that this aspect of the component model can take some time to
understand, but it is very powerful.

Marc
Sep 20 '06 #4
Note the example I cited uses the drop-down approach; actually, the pop-up
(form) approach can be easier... google will be your friend here... you are
looking for UITypeEditorEdi tStyle.Modal - perhaps:
http://www.awprofessional.com/articl...&seqNum=5&rl=1

Note also that there are base-classes like the collections-editor that you
can extend through inheritance.

Marc
Sep 20 '06 #5
Hello Sharon,

with the Microsoft PropertyGrid, there will be no way to have a button
that fills all the value cell space. If you want to look into
commercial product, this is something that Smart PropertyGrid.Ne t can
do by creating a custom inplace control. You can have a look at
http://www.visualhint.com

Best regards,

Nicolas Cadilhac
VisualHint - Home of Smart PropertyGrid.Ne t

Sharon wrote:
Thanks a lot for your help.
But I'm afraid that I did not explain my self as I should have.

When I implemented your suggestion, I got a button on the PropertyGrid frame
part on top, but I need the button to be shown on one of the cells at the
right column of the PropertyGrid.
I need the button to be shown instead of the value cell. The user should see
a clickable button that he'll be able to click on to perform some kind of
operation.

There may be some more buttons to be shown on another PropertyGrid cells.

Can you help me with that?
--------
Thanks
Sharon
Sep 21 '06 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
2901
by: Matt | last post by:
I want to understand the difference between submit button and regular button: <input type="submit"> and <input type="button">. My understanding is that submit button will send the entire HTML form to the web server, but regular button won't. I have a problem that needs to pass HTML elements data back and forth in several ASP pages. I am...
1
4005
by: Roedy Green | last post by:
..button /* clickable button */ { background-color : #f1f391; color : #7b3e00; border : 3px outset #d2d2d2; margin : 0px 2px 0px 2px; font-family :Arial,Helvetica,sans-serif; font-size : 120%; padding : 0px 6px 0px 6px; }
3
7306
by: Nicolas | last post by:
I want to display in my application a PropertyGrid showing only the "Appearance" of a control (ie. textBox) so the user can change it. Bare with me, I'm new in csharp. Where do I go from: this.PropertyGrid1.SelectedObject = this.Textbox1; Thank a lot
2
3960
by: Mevar81 | last post by:
Hi to everybody.I have a problem with the PropertyGrid control.I want to display not all the properties of a generic Control(Button,TextBox,ComboBox,ecc.).In general I don't want to display only one category(Appearance, Behavior,ecc.) but I want to chose directly which properties to show.I've read that I can use the SelectedObjects to put an...
3
2683
by: Pol Bawin | last post by:
Hi All, One : I have a property that get/set a array of an abstract class A By default my array is null In the propertygrid, It is not works correctly when my array is null. (when my array is initialized with one element it works fine) But I can not change the initial state of the array. It must be null. what must I change.
1
473
by: Sharon | last post by:
I'm using the PropertyGrid control, and I want it to show a button. But I set the PropertyGrid.SelectedObject with a object that as a Button property, the PropertyGrid shows the buttons properties, and I want the button to be shown as drawn and clickable button. How can I do that? -- Thanks Sharon
3
5552
by: crazychrisy54 | last post by:
Hi there I just wondered if there is any way using GD to insert a clickable button or some clickable text into a image? It is possible to create images for buttons but what if you want a clickable button *inside* another image. I don't know if this is along the right lines but the following code puts a image inside another image. Perhaps...
3
5776
by: zb42 | last post by:
I have a _mc that I've added to the stage. On it's layers first frame I have this code that spins the _mc around and has some great effects: import fl.transitions.*; import fl.transitions.easing.*; TransitionManager.start(img4_mc, {type:Zoom, direction:0, duration:3, easing: Bounce.easeOut}); TransitionManager.start(img4_mc,...
1
3052
by: Alkdarf | last post by:
I monitor door cameras with a third party application that gives me multiple video windows for the various video inputs in the card. I want to create an application that will overlay the video windows so that each video window becomes a button I can click on to trigger some events (lock release for example). I've managed to get...
0
7653
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7803
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
7749
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5322
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
4942
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3444
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3439
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1012
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
695
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.