Buttons
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.
SIGN IN To post a reply.
7 Replies
AD
Administrator
Syncfusion Team
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
EM
Eddie Molieri
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
AD
Administrator
Syncfusion Team
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?
EM
Eddie Molieri
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?
AD
Administrator
Syncfusion Team
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
EM
Eddie Molieri
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
>
>
AD
Administrator
Syncfusion Team
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.
SIGN IN To post a reply.
- 7 Replies
- 2 Participants
-
EM Eddie Molieri
- Jul 21, 2004 04:36 PM UTC
- Jul 21, 2004 06:32 PM UTC