Results 1 to 6 of 6

Thread: Some Help Please

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Feb 2002
    Location
    USA
    Posts
    432

    Some Help Please

    OK Im a Sorta new VB programmer just got VS.net{academic}
    :-)

    What is the "#Region " Windows Form Designer generated code "" Code for ??


    and how can i do the cancel and defalt property???

  2. #2
    Addicted Member ZanM's Avatar
    Join Date
    Oct 1999
    Location
    The here and now.
    Posts
    191

    its for the + - Code thing

    #Region DirectiveSee Also
    #If...Then...#Else Directives (Language Reference)
    Collapses and hides sections of code in Visual Basic .NET files.

    #Region "identifier_string"
    #End Region
    Parts
    identifier_string
    Required. String that acts as the title of a region when it is collapsed. Regions are collapsed by default.
    #End Region
    Terminates the #Region block.
    Remarks
    The #Region directive lets you specify a block of code that you can expand or collapse when using the outlining feature of the Visual Studio Code Editor. #Region statements support block semantics (such as #If...#End If), meaning that the start and end must be in the same code block.

    Example
    This example uses the #Region directive.

    #Region "MathFunctions"
    ' Insert code for the Math functions here.
    #End Region
    Magiaus
    Visual Basic 6.0 SP5
    Visual C++ 6.0 SP5


    The only sovereign you can allow to rule you is reason.

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Feb 2002
    Location
    USA
    Posts
    432
    no clue what you just said lol

  4. #4
    Addicted Member donut's Avatar
    Join Date
    Mar 2001
    Location
    London, UK
    Posts
    165
    jesus christ, ZanM!

    basically, any code you put in a #region...#end region can be expandable/collapsable (like in a treeview), just like with subs and functions, except it allows you to do it with large blocks of code.

  5. #5
    old fart Frans C's Avatar
    Join Date
    Oct 1999
    Location
    the Netherlands
    Posts
    2,926
    As explained above, regions define collapsable pieces of code.
    But I guess your main question was about the Windows Form Designer generated code region.
    This region contains the code that is generated by your actions on the form designer. If you drop a button on the form, the code for creating that button is placed in this region. It is not recommended to change it, because the form designer could crash. That is why it is hidden in a region.

    The Cancel and Default properties of the button are now properties of the form. This makes more sense, because only one button can be the cancel button, and it is awkward if properties are changed because you change the properties of another control. The form now has AcceptButton and CancelButton properties, which correspond to the old Default, and Cancel properties of the commandbutton.

  6. #6

    Thread Starter
    Hyperactive Member
    Join Date
    Feb 2002
    Location
    USA
    Posts
    432
    Ok THANKS!

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