0

I have to develop an .NET app using C# that runs on all screen size(8", 10, 14, 22, etc). So whatever is the screen size, the app should work & dispaly properly.

How should I start up with this ? With this in mind I believe using WPF would be the best rather than WinForms (Pls correct if I am wrong). I can give weight to each component & text size and handle that but what about the actual window size. That height & width I can't define a number (like 300*250) or so. Window size shoula also be based on the screen size.

Can anyone help me know how do I work out with this. WPF or WinFroms ?

Tvd
  • 4,463
  • 18
  • 79
  • 125

1 Answers1

2

Use relative size/location instead of absolute (example -> Use Grid.RowDefinition = */Auto, instead of fixed size, Use stackpanel, use dock panel)

Automatic layout overview

Resolution independent or monitor size independent WPF apps

Same question on MSDN with links in answer

Metro Apps are supposed to run on different form factors. You can look at Guidelines for the different form factors on metro UI. It will help in understanding the challenges, and how to plan/resolve these challenges.

Community
  • 1
  • 1
Tilak
  • 30,108
  • 19
  • 83
  • 131
  • If I want to deisgn something like Metro UI, intially 6 grids (buttons) (MAIN UI), on clicking 1 btn screen 1 comes up, then again Main UI, again on clicking other btn, other screen comes up & again Main UI. How can this be designed using WPF ? – Tvd May 17 '12 at 07:35
  • this can be achieved using NavigationWindow and creating different pages. One Master page with grid, other detail page. – Tilak May 17 '12 at 07:36
  • In Window tag, have assigned MinWidth & MinHeight as 300, Height & Width as Auto. Have added a Grid with 2 cols & 3 rows ColumnDefinition Width="*" & RowDefinition Height="*". And finally added 4 btns - . I want to give the dpi value or so for btns which will make it bigger in size. How do I give that ? – Tvd May 17 '12 at 08:14
  • dpi is a system level setting. Go through [Resolution independence](http://techbus.safaribooksonline.com/book/programming/microsoft-wpf/9781430272052/introducing-wpf/resolution_independence#X2ludGVybmFsX0ZsYXNoUmVhZGVyP3htbGlkPTk3ODE0MzAyNzIwNTIvNw==) section of Pro WPF in c# 4.0. It explains dpi, how WPF handles them, and how to change in Win 7/xp – Tilak May 17 '12 at 08:22
  • I want to use TabControl. Does that also support resolution like Grid, StackPanel, DockPanel, etc ? Or any other way to implement the same. – Tvd May 17 '12 at 08:24
  • WPF uses vector graphics (except images/videos) thus it should be possible with all the controls. I have not used TabControl, but there must be some way. Note that by changing the DPI/resolution, size of app will surely change. What you need is to take care of layout. – Tilak May 17 '12 at 08:27