Stop a Windows Control from getting to Small?

I

iKiLL

Hi All

i am developing a Windows Mobile User Controll and i need to make sure that
it is not sized to small.
i am developing in C# with CF2 for Windows Mobile 5.

How is this done?

i am hoping there is like a Min width and height propertiy.

Thnaks
ink
 
I

iKiLL

Thanks I will give it a try.

i want them to be able to make it bigger. but just not to small.
 
N

Norman Rericha

In that function you will be able to determine the min sizes you want
the forms/controls to be. Then stop resizing from "accepting" if the
new size is below defined constants.

This way the user will be able to make it bigger, but then smaller
after that, until it is less then the starting dimentions.

Hope that helps
 
I

iKiLL

hi Norman,

This is what i have and it dose not seem to work at Design time. Is this
wrong.

protected override void OnResize(EventArgs e)
{
if (base.Width < 219)
{
base.Width = 219;
}
if (base.Height < 93)
{
base.Height = 93;
}
base.OnResize(e);
}

private void QuestionControl_Resize(object sender, EventArgs e)
{
QuestionAnswerControl oControl = (QuestionAnswerControl)sender;
oControl.vScrollBar.Maximum = oControl.pnSlide.Height -
oControl.pnMain.Height;
}


Thanks,
ink
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top