Make windows app fit to screen size instead of static size - windows-8.1

I'm working on a windows app in order to learn how to make them in general, and one issue I'm continuously having is the fact that when I go test it, the controls only take up a portion of the screen because they are sized to fit a smaller screen. How can I make them fit for all screens? If I need to provide screenshots to illustrate this point I can.. using forms this was accomplished via docking, but the apps don't seem to have that same capability.

I assume that by "windows app" you mean a Windows Runtime app, probably in Xaml.
You can get dock-like behavior by using the VerticalAlignment and HorizontalAlignment properties on your FrameworkElement (including Controls). This allows forcing the control to the left, right, top, bottom, or stretching to fill the area it is in.
Combine this with flexible layout controls such as Grids. A top level Grid will fill the screen and can contain rows and columns with relative sizes. This allows the page layout to shrink or grow to cover a fairly wide range of sizes with a single layout.
For larger changes (such as switching between portrait and landscape aspect ratios, or to support a skinny snapped window) you can use VisualStates to either move the controls or to switch between different sets of controls. If the controls are data bound then either set will work automatically with the underlying data.
MSDN has some good documentation on these concepts at Guidelines for supporting multiple screen sizes and Quickstart: Designing apps for different window sizes

Related

Godot images scaling differently

As I started developing a system to place down things such as workbenches for my game, the images of these items started to exceeded the usual 48x48. I centre them inside a panel node(64x64), that also acts as a inventory slot. I created a margin container and turned on the expand property of the texture rect node so these images always fill the panel. The weird part starts here, these images that are bigger than 48x48 are scaling slightly different for every slot I place them. Is there a way to stop this and make them at least look the same?
Enable "Use Gpu Pixel Snap". You will find it in Project Settings under Rendering -> 2D -> Snapping. It is off by default.

UWP - Secondary tile sizes

I'm working on a new W10 UWP app, and ran into a small issue.
I'm generating tiles with a separate Tile service - it creates secondary tiles, and updates them when required (and also updates the primary tile).
However, for some reason, even though the Wide and Medium templates are used, the sizes the tile offers when right-clicked are just "Small", and "Medium".
I found no reference on how to enable Wide and Large tile options. Does anyone know?
Okay, so the solution is simple...
It's not enough to add the Live Tile templates, you have to manually specify the sizes by adding the proper graphics Uris to the SecondaryTile instance. So if you want a wide tile to be available, assign a value to
tile.VisualElements.Wide310x150Logo
and so on, before calling
await tile.RequestCreateAsync()

Tables in SSRS not aligning

I have a some tables displaying side by side. But I am having great difficulty in aligning them in the rendered view. When I export it, it looks different again!
Are there any easier ways to aligning them correctly apart from some extreme trial and error?
The best way to control layout in Reporting Services is with Rectangles.
In your example, you can try moving your tables into a Rectangle object.
This affects report rendering, as the the report will render the objects within the Rectangle first relative to each other, then render and place other objects relative to the Rectangle, i.e. ignoring the objects within the Rectangle and treating them as one whole.
Every different export medium has its own challenges so it's no surprise that Reporting Services will sometimes give different results for the same report in different media; this method just reduces the decisions made when rendering.
I used the properties window and set the location height attributes of each object that I wanted to align vertically.

Newb: WPF custom graphic control - where to start

Apologies if there is a thread for this already, I couldn't find one that I could get my teeth into.
Anyway, I'm new to WPF and want to create a custom control that will be a sort of graphic control. The graphic will always consist of a circle, containing a matrix of several squares (from several hundred to several thousand actually) The squares need to respond to mouse click and mouse over events (and ideally be possible to navigate/select via keyboard.) Each square will represent an object I've coded.
In the past I've used a grid control to display the coloured squares (with VCL in CBuilder) but I would like to make a graphical version. (Actually, another question I'd like to ask is, is there a WPF grid control where I can set the colours of individual cells?)
The question is, where to start? Do I start with a canvas and draw on it? Do I derive from an existing object? I'm just a little lacking on ideas on implementation so any pointers or advice you can offer will be greatly received.
BBz
First off I would suggest getting a decent handle on WPF and how it approaches the problem set. It is vastly different from previous .NET Desktop technologies such as WinForms. Once you have a decent understanding in regards to the separation of logic from UI and how WPF approaches the problem then you can dive in and begin making the right decisions based upon what you encounter.
The problem you mention can be solved in multiple ways. In regards to your question about making use of a Grid, that could be done as that is a layout type. It is vastly superior to the Canvas in terms of arranging your visual structure. The defined rows/columns are nothing more then containers which can hold varying UI objects. Therefore pushing a Rectangle into the Grid and coloring as desired would give you the effect you are looking for. This Rectangle could then become a custom control which would allow you to define varying properties on, as well as specific triggers for mouse overs, etc...
At a higher level you will want to encapsulate this logic as a UserControl which will also hold your custom control. Perhaps the UserControl contains the Grid which will make use of your custom control.
Hopefully this gives you some ideas around how to get started, however getting a better understanding of WPF will help you immensely in achieving your goal.

Really Basic Graphics in C# 2.0 Tutorials

I work for a ticketing agency and we print out tickets on our own ticket printer. I have been straight coding the ticket designs and storing the templates in a database. If we need a new field adding to a ticket I manually add it and use the arcane co-ordinate system to estimate where the fields should go and how much the other fields need to move by to accomodate new info.
We always planned to make this system automate with a simple (I stress the word simple) graphical editor. Basically we don't forsee tickets changing radically in shape any time soon, we have one size of ticket and the ticket printer firmware is super simple because it's more of an industrial machine, it has about 10 fonts and some really basic sizing interactions.
I need to make this editor display a rectangle of the dimensions by pixel of the tickets (can even be actual size) and have a resizable grid which can toggle between superimposition and invisibility on top of the ticket rectangle and represented by dots rather than lines.
Then I want to be able to represent fields by drawing rectangles filled with the letter "x" that show the maximum size of the field (to prevent overlaps). These fields should be selectable, draggable and droppable in a snap to grid fashion.
I've worked out the maths of it but I have no idea how to draw rectangles and then draw grids in layers and then put further rectangles full of 'x'es on top of those. I also don't really know much about changing drawn positions in accordance with mouse events. It's simply not something I've ever had to do.
All the tutorials I've seen so far presume that you already know a lot about using the draw objects and are seeking to extend a basic knowledge of these things. I just need pointing in the direction of a good tutorial in manipulating floating objects in a picturebox in the first place.
Any ideas?
For those of you in need of a guide to this unusual (at least those of us with a BIS background) field I would heartily endorse:
https://web.archive.org/web/20141230145656/http://bobpowell.net/faqmain.aspx
I am now happily drawing graphical interfaces and getting them to respond to control inputs with not too much hassle.

Resources