473,505 Members | 13,823 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

how create Orientation-Awareness window mobile application?

22 New Member
I am struggling to develop screen orientation awareness application. to solve
this problem a have create two function portrait() and landscape() both function set the size and location of control when form re size i call this function on form resize event.
problem is taht when form is resize then it call the function more then one time.
and take more time to execute.
what is reason behind this behavior i don't know.
please help me.
below some code which i am using
Expand|Select|Wrap|Line Numbers
  1.  public void portrait()
  2.         {
  3.             pnlmenu.Size = new Size((frrm.ClientRectangle.Width * 88 / 100), (frrm.ClientRectangle.Height * 27 / 100));
  4.         }
  5.         public void landscap()
  6.         {
  7.             pnlmenu.Size = new Size((frrm.ClientRectangle.Width * 88 / 100), (frrm.ClientRectangle.Height * 27 / 100));
  8.  
  9.  
  10.         }
  11.         private void Form_Resize(object sender, EventArgs e)
  12.         {
  13.  if (Screen.PrimaryScreen.Bounds.Height > 
  14.         Screen.PrimaryScreen.Bounds.Width) Portrait();
  15.     else Landscape();
  16.  
  17.  
  18.  
  19.         }
  20.  
please help me why this function called one then more time at atime when function is resized.
Oct 10 '09 #1
3 1799
Plater
7,872 Recognized Expert Expert
Changing the Size property of a form triggers the ReSize event.
Oct 12 '09 #2
markmcgookin
648 Recognized Expert Contributor
I always used a 3rd party OAC controls like this:

http://www1.orientationaware.net/downloads.html as they offer a free community edition and give you visual studio designers for both orientations.... saves time in the long run
Oct 12 '09 #3
Rishabh Indianic
22 New Member
It still work same and call the function more time when form is resized.
what is reason behind this behavior i can not understand.
if any one has solution then please help me.
Oct 14 '09 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

1
3744
by: TABOUT | last post by:
Hello, The code which I have attached below properly has the margins working in Portrait mode. The margin is contained in an object called settings. The behavior is that the top and bottom...
1
2589
by: Az Tech | last post by:
Hi people, (Sorry for the somewhat long post). I request some of the people on this group who have good experience using object-orientation in the field, to please give some good ideas for...
6
20932
by: Andrew Thompson | last post by:
Is there a way to achieve (or a good reason not to) the 'vertical text' effect displayed here in the planetary labels.. http://www.physci.org/test/graph/imgresize.html The page uses <br> to...
4
7287
by: tvmaly | last post by:
Does anyone know if it is possible to determine if an image is horizontal/vertical and color or black & white using the python image library? I have been searching this news group and the...
5
9411
by: Robert Schuldenfrei | last post by:
Hi Again, Forgive me for posting this again, but old items seem to get little review. I thought I could adjust the viewer properties without any further aid from the NG, but I was wrong. When...
0
2546
by: Joeyej | last post by:
Hi - I'm trying to move/use a web form (containing some javascript field checks) previously hosted on a Windows 2000 server. However, the FORM METHOD="post..." command in the form (shown below)...
2
7179
by: Sachin D. | last post by:
Hi all! Desperately need a solution for this. I have a multiple page orientation print job; My first page is landscape and next 4 pages are portrait. I am using PrintDocument and...
1
9526
by: Rich | last post by:
Hello, I found some code for printing a report (.rdlc) file without using the ReportViewer control. This code prints in the Portrait orientation which I presume is the default orientation. I...
0
1510
by: brett | last post by:
Hi, I need to build a pdf report by using Crystal report which including several subreport. The problem is that the primary page orientation is portrait and some subreports' orientation is...
4
6787
by: J360 | last post by:
Access 2003. I've set the report orientation to landscape using VB. The report that pops up is in Portrait view, but page orientation is correctly set to Landscape and it prints in landscape...
0
7098
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7298
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
7366
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...
0
7471
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5610
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,...
0
3187
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...
0
1526
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
754
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
406
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.