.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Adjust application window size per screen resolution on different computers

Posted By:      Posted Date: April 10, 2011    Points: 0   Category :JQuery

I have built an  application which calls two dialog boxes defined in a .rc file.

When this application was run on a computer with a screen resolution of 600 x 800

the dialog boxes were not fully displayed.  How can I automatically adjust for different screen resolutions?

View Complete Post

More Related Resource Links

WPF application crashes on touch screen computers


We have an application that crashes on a touch screen application.  The error is:

value cannot be null. parameter name: owner

it occurs right after our


I searched online and tried the programs and features...turn windows features on and off and disabled the Tablet PC components.

Now our application works.

So it appears the issue is that with touch enabled you have that window that hovers allowing for text input via a stylus or finger.  That windows must cause WPF app's to crash. 

I need the users to be ablet o write (via stylus) into our text boxes.

Any ideas





Setting Screen Resolution



  I am developing a website in asp.net.How can i make my web pages view same in different screen resolutions.I am using 1024*768 resolution

problem in consuming WCF service through Window application


I have a silverlight application and WCF service all made in VS 2010 , i had hosted my site to web server which contain Window 2008 and IIS 7.0

now the problem is i have another application which is a window application developed in VS2008 , when i try to add the service reference it gives me error


The document at the url was not recognized as a known document type.

The error message from each known type may help you fix the problem:

- Report from 'DISCO Document' is 'There was an error downloading 'http://dev_qa.emspa.com/HRDev3/Service.svc?disco'.'.

  - The request failed with HTTP status 400: Bad Request.

- Report from 'WSDL Document' is 'The document format is not recognized (the content type is 'text/html; charset=UTF-8').'.

- Report from '' is 'The document format is not recognized (the content type is 'text/html; charset=UTF-8').'.

- Report from 'XML Schema' is 'The document format is not recognized (the content type is 'text/html; charset=UTF-8').'.

Metadata contains a reference that cannot be resolved: ''.

Content Type application/soap+xml; charset

Detect Browser Screen Size??


Hi Everyone,  I need to detect the size of the user's screen for mobile devices (especially the BlackBerry). I've read a lot of pages that seem to refer me to the Request.Browser object, but I'm finding that this object doesn't have the correct values. For example, I have a BlackBerry and when I use the Request.Browser to get the screen size, it tells me it is 640x480. Well, I know it's not that big since an image of 300px wide just barely fits. Also, when I run on my desktop browser, it also says my screen is 640x480. I can assure you, it is not 640x480! ha!

  How does anyone reliably get the browser's screen size?? Do I have to revert to some kind of JavaScript? If so, where can I read more about it? Will it be any more reliable? Someone must have an idea about this. Thanks in advance!!

Obtain mobile device screen size



I am trying to get the screenHeight and width:


 // Get MobileCapabilities from current Request.Browser
        MobileCapabilities currentCapabilities = (MobileCapabilities)Request.Browser;
        // get a property of the  browser 
        Response.Write(currentCapabilities.ScreenPixelsHeight +  " <br>");
        Response.Write(currentCapabilities.ScreenPixelsWidth  + " <br>");


 but this is always show that the Height is 480 & the width is 640

I am trying on HTC with Opera Mobile 9.5

Any Advice?

Screen Resolution.



I am developing a web site which is targeted for 1280x800 screen resolution.

Right now i developing the site in 1024x768 resolution.

I am using percentages only with respect to width & height.

Please help me in achieving this for 1280x800 resolution.

Thanks is advance.


Lock the window size to uniform in wpf

I have a window that contain a ViewBox. The ViewBox's Streach property is set to Uniform. And I want to set the window size to be uniform! that means the Height And Width properties are relative to each other.

Using Windows 7 my screen resolution changed.

My screen resolution changed to 1280 X 720.The relavent sreen resolution section in windows only now allows me a max of the above.I am using NVIDIA Ge Force 9800GT graphics and ASUS VW220 monitor.Will appreciate any help.Cheers.    

How to get what application is connected to the topmost window?

My VB.NET application is suposed to monitor what application currently is running in the topmost window. I have tried the following approach using a timer: Declare Function GetActiveWindow Lib "user32" () As System.IntPtr Declare Function GetForegroundWindow Lib "user32" () As System.IntPtr Public Declare Auto Function GetWindowText Lib "user32" _ (ByVal hWnd As System.IntPtr, _ ByVal lpString As System.Text.StringBuilder, _ ByVal cch As Integer) As Integer Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick    Dim Caption As New System.Text.StringBuilder(256)    Dim hWnd As IntPtr = GetForegroundWindow()    GetWindowText(hWnd, Caption, Caption.Capacity)    'Caption now holds the title of the topmost window End Sub By this I can see that for example Outlook or Internet Explorer is the topmost window as the name is in Window's title bar. However, if the user crates a new mail in Outlook the title of the window is "Untitled message" givning no hint of what application is running in the the window. How do I get what application is connected to the topmost window?p> Help is appreciated!

current window to full screen

i want to do current browser link to full screen and if it is full screen then back to default screen same as pressing F11 but it should be via javascript.

Saving and restoring WPF Window size and position

I have a WPF window.  I want to do a very common thing:  Save the window size and position on close and restore them on open. I tried a C# approach and a XAML approach. I prefer the XAML but I'l take advise on either.  Here's the XAML I've tried: Title ="PVIEW" ResizeMode="CanMinimize" BorderThickness="0" WindowStartupLocation="CenterScreen" WindowStyle="SingleBorderWindow" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" Loaded="Window_Loaded" Closing="Window_Closing" Closed="Window_Closed" SizeChanged="Window_SizeChanged" Height="{Binding Source={x:Static self:Properties.Settings.Default}, Path=LastWindowHeight, Mode=TwoWay}" Width="{Binding Source={x:Static self:Properties.Settings.Default}, Path=LastWindowWidth, Mode=TwoWay}" Top ="{Binding Source={x:Static self:Properties.Settings.Default}, Path=LastWindowTop, Mode=TwoWay}" Left ="{Binding Source={x:Static self:Properties.Settings.Default}, Path=LastWindowLeft, Mode=TwoWay}"> ... In Settings, I also created four entries, (all doubles) with the same names as the Path names above with all their values set to 0. Then I added this line to Window_Closing:  "Properties . Settings . Default.Save(

size of window on desktop

i have read all the threads related to this but all i am getting is the size of the canvas in the window, i want the size of the window currently showing on desktop please help me out?   thanks

How can I change the WPF window title bar size through Interop services

Hi all,      I want to use my custom title bar in my custom window. In that need a title bar with more height than default widow title bar height. How can I achieve this through window Interop services???? Thanks in Advance.. Suresh.

Disable redirector when Installing 32 bit application on Window 7- 64 bit

When I install my 32 bit apps on Window 7 - 64 bit, it redirects registries and data files.However, the current codes have hardcoded to read the regular location such as:"HKLM\Software\MyApps" and "\Program Files\MyApps"Is there a way that I can disable the director while install my 32 bit application to solve this situation?If yes, can someone please show me how to do so in c#?I found they mention about calling Wow64EnableWow64FsRedirection in Kernel32.dll.Thanks
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend