StrokesPlus.net
Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
Yuichi  
#1 Posted : Friday, July 3, 2020 4:06:58 AM(UTC)
Yuichi

Rank: Advanced Member

Reputation:

Groups: Approved
Joined: 9/13/2018(UTC)
Posts: 54
Poland

Thanks: 18 times
Was thanked: 14 time(s) in 11 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();
}
liuxilu  
#2 Posted : Friday, July 3, 2020 9:19:24 PM(UTC)
liuxilu

Rank: Advanced Member

Reputation:

Groups: Translators, Moderators, Approved
Joined: 4/5/2020(UTC)
Posts: 75
China

Thanks: 1 times
Was thanked: 20 time(s) in 20 post(s)
thanks 1 user thanked liuxilu for this useful post.
Yuichi on 7/4/2020(UTC)
liuxilu  
#3 Posted : Friday, July 3, 2020 9:22:59 PM(UTC)
liuxilu

Rank: Advanced Member

Reputation:

Groups: Translators, Moderators, Approved
Joined: 4/5/2020(UTC)
Posts: 75
China

Thanks: 1 times
Was thanked: 20 time(s) in 20 post(s)
And I have posted using Enum.Parse
Yuichi  
#4 Posted : Saturday, July 4, 2020 6:08:51 AM(UTC)
Yuichi

Rank: Advanced Member

Reputation:

Groups: Approved
Joined: 9/13/2018(UTC)
Posts: 54
Poland

Thanks: 18 times
Was thanked: 14 time(s) in 11 post(s)
Thanks, this will help :)
Users browsing this topic
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.