flowlayoutpanel

Groupbox with a flowlayout panel inside and autosize = true shrinks like it is empty

时光毁灭记忆、已成空白 提交于 2019-12-10 02:19:13
问题 I have a groupbox that holds a flowlayout panel and the flowlayout panel holds a bunch of controls. I set the flowlayout panel to dock with the parent. Since I don't know how many controls will be in the panel, I set the group box autosize to true and autosizemode to grow and shrink. When I do this the groupbox shrinks as if it is empty. I need the caption so I can't remove the groupbox. Anyone know why this is happening? 回答1: There's nothing that stops the FlowLayoutPanel from shrinking to

FlowLayoutPanel AutoSize height not working

廉价感情. 提交于 2019-12-07 12:53:43
问题 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 need to be able to hide all the dropdowns easily, so I have a SplitContainer with Orientation == Horizontal, with the flowlayoutpanel in SplitContainer.Panel1, and the datagridview in SplitContainer.Panel2. The control hierarchy is as follows:

Select UserControl from FlowLayoutPanel

北城以北 提交于 2019-12-06 03:40:39
I have set up UserControls in a FlowPanelLayout with the help in this question: For Each DataTable Add UserControl to FlowLayoutPanel I am now trying to implement a click event which allows me to put a border around the UserControl that has been selected. I have done this: private void User_Load(object sender, EventArgs e) { flowlayoutpanelUsers.HorizontalScroll.Visible = false; // Load and Sort Users DataTable DataTable datatableUsers = UserMethods.GetUsers().Tables["Users"]; datatableUsers.DefaultView.Sort = "Name"; DataView dataviewUsers = datatableUsers.DefaultView; // Loop Through Rows

Groupbox with a flowlayout panel inside and autosize = true shrinks like it is empty

微笑、不失礼 提交于 2019-12-05 01:02:06
I have a groupbox that holds a flowlayout panel and the flowlayout panel holds a bunch of controls. I set the flowlayout panel to dock with the parent. Since I don't know how many controls will be in the panel, I set the group box autosize to true and autosizemode to grow and shrink. When I do this the groupbox shrinks as if it is empty. I need the caption so I can't remove the groupbox. Anyone know why this is happening? There's nothing that stops the FlowLayoutPanel from shrinking to nothing. You'll at least have to set its AutoSize property to True as well. I was trying to do the same thing

Populating a FlowLayoutPanel with a large number of controls and painting thumbnails on demand

随声附和 提交于 2019-12-04 22:24:45
问题 I'm trying to make an ImageListBox kind of control that will display a large numbers of thumbnails, like the one that Picasa uses. This is my design: I have a FlowLayoutPanel that is populated with a lot of UserControl objects, for example 4,000. Each UserControl is assigned a delegate for the Paint event. When the Paint event is called, it checks a memory cache for the thumbnail and if the image is not in cache, it retrieves it from the disk. I have two problems that I'm trying to solve: It

Clearing controls from FlowLayoutPanel not calling destructors?

落爺英雄遲暮 提交于 2019-12-04 09:08:49
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 panel - the User Objects column in the task manager just keeps going up and up, until it hits 10,000 and throws an excecption. Does anyone know what I'm missing here? Not a solution, but a workaround - the objects do seem to be destroyed by this (rough, from memory) code: while(FlowLayoutPanel.Controls.Count > 0) FlowLayoutPanel.Controls.Remove(0);

FlowLayoutPanel - Automatic Width for controls?

对着背影说爱祢 提交于 2019-12-03 22:03:12
is it possible to make the inserted items in FlowLayoutPanel automatic size of the FlowLayoutPanel? Here is an example: A form with 1 FlowLayoutPanel and 3 buttons inside: if I resize the form, the controls look like this: they arrange "left to right" What I want is this: The controls should have the width of the FlowLayoutPanel: Any Ideas how to do this? I changed the FlowDirection and played with the Anchor property but with no luck. I could of course Resize the controls in the FlowLayoutPanel_Resize event, but I want to add about 500 usercontrols - I tested it and it is slow. I suggest you

c# How to create buttons and delete them later by an ID

有些话、适合烂在心里 提交于 2019-12-02 10:09:55
问题 I'm struggling to create this script where it generates friend requests. I need to specifically add an id to each button and label so I can remove it when the user clicks either the accept or reject button. Button reqAccept; Button reqReject; Label reqUserName; private void loadFriendRequests() { using (SqlConnection connection = new SqlConnection(con)) { using (SqlCommand cmd = new SqlCommand("Select UserFirstName, UserLastName, FriendEmail From PendingRequests Where FriendEmail = @fe",

c# How to create buttons and delete them later by an ID

江枫思渺然 提交于 2019-12-02 04:23:52
I'm struggling to create this script where it generates friend requests. I need to specifically add an id to each button and label so I can remove it when the user clicks either the accept or reject button. Button reqAccept; Button reqReject; Label reqUserName; private void loadFriendRequests() { using (SqlConnection connection = new SqlConnection(con)) { using (SqlCommand cmd = new SqlCommand("Select UserFirstName, UserLastName, FriendEmail From PendingRequests Where FriendEmail = @fe", connection)) { connection.Open(); cmd.Parameters.AddWithValue("@fe", Properties.Settings.Default.Email);