grid

Changing color of grid in C# (Windows Phone 8)

浪子不回头ぞ 提交于 2019-12-08 19:54:26
I am trying to change background color of grid (with name "colorPlace") in my simple app (when I click on button). I tried (where red, green and blue are bytes): colorPlace.Background = new SolidColorBrush(Color.FromArgb(255, red, green, blue)); and: colorPlace.SetValue(BackgroundProperty, "#FFFFFFFF"); And all I just get is: An exception of type 'System.NullReferenceException' occurred in Project.DLL but was not handled in user code Any ideas how to do it? EDIT: Oh, I just find an solution - all changes in elements (grid, buttons etc.) should be done AFTER InitializeComponent(); line.

How to make a grid inside a button have 100 percent width in WPF?

陌路散爱 提交于 2019-12-08 19:47:36
问题 I have a button on a window that sizes to the window. I have put a grid inside the button with one row and two columns, and put a path in first column, and a textbox in the second. My problem is I can't get the grid to stretch with the button. Here is what is happening: Here is what I want to happen: I have the grids HorizontalAlignment="Stretch", yet it is not stretching. What am I doing wrong here? Here is the code: <Window x:Class="GridInButtonIssue.MainWindow" xmlns="http://schemas

WPF Grid layout panel with row height set to “Auto”

烈酒焚心 提交于 2019-12-08 17:14:18
问题 I'd like to have a Grid with a row on the top and bottom with either labels or buttons in them. In the middle I plan on using a ListBox. I want the ListBox to expand to use all the available space. It would be nice to not hard code the height of the other two rows. My XAML is below. How can I make the middle section expand automatically? Thanks. <UserControl x:Class="WpfApplication1.UserControl1" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas

Applying WPF styles to Child Items

独自空忆成欢 提交于 2019-12-08 16:11:54
问题 Lets say I have a grid, within my grid I have a number of controls. Instead of setting the margin for each of these controls, I wish to create a style to set the margin for ANY control I drop into a grid. Is this possible? I was hoping that the following would work: <Window.Resources> <Style x:Key="DefaultMargins"> <Setter Property="Control.Margin" Value="3, 3, 3, 3"/> <Setter Property="Control.FontSize" Value="50"/> </Style> </Window.Resources> <Grid Style="{StaticResource DefaultMargins}">

Why is this extra space appearing in a Grid?

戏子无情 提交于 2019-12-08 15:58:54
问题 I was looking at this question and discovered something very weird: it appears that the height of a row is incorrectly calculated in some cases involving Grid.RowSpan . Here's an simple drawing of the Grid I'm testing with: --------------- | 1 | | --------| 3 | | 2 | | --------------- | 4 | --------------- And here's some sample code for this Grid that demonstrates the problem: <Grid ShowGridLines="True"> <Grid.ColumnDefinitions> <ColumnDefinition Width="*"/> <ColumnDefinition Width="*"/> <

How to add a grid inside a Scroll viewer programmatically

僤鯓⒐⒋嵵緔 提交于 2019-12-08 15:29:44
问题 My XAML looks like this <navigation:Page x:Class="SilverlightApplication1.Home"> <Grid x:Name="LayoutRoot"> <!-- <ScrollViewer> <Grid> <TextBlock Text="myTextBlock" /> </Grid> </ScrollViewer> --> </Grid> I want to programmatically do the commented part above via code behind. And my code behind looks like this public partial class Home : Page { public Home() { InitializeComponent(); ScrollViewer sv = new ScrollViewer(); Grid grid = new Grid(); TextBlock block = new TextBlock(); block.Text =

Matlab: Problem with ticks when setting minor grid style and two y-axis

╄→尐↘猪︶ㄣ 提交于 2019-12-08 13:02:00
问题 with help of the community in this thread: Minor grid with solid lines & grey-color I got it to work to set minor grid lines as solid and coloured style. But when adding a second y-axes it just messes up the y-ticks on the right axis! heres the example code: x = linspace(0, 10, 11); y1 = x.^3+1; y2 = x+1; y3 = y1./y2+5; % plotte: http://www.mathworks.com/help/techdoc/ref/linespec.html myfig = figure('Position', [500 500 445 356]); %[left, bottom, width, height]: ax1 = axes('Position',[0.13 0

ExtJS 4 - How to disable 'next' & 'last' icons in the paging toolbar when no records present in grid?

我是研究僧i 提交于 2019-12-08 12:13:19
问题 I have a grid with paging toolbar at the bottom and a 'Load' button at the top which can be used to load records in the grid. Thus, initially there are no values present in the grid, but in such condition too the paging toolbar displays Page 1 of 1, and also the icons to go to 'next' or 'last' page are enabled. Due to this, when user clicks any of these icons, then, though the records are not loaded but internally the values of 'page' and 'start' are set as NaN and if then user clicks at

Is it possible to specify 16 colums to bootstrap 3

点点圈 提交于 2019-12-08 12:10:18
问题 I'm a bit confused. I'm tying to adapt the boostrap 3 grid to 16 column. I'm changing these vars in my variable.less: @grid-columns: 16; @gridColumnWidth: 32px; @gridGutterWidth: 30px But still when I inspect my col-lg-12 class, it has a 100% width. 回答1: The number of columns is hard coded into the .less file. @grid-columns is only used to calculate the widths. Bootstrap source code: https://github.com/twbs/bootstrap/blob/master/less/grid.less#L74 Apparently changing the number of columns

AS3 - Create a grid with customizable row and col values based on array length?

吃可爱长大的小学妹 提交于 2019-12-08 11:53:52
问题 I'm working on a Layout plugin to place all items added to the the parent object in a grid formation. I want to be able to set the column, row, padding values. I push all child objects into an array and I loop these with a for loop. I already tried to use a double for loop to check on wich position the objects need to be placed but that always gave me index out of bounds errors. Currently I'm using this code to set up my grid formation: var COLUMNS:int = vars.columns; var PADDING:Number = 10;