Rank: Advanced Member
Groups: Approved
Joined: 9/13/2018(UTC) Posts: 54 Thanks: 18 times Was thanked: 18 time(s) in 13 post(s)
|
Hi Recently, I'm working on a slightly larger script and I came across a problem with the "Anchor" function, it doesn't work properly. This function should "stick" the button to the assigned corner of the window or wall and move when resizing, and I get a "shift" as if something was not counted correctly. Could it be that some other function should be added?
Code:testForm();
function testForm() {
let Forms = forms.System.Windows.Forms;
// FORM
var form1 = new Forms.Form;
form1.FormBorderStyle = Forms.FormBorderStyle.Sizable;
form1.StartPosition = Forms.FormStartPosition.CenterScreen;
form1.TopMost = false;
form1.ShowInTaskbar = true;
form1.MaximizeBox = true;
form1.MinimizeBox = false;
form1.ControlBox = true;
form1.Width = 500;
form1.Height = 500;
form1.Text = "PDF Color Bar";
// BUTTON 1 / ACCEPT
var button1 = new Forms.Button;
button1.Width = 100;
button1.Height = 30;
button1.Location = new Point(350, 400);
button1.DialogResult = Forms.DialogResult.Yes;
button1.Text = "OK";
button1.Anchor = (Forms.AnchorStyles.Bottom | Forms.AnchorStyles.Right);
form1.Controls.Add(button1);
form1.ShowDialog();
}
|
|
|
|
Rank: Advanced Member
Groups: Translators, Moderators, Approved Joined: 4/6/2020(UTC) Posts: 79 Thanks: 1 times Was thanked: 21 time(s) in 21 post(s)
|
|
1 user thanked liuxilu for this useful post.
|
|
|
Rank: Advanced Member
Groups: Translators, Moderators, Approved Joined: 4/6/2020(UTC) Posts: 79 Thanks: 1 times Was thanked: 21 time(s) in 21 post(s)
|
And I have posted using Enum.Parse
|
|
|
|
Rank: Advanced Member
Groups: Approved
Joined: 9/13/2018(UTC) Posts: 54 Thanks: 18 times Was thanked: 18 time(s) in 13 post(s)
|
Thanks, this will help :)
|
|
|
|
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.
Important Information:
The StrokesPlus.net Forum uses cookies. By continuing to browse this site, you are agreeing to our use of cookies.
More Details
Close