473,500 Members | 1,605 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1258
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
3157
by: Niel | last post by:
Hello friends, I think this issue has been posted before but i have not been able to get any solution that is why i am posting it again in detail as to what exactly is happneing in my case. Hope...
3
2681
by: Bryan Capps | last post by:
I have a text box control on a form, the value of which is calculated (concatenated) from entries on a subform. Accordingly, I've set the control's locked property to true and the tab stop...
45
2635
by: StopThisAdvertising | last post by:
Hi there, We all know Steve Santos. He *really* is an advertising and job-hunting machine. A lot of us have asked him *many* times and in different ways to stop his blatant advertising. This has...
2
3977
by: Martyn Fewtrell | last post by:
Dear All I have a Windows 2003 Server with IIS6 where the validation controls on ASP.Net pages no longer work. I believe it to be specific to the server as if I create an ASP.Net page on the...
5
68058
by: Amueerie | last post by:
is there a way to stop windows from going to sleep? i tried to check if there is a setting for this, but no. during presentations or discussions, my computer goes to sleep & then i have to login...
7
7210
by: shai | last post by:
I am working at .net 1.1, writing in c#. I have windows service with a COM object. Every unexpected time The COM object throw an error that make my service get stuck (do not respond). I can catch...
12
11004
by: raylopez99 | last post by:
Keywords: scope resolution, passing classes between parent and child forms, parameter constructor method, normal constructor, default constructor, forward reference, sharing classes between forms....
0
9929
AmberJain
by: AmberJain | last post by:
Windows Autorun FAQs: Programs dealing with autoruns Linked from the Original article- "Windows Autorun FAQs: Description". Que: Can you list programs that help me to view/modify the autoruns...
0
7136
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7182
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7232
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6906
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5490
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4923
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
1430
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
672
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
316
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.