using Alternet.UI;
public class LevelSettingsWindow : Window
{
public LevelSettingsWindow(Level level)
{
Title = "Level Settings";
IsToolWindow = true;
Resizable = false;
CloseEnabled = false;
MinimizeEnabled = false;
MaximizeEnabled = false;
var outer = AddFrame(1,1);
var inner1 = AddFrame(2,1, "Backgrounds", outer);
foreach (var background in level.Backgrounds)
{
var button = inner1.AddButton(background.Name, () =>
{
level.Sections[(int)level.Section].Background = (uint)level.Backgrounds.IndexOf(background);
});
}
}
public Grid AddFrame(uint columns, uint rows, string name="", Control? parent=null)
{
if (parent == null) parent = this;
if (name != "")
{
parent = parent.AddGroupBox(name);
parent.Dock = DockStyle.Fill;
parent.VerticalAlignment = VerticalAlignment.Fill;
parent.HorizontalAlignment = HorizontalAlignment.Fill;
}
var grid = new Grid();
grid.Dock = DockStyle.Fill;
grid.RowCount = (int)rows;
grid.ColumnCount = (int)columns;
grid.VerticalAlignment = VerticalAlignment.Fill;
grid.HorizontalAlignment = HorizontalAlignment.Fill;
parent.Children.Add(grid);
return grid;
}
}
And I am getting this...
What I was expecting was the group box expanded the the whole window rect and the None and Blocks button to be layed out horizontally like this...
a, b
If you assign Dock property to some value except None, properties VerticalAlignment and HorizontalAlignment are ignored
If you use Grid, you need to set RowIndex, ColumnIndex properties of the child controls, otherwise they will be 0,0 which is
the same as there were no grid. Also you can set RowSpan, ColumnSpan
Do all initialization inside SuspendLayout()/ResumeLayout. It will be faster. Or even inside:
DoInsideLayout(()=>
{
// Layout initialization here
});
In order to proceed with this issue further, I need
I have this code...
And I am getting this...![image](https://github.com/alternetsoft/AlternetUI/assets/2453707/39760a63-0b8b-4386-b4d9-d11acb6f0ad6)
What I was expecting was the group box expanded the the whole window rect and the
None
andBlocks
button to be layed out horizontally like this...a, b