473,624 Members | 2,298 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 1267
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***@NotMyEma il.comwrote in message
news:%2******** ********@TK2MSF TNGP03.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.o pennetcf.comwro te in message
news:4C******** *************** ***********@mic rosoft.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***@NotMyEma il.comwrote in message
news:%2******** ********@TK2MSF TNGP03.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(EventA rgs 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)
{
QuestionAnswerC ontrol oControl = (QuestionAnswer Control)sender;
oControl.vScrol lBar.Maximum = oControl.pnSlid e.Height -
oControl.pnMain .Height;
}
Thanks,
ink

"Norman Rericha" <Rayogen@nospam _gmail.comwrote in message
news:mn******** *************** @nospamgmail.co m...
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***@NotMyEma il.comwrote in message
news:%2******** ********@TK2MSF TNGP05.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(EventA rgs 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)
{
QuestionAnswerC ontrol oControl = (QuestionAnswer Control)sender;
oControl.vScrol lBar.Maximum = oControl.pnSlid e.Height -
oControl.pnMain .Height;
}
Thanks,
ink

"Norman Rericha" <Rayogen@nospam _gmail.comwrote in message
news:mn******** *************** @nospamgmail.co m...
>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.co m



Mar 12 '07 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
3164
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 i will get solution this time. Any help would be appreciated. Now we are building dynamic websites. The Operating system that we have is Windows 2000(not Advanced server not Profession), it just says
3
2689
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 property to false. The latter setting makes the control completely disappear. FYI, the form is dialog border style. When set to sizable border style, the control only appears when the form is re-sized much larger. I have a similar form with a...
45
2703
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 been repeated for years and years now. Result: Unfortunately nada. He just doesn't give a shit. He is only very offensive in his answers to these requests. Also he has been 'kill-filed' by many of us. Result: Nada. He did not get enough answers...
2
3993
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 IIS Server of my Workstation (Win XP) with a text box, button and required field validator, this works fine. If I create the same page on the IIS6 Windows 2003 Server the validation control doesn't stop the post. I've tried different browsers and...
5
68071
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 again. this is a headache, how can i overcome this issue (win xp prof), i am willing to write a small .net tool to keep my computer awake if i have to. regards,
7
7221
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 this error. I want to restart my windows service every time the COM object throws an error. I use System.ServiceProcess.ServiceController to stop and start my service. But there is one thing I do not understand:
12
11058
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. Here is a newbie mistake that I found myself doing (as a newbie), and that even a master programmer, the guru of this forum, Jon Skeet, missed! (He knows this I'm sure, but just didn't think this was my problem; LOL, I am needling him) If...
0
9945
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 on my Windows PC? Ans: Other than Sysinternals Autoruns, there are only a few programs which are good enough to be used when dealing with autoruns. For more information about Sysinternals Autoruns, read Que-7 in Windows Autorun FAQs: Description....
0
8242
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8681
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8629
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8341
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7170
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4084
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4183
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2611
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 we have to send another system
1
1793
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.