CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Sep 2006
    Location
    Bangalore
    Posts
    47

    [RESOLVED] How to change the location of a panel during runtime

    Hi all,
    I am developing an application in which there are 2 pannels lying up and down. under certain condition panel1 will be hidden and pannel2 has to expand till pannel1. while doing so it gives error.

    I am using like
    pDisplay.Location.Y = 0;

    Its giving the error as
    "F:\Projects\OldCompuTaught\DEVENG\Template.cs(4162): Cannot modify the return value of 'System.Windows.Forms.Control.Location' because it is not a variable"

    Please help...

  2. #2
    Join Date
    May 2006
    Location
    Norway
    Posts
    1,709

    Re: How to change the location of a panel during runtime

    Quote Originally Posted by rahulsri19
    Hi all,
    I am developing an application in which there are 2 pannels lying up and down. under certain condition panel1 will be hidden and pannel2 has to expand till pannel1. while doing so it gives error.

    I am using like
    pDisplay.Location.Y = 0;

    Its giving the error as
    "F:\Projects\OldCompuTaught\DEVENG\Template.cs(4162): Cannot modify the return value of 'System.Windows.Forms.Control.Location' because it is not a variable"

    Please help...
    To set the location and size of a panel do like this:
    Code:
    //sets the coordinates of the upper-left corner of the control relative to the upper-left corner of its container.
    panel1.Location = new Point(56,72);
    panel1.Size = new Size(264, 152);
    Laitinen

  3. #3
    Join Date
    Nov 1999
    Location
    Denmark
    Posts
    260

    Re: How to change the location of a panel during runtime

    try
    .Top=<your value>
    and
    .Left=<your value>

  4. #4
    Join Date
    Sep 2006
    Location
    Bangalore
    Posts
    47

    Re: How to change the location of a panel during runtime

    Thanks to you all... With your help my problem is sloved...I am very much thankful to you...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured