Results 1 to 2 of 2

Thread: win Forms properties and objects [RESOLVED]

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Nov 2003
    Posts
    1,489

    win Forms properties and objects [RESOLVED]

    I'm reading a book right now and the author is demonstrating how you alter the properties of your forms at run-time. He goes on to say that in order to alter the size, for example, you create a size object (new system.drawing.size(x,x)) and then assign th the new object to the form's size property (me.size = new system.drawing.size(x,x)).

    my question is this: why can't you simply go: me.size = (x,x) or dim x as integer (assign it a number) dim x2 as integer(same thing) and then go...me.size = x, x2 ..why can't you do that?

    Exactly WHEN do you know you need to create an object to be used as a variable? And, you don't really HAVE to use the entire string..system.drawing.size(x,x)..do you? Couldnt you go...new size(x,x) instead?

    Am I even CLOSE? Or am I waaaaay off track here?
    Last edited by Andy; Dec 29th, 2003 at 03:19 AM.

  2. #2
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    Well , because the size property of the form accepts Size object only .

    It should look something like this :

    VB Code:
    1. Public Property FormSize(ByVal siz As Size)
    2.         Get
    3.             Return siz
    4.         End Get
    5.         Set(ByVal Value)
    6.             siz = Value
    7.         End Set
    8.     End Property

    continue reading ...

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