I have an Element that Inherits from LightVisualElement. In CreateChildElements I add three controls - StackLayoutPanel, Image and Label - however the Size is always 0 which causes problems in another controller where I try to stack several Elements together.
Why is the Size 0?
When is the Size initialized?
protected override void CreateChildElements() { base.CreateChildElements(); mainPanel = new StackLayoutPanel(); mainPanel.Orientation = System.Windows.Forms.Orientation.Horizontal; checkBox = new LightVisualElement(); checkBox.DrawText = false; checkBox.ImageLayout = System.Windows.Forms.ImageLayout.Center; checkBox.ShouldHandleMouseInput = false; checkBox.NotifyParentOnMouseInput = true; mainPanel.Children.Add(checkBox); label = new RIOLabelElement(); label.TextAlignment = ContentAlignment.TopCenter; label.Font = new System.Drawing.Font("Segoe UI", 8, FontStyle.Italic, GraphicsUnit.Point); label.ShouldHandleMouseInput = false; label.NotifyParentOnMouseInput = true; mainPanel.Children.Add(label); this.Children.Add(mainPanel); }