moving a button
-
hello i wish program a button that will move another button to a specific location i try to make it more simple there are 2 buttons A & B when button A is pressed, button B will move away from button A so that button A's sub button could be display i can manage the sub button part but was unable to move button B to a specific location because i dont know the coding that will do the task can you please help me? if this type of program or coding is impossible, please tell me, so i can drop my intention to do this function. thank you in advance p.s. below is a visual example of the thing i wish to do "before button A is clicked" Button A Button B "after button A is clicked" Button A Button B Gary
-
hello i wish program a button that will move another button to a specific location i try to make it more simple there are 2 buttons A & B when button A is pressed, button B will move away from button A so that button A's sub button could be display i can manage the sub button part but was unable to move button B to a specific location because i dont know the coding that will do the task can you please help me? if this type of program or coding is impossible, please tell me, so i can drop my intention to do this function. thank you in advance p.s. below is a visual example of the thing i wish to do "before button A is clicked" Button A Button B "after button A is clicked" Button A Button B Gary
I do not syntax of VB.Net, but in C# the above can be done as below
this.button2.Location = new Point(this.button2.Location.X, this.button2.Location.Y + 10);
Read about the
Location
Property of the classSystem.Windows.Forms.Button
on msdn, This property is being inherited fromControl
. You get all relevent details. Best of luck. Regards, Jay -
hello i wish program a button that will move another button to a specific location i try to make it more simple there are 2 buttons A & B when button A is pressed, button B will move away from button A so that button A's sub button could be display i can manage the sub button part but was unable to move button B to a specific location because i dont know the coding that will do the task can you please help me? if this type of program or coding is impossible, please tell me, so i can drop my intention to do this function. thank you in advance p.s. below is a visual example of the thing i wish to do "before button A is clicked" Button A Button B "after button A is clicked" Button A Button B Gary
dear gary it is very simple in .net. if i would have been at your place i should do it in this manner. place button A then place a textbox with multiline property set to be true also make it invisible now put a new button button B. leave it i m giving you the entire code use it and remember me in your prayers. Public Class FrmMoveButton Inherits System.Windows.Forms.Form #Region " Windows Form Designer generated code " Public Sub New() MyBase.New() 'This call is required by the Windows Form Designer. InitializeComponent() 'Add any initialization after the InitializeComponent() call End Sub 'Form overrides dispose to clean up the component list. Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean) If disposing Then If Not (components Is Nothing) Then components.Dispose() End If End If MyBase.Dispose(disposing) End Sub 'Required by the Windows Form Designer Private components As System.ComponentModel.IContainer 'NOTE: The following procedure is required by the Windows Form Designer 'It can be modified using the Windows Form Designer. 'Do not modify it using the code editor. Friend WithEvents Button1 As System.Windows.Forms.Button Friend WithEvents TextBox1 As System.Windows.Forms.TextBox Friend WithEvents Button2 As System.Windows.Forms.Button Private Sub InitializeComponent() Me.Button1 = New System.Windows.Forms.Button Me.TextBox1 = New System.Windows.Forms.TextBox Me.Button2 = New System.Windows.Forms.Button Me.SuspendLayout() ' 'Button1 ' Me.Button1.Location = New System.Drawing.Point(4, 14) Me.Button1.Name = "Button1" Me.Button1.Size = New System.Drawing.Size(112, 28) Me.Button1.TabIndex = 0 Me.Button1.Text = "Button1" ' 'TextBox1 ' Me.TextBox1.Location = New System.Drawing.Point(6, 44) Me.TextBox1.Multiline = True Me.TextBox1.Name = "TextBox1" Me.TextBox1.Size = New System.Drawing.Size(110, 48) Me.TextBox1.TabIndex = 1 Me.TextBox1.Text = "please provide co-ordinates in (x,y) format dont forget paranthasis" Me.TextBox1.Visible = False ' 'Button2 ' Me.Button2.Location = New System.Drawing.Point(6, 44) Me.Button2.Name
-
dear gary it is very simple in .net. if i would have been at your place i should do it in this manner. place button A then place a textbox with multiline property set to be true also make it invisible now put a new button button B. leave it i m giving you the entire code use it and remember me in your prayers. Public Class FrmMoveButton Inherits System.Windows.Forms.Form #Region " Windows Form Designer generated code " Public Sub New() MyBase.New() 'This call is required by the Windows Form Designer. InitializeComponent() 'Add any initialization after the InitializeComponent() call End Sub 'Form overrides dispose to clean up the component list. Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean) If disposing Then If Not (components Is Nothing) Then components.Dispose() End If End If MyBase.Dispose(disposing) End Sub 'Required by the Windows Form Designer Private components As System.ComponentModel.IContainer 'NOTE: The following procedure is required by the Windows Form Designer 'It can be modified using the Windows Form Designer. 'Do not modify it using the code editor. Friend WithEvents Button1 As System.Windows.Forms.Button Friend WithEvents TextBox1 As System.Windows.Forms.TextBox Friend WithEvents Button2 As System.Windows.Forms.Button Private Sub InitializeComponent() Me.Button1 = New System.Windows.Forms.Button Me.TextBox1 = New System.Windows.Forms.TextBox Me.Button2 = New System.Windows.Forms.Button Me.SuspendLayout() ' 'Button1 ' Me.Button1.Location = New System.Drawing.Point(4, 14) Me.Button1.Name = "Button1" Me.Button1.Size = New System.Drawing.Size(112, 28) Me.Button1.TabIndex = 0 Me.Button1.Text = "Button1" ' 'TextBox1 ' Me.TextBox1.Location = New System.Drawing.Point(6, 44) Me.TextBox1.Multiline = True Me.TextBox1.Name = "TextBox1" Me.TextBox1.Size = New System.Drawing.Size(110, 48) Me.TextBox1.TabIndex = 1 Me.TextBox1.Text = "please provide co-ordinates in (x,y) format dont forget paranthasis" Me.TextBox1.Visible = False ' 'Button2 ' Me.Button2.Location = New System.Drawing.Point(6, 44) Me.Button2.Name