CF2.0 Image Button SizeMode Help

I have created Cf2.0 ImageButton based on other postings. It is working fine. But I am unable to create SizeMode property like the PictureBox has. Can some one help me on this?

I have image size of 16 x 16. But I want to have imagebutton of 32 x 32. When i place this image on this button I do see the extra places are empty. Image is not filling the whole box. How do I achive that? One way is recreating the image with 32 x 32.

What is the way to add stretch property to imagebutton?

Thanks,

[521 byte] By [VijayVeera] at [2007-12-24]
# 1

Something similar to this:

public enum ButtonSizeMode
{
Small,
Big
}

public class ImageButton : Button
{
private ButtonSizeMode sizeModeValue = ButtonSizeMode.Small;
public ButtonSizeMode SizeMode
{
get
{
return sizeModeValue;
}
set
{
if (value != sizeModeValue)
{
sizeModeValue = value;
this.Invalidate();
}
}
}

protected override void OnPaint(PaintEventArgs p)
{
// render your large or small image here based on the value of
// sizeModeValue
}
}

timg_msft at 2007-8-31 > top of Msdn Tech,Smart Device Development,.NET Compact Framework...