Designed to Not Move With Again
question
Can non move my buttons in forms
i am learning C# and i got to microsoft forms.
so in my book it tells me to create a "TabControl" and add together 3 simple buttons in the kickoff tab of the TabControl.
everytime i add together a push button, i tin not reposition it anymore inside the tabcontrol.
if i only desire to move the push button with the mouse, it always snaps back to its first position where i added information technology.
what exactly do i accept to exercise, so i can move the buttons?
i added a picture show below so u know what i mean.
at that place is nothing special, but the button1 in the picture, i tin can not move information technology at all, information technology e'er snaps dorsum to this position.
i restarted visual studio and created a new projection, nothing helped and so far.
windows-forms
The only time I've seen this is with Visual Studio 2019 where in brusque the form designer sometimes gets stuck. When this happens endeavour single clicking on the push button followed by moving the button with the arrow keys on your keyboard just a small distance. Next, save the form, add together another button and see if you can at present move the first button using the mouse.
In regards to sometimes gets stuck, the designer is considered to still be in preview mode. If this were Visual Studio 2017 or earlier this issue as far as I'thou aware of does non exists.
yes, its indeed 2019 and its exactly how u draw it.
i tin can motion it with the arrow keys, i just tried it out, simply later on adding some other button, i yet cant use information technology.
perhaps i should just motility to a after visual studio version?
So, i didnt find how to install the 2020 version.
i updated 2019, but it didnt help me.
later that i saw i accept a professional version, i installed information technology and it works in this version.
0 Votes 0 ·
Oh boi, i only figured out, its only not working because it was on my second Screen.
if i put VS on my Master Screen, information technology works, only not on my second Screen... dont ask me why.
0 Votes 0 ·
@ArtjomSchmitke-8217 , I desire to know if this happened in the designer or at runtime. If yous want to motion the control at runtime, you could try to utilize Mouse_Move event and Mouse_Down event to motion the buttons in the TabPage.
Code:
individual Point MouseDownLocation; private void Form1_Load(object sender, EventArgs e) { Button btn1 = new Button(); btn1.Text = "test"; btn1.Location = new Point(0, 0); btn1.MouseDown += Btn1_MouseDown; btn1.MouseMove += Btn1_MouseMove; tabPage1.Controls.Add(btn1); } private void Btn1_MouseMove(object sender, MouseEventArgs e) { Button btn = sender as Button; if (east.Push button == Organization.Windows.Forms.MouseButtons.Left) { btn.Left = east.Ten + btn.Left - MouseDownLocation.X; btn.Summit = e.Y + btn.Top - MouseDownLocation.Y; } } private void Btn1_MouseDown(object sender, MouseEventArgs due east) { if (east.Push button == System.Windows.Forms.MouseButtons.Left) { MouseDownLocation = e.Location; } } Result:
If the response is helpful, please click "Have Answer" and upvote it.
Notation: Please follow the steps in our documentation to enable email notifications if you desire to receive the related email notification for this thread.
it happens in the designer, not at runtime (if i understand right, at runtime means, when i start the programm?)
i will try and install a newer version of visual studio, the concluding answer from karen seems to have had the exact aforementioned problem with VS 2019, i will try it out.
So, i didnt find how to install the 2020 version.
i updated 2019, but information technology didnt help me.
after that i saw i have a professional version, i installed it and it works in this version.
0 Votes 0 ·
Oh boi, i just figured out, its only not working because it was on my second Screen.
if i put VS on my Chief Screen, it works, just not on my second Screen... dont ask me why.
0 Votes 0 ·
question details
Related Questions
hunterbefouself78.blogspot.com
Source: https://docs.microsoft.com/answers/questions/514403/can-not-move-my-buttons-in-forms.html
Can you post a picture of the properties for the button? Or if y'all know how, copy the code for the button from the Designer.cs file and paste the lawmaking here. It should expect something similar the post-obit.
0 Votes 0 ·
so, first i thought its because i didnt updated VS, simply it did not assistance.
then i got 2019 professional person and it worked (i idea)
when i put VS on my second screen, it didnt work again, but it works on my master Screen for some reason.
my second screen is 1080p and my primary screen is 2160p, i already encountered like bug in the past i remember.
0 Votes 0 ·
I think that the described scenario corresponds to a normal behaviour in sure circumstances; all the same this does not seem the case according to your flick. If possible, publish this sample project to OneDrive, or GitHub, etc.
0 Votes 0 ·
Practise one thing , if yous are using two monitors then make the display setting to 100 % for both . it will solve the effect automatically
0 Votes 0 ·