Questions tagged [flowlayoutpanel]

Represents a winforms container that dynamically lays out its contents horizontally or vertically.

Represents a winforms container that dynamically lays out its contents horizontally or vertically very similar to the Java flowlayout containers.

To add controls, you use the Controls property:

flowLayout1.Controls.Add(ctrl); // add a ctrl to the collection

To adjust spacing between the controls, use the control's Margin property:

ctrl.Margin = new Padding(10);
flowLayout1.Controls.Add(ctrl);

For further information: http://msdn.microsoft.com/en-us/library/system.windows.forms.flowlayoutpanel.aspx

334 questions
4
votes
3 answers

C# change location of controls inside FlowLayoutPanel

I am using flowLayoutPanel to have relative location controls. I would like to change the location of control inside the flowLayoutPanel. when I say location, I dont mean control1 before control2 or something like that - I mean that if I got 2…
Ron
  • 3,975
  • 17
  • 80
  • 130
4
votes
1 answer

Winforms FlowLayoutPanel remove unneeded spaces with autosize controls

I have FlowLayoutPanel with AutoScroll = True FlowDirection = LeftToRight WrapContents = True Added controls dynamically have same Width but AutoSize in Height. So the panel will be like this, which has vertical spaces between items. As the height…
Shady Boshra
  • 2,521
  • 3
  • 23
  • 35
4
votes
2 answers

How to change the property of a control from a flowlayoutpanel?

How to change the property of a control in a flowlayoutpanel assuming that you add the controls programatically and assuming that the name of each controls are the same? For example this image shows you that there are 2 text boxes and two…
Rye
  • 2,273
  • 9
  • 34
  • 43
4
votes
1 answer

Winforms: Scrollable FlowLayoutPanel with thousands of user controls - How to prevent memory leaks and dispose objects the right way?

I am relatively new to windows form programming. I am developing a windows form application which requires user to scroll through the form (I have used a FlowLayoutPanel with AutoScroll=True inside the form). The Panel's source contains an user…
user5922056
4
votes
2 answers

Reduce Flicker of .NET FlowLayoutPanel

I'm clearing and adding multiple LinkLabel's to FlowLayoutPanel, every couple of seconds. It works fine, but flicker is quite noticeable. Is there any way to reduce it? I tried to set Form.DoubleBuffering, it didn't help.
SharpAffair
  • 5,558
  • 13
  • 78
  • 158
4
votes
1 answer

Adding a Control to Beginning of a FlowLayoutPanel

I have a program that grabs product data and adds a custom control for each record to a FlowLayoutPanel. I would like to add a control to the beginning of the FlowLayoutPanel, as opposed to the end, to appear as the first item. Does anyone have an…
Hawkeye
  • 578
  • 8
  • 20
4
votes
1 answer

Flowlayout panel and autosizing child controls doesn't work

I am trying to get a very simple autosizing layout on a winform (C# .NET). I've tried TableLayoutPanels and FlowLayoutPanels but nothing works. I have a usercontrol which is a container for other usercontrols which are created at runtime - I've…
Pete
  • 41
  • 1
  • 2
4
votes
1 answer

FlowLayoutPanel AutoSize height not working

I'm working on a UserControl that consists of a bunch of ComboBoxes arranged horizontally across the top of the control in a flowlayoutpanel, and a datagridview directly below the flowlayoutpanel that takes up all remaining space on the control. I…
echo
  • 7,737
  • 2
  • 35
  • 33
4
votes
2 answers

C# Breakpoint altering behaviour

I'm in a curious situation whereby I've realising if the set breakpoint on my code then it will be triggered, otherwise the method is never called. My question is; how would setting a breakpoint on alter the way C# code would interact with a…
wonea
  • 4,783
  • 17
  • 86
  • 139
4
votes
4 answers

Clearing controls from FlowLayoutPanel not calling destructors?

Sorry if I'm missing something obvious, but I'm trying to clear the controls (a series of user controls) from a FlowLayoutPanel - (panelName).Controls.Clear();. Unfortunately this doesn't seem to be calling the destructors for the objects on the…
eftpotrm
  • 2,241
  • 1
  • 20
  • 24
4
votes
2 answers

How to scroll in flowlayout panel without showing scrollbar in windows form

I am working on a touch screen POS in WinForms. I have a flowlayoutpanel and add buttons dynamically but I dont want to show a scrollbar. I use 2 buttons to scroll instead, so please help me how to scroll without showing a scrollbar
kapil
  • 131
  • 1
  • 2
  • 9
3
votes
1 answer

.NET - UserControl Drag & Drop - Child Controls

I have FlowLayoutPanel and UserControl's on it with drag & drop reordering. This sort of works. But the problem is that child controls prevent dragging of the actual parent UserControl. So my question is how to enable dragging of a UserControl that…
SharpAffair
  • 5,558
  • 13
  • 78
  • 158
3
votes
3 answers

highlight selected item in flowlayoutpanel

how do i highlight the selected item (in my case, a custom user control) in a flowlayoutpanel
leora
  • 188,729
  • 360
  • 878
  • 1,366
3
votes
1 answer

dragging user controls from one flowlayoutpanel to another

how can i add drag and drop capability of a custom usercontrol from 2 flowlayoutpanels? Usercontrol keeps being null on the following line of code below private void flowLayoutPanel1_DragDrop(object sender, DragEventArgs e) { …
leora
  • 188,729
  • 360
  • 878
  • 1,366
3
votes
2 answers

setting anchor for "controls in a panel" inside a "flowlayoutpanel"

In my windows application I have a normal panel inside a flowlayoutpanel In this normal panel, i have some input controls(e.g. labels, textbox...) I have set the anchor properties thinking that it will auto-resize when I resize the window. But when…
huhooh30
  • 45
  • 1
  • 6
1 2
3
22 23