Forum  General Visual ...  How do I...?  Client's Screen Resolution?
Previous Previous
 
Next Next
New Post 1/12/2009 4:44 AM
  jharmon@blinfo.com
853 posts
1st Level Poster




Client's Screen Resolution? 

My application has been optimized for screen resolutions of 1024x768 or higher.  Is there anyway I can let the user know if their current resolution is less than the 1024x768?


Thanks, Joe
 
New Post 1/12/2009 4:11 PM
  palli
14411 posts
1st Level Poster




Re: Client's Screen Resolution? 

Hi Joe,

Well, the javascript code is HERE at least.

Maybe Ori can tell you if and how you could best accomplish running that code on Form's load.

Palli

 


Páll Björnsson - Visual WebGui support team - Email: support@visualwebgui.com
 
New Post 1/13/2009 10:32 AM
  jharmon@blinfo.com
853 posts
1st Level Poster




Re: Client's Screen Resolution? 

Thanks for the idea of using javascript.  For some reason I was thinking that VWG would have some kind of function call to get the client's resolution.  I think I can figure it out from here...


Thanks, Joe
 
New Post 1/14/2009 3:32 AM
  ori.cohen
4401 posts
1st Level Poster




Re: Client's Screen Resolution? 
Modified By ori.cohen  on 1/14/2009 7:32:55 AM)

Hello Joe!

When the MainForm of the application is run at the beginning of the session, we sample the size of the client screen and retreive the size to server-side. The size is saved to the ClientSize property of the Form.

If you need to make sure what the current client-size is at the current time and not originally, you can do the following:
* Run from server-side a server-client invocation using this.InvokeMethodWithId. The first parameter to this method is the name of the JavaScript function you would be calling. The second is and array of arguments you could send to this function.
* In client side you would need to call from your custom JS function code that would get the window size like Palli described.
* Later that function would create a VWG event on client side, attach the new client size values as the event attributes and finally raise the event, sending it to server-side.
* in server-side you would need to be able to catch this new type of event and handle it to use the values sent from client-side.

For details how to implelement the last two steps, view this thread here, and use steps 3 to 5 as a reference.

Regards,

Ori Cohen

Manager of support, the Visual WebGui team

 
New Post 1/14/2009 10:58 AM
  jharmon@blinfo.com
853 posts
1st Level Poster




Re: Client's Screen Resolution? 

Ori,

Thanks for the reply for this is exactly what I did.  However, I did not know about the Form.ClientSize property.  When my app runs it automatically calls the login screen.  I just tested the this.ClientSize.Width and this.ClientSize.Height.  However, it did not respond with what I would expect.  It responded with 1047x753.  My screen resolution is set to 1280x1024.  It looks like it is responding with the current window size and not the client's desktop size. 

Is there another way to call this and get the client's desktop size?


Thanks, Joe
 
Previous Previous
 
Next Next
  Forum  General Visual ...  How do I...?  Client's Screen Resolution?
.NET HTML5 Web, Cloud and Mobile application delivery | Sitemap | Terms of Use | Privacy Statement | Copyright © 2005-2012 Visual WebGui®       Visual WebGui weblog on ASP.NET Gizmox Blog Visual WebGui Group on LinkedIn Visual WebGui updates on Twitter Visual WebGui Page on Facebook Visual WebGui YouTube Channel Visual WebGui Platform News RSS