470,594 Members | 1,131 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,594 developers. It's quick & easy.

Stop a Windows Control from getting to Small?

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
Mar 9 '07 #1
5 1164
Override the OnResize event handler in your control and set the min/max
width & height there.

--
Neil Cowburn
Principal Partner
OpenNETCF Consulting, LLC.

Managed Code in the Embedded World

http://www.opennetcf.com/
http://www.smartdeviceframework.com/
"iKiLL" <iK***@NotMyEmail.comwrote in message
news:%2****************@TK2MSFTNGP03.phx.gbl...
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
Mar 9 '07 #2
Thanks I will give it a try.

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


"Neil Cowburn" <ne***@nospam.opennetcf.comwrote in message
news:4C**********************************@microsof t.com...
Override the OnResize event handler in your control and set the min/max
width & height there.

--
Neil Cowburn
Principal Partner
OpenNETCF Consulting, LLC.

Managed Code in the Embedded World

http://www.opennetcf.com/
http://www.smartdeviceframework.com/
"iKiLL" <iK***@NotMyEmail.comwrote in message
news:%2****************@TK2MSFTNGP03.phx.gbl...
>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

Mar 9 '07 #3
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

--
Norman Rericha
Sr. Software Architect
Embedded Systems
4Techwork.com
Mar 9 '07 #4
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

"Norman Rericha" <Rayogen@nospam_gmail.comwrote in message
news:mn***********************@nospamgmail.com...
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

--
Norman Rericha
Sr. Software Architect
Embedded Systems
4Techwork.com


Mar 12 '07 #5
never mind it is working just needed a full rebuild

"iKiLL" <iK***@NotMyEmail.comwrote in message
news:%2****************@TK2MSFTNGP05.phx.gbl...
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

"Norman Rericha" <Rayogen@nospam_gmail.comwrote in message
news:mn***********************@nospamgmail.com...
>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

--
Norman Rericha
Sr. Software Architect
Embedded Systems
4Techwork.com



Mar 12 '07 #6

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

45 posts views Thread by StopThisAdvertising | last post: by
2 posts views Thread by Martyn Fewtrell | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.