We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Buttons

Thread ID:

Created:

Updated:

Platform:

Replies:

16667 Jul 21,2004 04:36 PM UTC Jul 21,2004 06:32 PM UTC Windows Forms 7
loading
Tags: GridControl
Eddie Molieri
Asked On July 21, 2004 04:36 PM UTC

How do we create buttons that appear as images in cells? I''m trying to set an image to a button and then set the button to a cell. Thanks in advance.

Administrator [Syncfusion]
Replied On July 21, 2004 04:51 PM UTC

Take a look at the Grid\Samples\In Depth\CellButtons sample. It has an ellipsis celltype that shows a bitmap button. There is a common namespace problem when users try to use this celltype. Here is a forum thread with the point to look out for. http://www.syncfusion.com/Support/Forums/message.aspx?MessageID=15521

Eddie Molieri
Replied On July 21, 2004 05:31 PM UTC

This is the image that I would like to display on the button; I tried changing string bitmapName = "Browse.bmp"; to string bitmapName = "Submit.bmp";. It doesn''t display the image though... >Take a look at the Grid\Samples\In Depth\CellButtons sample. It has an ellipsis celltype that shows a bitmap button. > >There is a common namespace problem when users try to use this celltype. Here is a forum thread with the point to look out for. >http://www.syncfusion.com/Support/Forums/message.aspx?MessageID=15521 Submit_8168.zip

Administrator [Syncfusion]
Replied On July 21, 2004 05:51 PM UTC

Did you include Submit.bmp as embedded resource in your project like the browse.bmp was inlcuded in the sample project?

Eddie Molieri
Replied On July 21, 2004 05:53 PM UTC

yes I did. >Did you include Submit.bmp as embedded resource in your project like the browse.bmp was inlcuded in the sample project?

Administrator [Syncfusion]
Replied On July 21, 2004 06:13 PM UTC

That is all I had to do to get your bitmap to show up, change the file name and include teh file as an embedded resource. But your bitmap is a lot bigger than the bitmap you are replacing, so to fully see it, you also have to adjust the button sizes in the code. Here is the sample. CS_9698.zip

Eddie Molieri
Replied On July 21, 2004 06:20 PM UTC

is there a way to change the color of the button? >That is all I had to do to get your bitmap to show up, change the file name and include teh file as an embedded resource. But your bitmap is a lot bigger than the bitmap you are replacing, so to fully see it, you also have to adjust the button sizes in the code. Here is the sample. > >CS_9698.zip > >

Administrator [Syncfusion]
Replied On July 21, 2004 06:32 PM UTC

There is no property that does this. The EllipsisCellButton.Draw method calls DrawButton to actually draw the button. This method calls ControlPaint.DrawButton to do the button drawing and this FrmaeWork class does not have any color options. So, if you want ot have a different color, in the EllipsisCellButton.Draw method, instead of calling DrawButton to draw things, you would have to draw the button yourself using the colors you want. Another option would be to have the bitmap reflect the color your want to see and size the button to be exactly the size of the bitmap.

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;