Is it possible to create an irregular grid shape?
I attached a picture which clearly explains my intentions.
You could use ColumnSpan to merge those cells.
If you want them to look as if they're not part of the grid, then set their background color to the window background color.
Related
I am doing a menu like the following in c# for a school small game.
I am using the labels to create this, but how can I do that orange color behind it? The only solution I see, is exporting that text as png and use it as image instead of label. Is there a better way to do it?
You can export that text as a png and use it as an image, or you can style it with a label. But using labels will be very troublesome. First you need to add a label at the appropriate position. Set the label's AutoSize to false so that you can adjust the shape and size of the label arbitrarily. Then adjust the BackColor and ForeColor of the label to orange. Finally, place these labels on the edges of the letters to achieve a 3D effect.
Such as “o”:
So the best option is creating a class to manage this text labels?
Let's say I've a grid and some images which I want to show. What I want to do now is putting the images in a straight row. If they don't fit inside the grids width anymore, they shall be put in the next row. I feel like there has to be a way to do that automatically, like the LayoutManager in Java for example. Any ideas?
You should use wrap- or a stackpanel inside your cell and set some alignments (for example set verticalAlignment to "strech").
http://www.wpf-tutorial.com/panels/introduction-to-wpf-panels/
I know that MSDN states that this is not possible but is there any possible workaround/hack to change the colour of the text on a secondary tile?
The only way to change font color is make text as your background image.
You can do like this:
put textBlock in a grid, change font color.
Render this grid to an image.
then save it to storage.
and set it as background image of tile.
I'm working on a simple application with text animations and videos as background.
It's really similar to a simple LED scrolling text and I'm using the animations framework of WPF for this (Storyboards and timelines).
My text comes from the right side and finishes animation to the left side, thus it is visible for the entire width of the window.
Now, what if I want to display this text only in a specific rectangle of the window? The text would normally come from the right and finish to the left, but should be visible only when passing through this rectangle. Imagine it like a "rectangle hole" in the background where the text is shown.
I hope I have been straightforward in my explanation!
Thank you.
Is it an opacity mask you're after?
http://www.c-sharpcorner.com/uploadfile/dbeniwal321/implementing-opacity-masks-in-wpf/
Obviously you won't be using gradients of opacity as seen in the article - you'll use a more strict rectangle outline and play your animation as usual - using the bounds of the mask as the boundaries of your animation.
Text in a Canvas. Set the size and position of your Canvas to be your rectangle hole. With clipping on, when the text is outside the Canvas, it will not show. You just animate Canvas.Left attached property on your text.
So in winforms, every dropdown combobox has this little arrow thingy to the right that tells the user it's a dropdown, kinda like this:
Now how do I figure out how wide that is in pixels? Reason is, I'm using ControlDrawToBitmap, this doesn't draw the text properly for the combo boxes, and I can redraw the contents, I just whack some of the arrows (which are drawn properly).
First idea that comes to mind: Check to see if the combobox button width tracks with the scrollbar width. The scrollbar width can be modified in user preferences. Use GetSystemMetrics() API to get the width of the various scrollbar pieces. If you change your system scrollbar width and it does not affect the size of a normal combobox, then ignore this.
Second idea: use the edit control's formatting rect to find out what the edit control thinks is the usable display area (minus the combo box). See EM_GETRECT in MSDN.
However, it sounds like this is just a hack workaround for your real problem: If you could get the controls to draw correctly to bitmap, then you wouldn't need this hackery.
I calculated it to be 9 pixels wide in photoshop