haha, another skywalker, me too :-)In regards to your question, I know 2 methods,1) Me.Width = newWidth
   Me.Height = newHeight2)Dim sz As Size = New Size(newWidth, newHeight)
  Me.Size = szGot it?

解决方案 »

  1.   

    打倒在C#版贴VB.NET的代码! :P   我还是JEDI KNIGHT呢!1) this.Width = xxxx; //新的宽度
       this.Height = xxxx; //新的高度2) this.Size = new Size(newWidth,newHeight)
      

  2.   

    hahahaha..............................
      

  3.   

    jhnhu(jhnhu)是对的,直接修改Width和Height就可以了,Size属性好像没有set访问器
      

  4.   

    怎么没有set  MSDN 2003 Apr.public new Size Size {get; set;}Res
    This property allows you to set both the height and width of the form at the same time instead of setting the Height and Width properties individually. If you want to set the size and location of a form, you can use the DesktopBounds property to size and locate the form based on desktop coordinates or use the Bounds property of the Control class to set the size and location of the form based on screen coordinates.
    Example
    [Visual Basic, C#] The following example demonstrates how to create a form that is displayed with an opacity level of 75 percent. The example code creates a new form that is positioned in the center of the screen with an Opacity property set to change the opacity level of the form. The example code also sets the Size property to provide a larger sized form than the default size of the form. This example assumes that the method defined in this example is called from another form in an event handler or other method.
    [C#] 
    private void CreateMyOpaqueForm()
    {
       // Create a new form.
       Form form2 = new Form();
       // Set the text displayed in the caption.
       form2.Text = "My Form";
       // Set the opacity to 75%.
       form2.Opacity = .75;
       // Size the form to be 300 pixels in height and width.
       form2.Size = new Size(300,300);
       // Display the form in the center of the screen.
       form2.StartPosition = FormStartPosition.CenterScreen;   // Display the form as a modal dialog box.
       form2.ShowDialog();
    }
      

  5.   

    不行的,无论是Size还是Width和Height,都不能直接set,不信你们试试而且我在窗体代码中找不到设置窗体大小的那一行代码,不知道怎么回事。比如设计器的属性中,窗体的Size是(400,200),但是找不到包含400这个数字的代码行。
      

  6.   

    另外说一下,偶是最正统的Skywalker,是大名鼎鼎的Darth Vader的前身!!!
      

  7.   

    哎,原来是个心术不正的家伙,怪不得跟我作对
    非要我试一下!测试结果:width height size都是可以set的!(Darth Vader的手始终是要被砍掉的)
      

  8.   

    Darth Vader的手早在Anakin的时候就被砍了 :p