Quantcast
Channel: Windows Forms General forum
Viewing all articles
Browse latest Browse all 12583

Change the button Location

$
0
0

Hi All,

I’m working on Visual Studio 2010 C#

Thanks to Mr. Blackwood I’m doing the following:

privateint Form1StartingHeight;

privateint Form1StartingWidth;

privatevoid Resize_Begin(object sender,EventArgs e)

{

Form1StartingHeight =this.Height;

      Form1StartingWidth = this.Width;

}

privatevoid Resize_End(object sender,EventArgs e)

{

      int CurrentForm1Height = this.Height;

      button3.Location.Y += (CurrentForm1Height - Form1StartingHeight);

}

  • My problem is that when I’m doing the following I’m getting the following error:
  • Cannot modify the return value of 'System.Windows.Forms.Control.Location' because it is not a variable
  • How should I fix that Error (I need that the button3 will move the difference that have been on the Form.

Thanks,

Shimon.


Viewing all articles
Browse latest Browse all 12583

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>