+ 1
Cloning <User Control-Windows form>
Is there <user control-windows form> a need to do that when you pressed the button it was cloned and that the cloned form went down to the required distance down?
6 Antworten
+ 1
That is really difficult in winform and easy in WPF.
Create a usercontrol.
Add this control dynamically to the form using the information in the link below
https://stackoverflow.com/questions/58674619/how-to-create-dynamically-c-sharp-panels
+ 2
Can you explain this in a other way, I have no idea what you want to achieve ?
+ 2
sneeze I still do not know, since there is no way to check, there will be an opportunity to check, thank you)
+ 1
sneeze It is required that when you click on the "+" button another such User Control forms appear, and the button "+" is moved down, under the new User Control.
Here is the screen https://prntscr.com/qpyolo
+ 1
sneeze Here are these codes to insert into button_click event:
int x = 0;
int y = 0;
for ( int i = 0; i < contacts.Count; i++ ) {
{
var control = new PersonControl(contacts[i]); control.Location = new Point(x, y); panel.Controls.Add(control);
y += control.Height;
}
?
+ 1
yes that should work.
Except for the extra { brace behind the for-loop statement.
Notice for database actions there are datagrids.
Does it work, What do you see ?