Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Default property

jeffy_khorjeffy_khor Member Posts: 163
We can use
text1 = "ABC"
instead of
text1.text = "ABC"

However, how to set a default property for a clas, or control.
clsBar.Barcode = "1234567"
can be write by using

clsBar = "1234567"

I think it can be set using some tool in VB. But I can't remember, so, can some body help.

Thank you.

Comments

  • DjSpiritDjSpirit Member Posts: 371
    : We can use
    : text1 = "ABC"
    : instead of
    : text1.text = "ABC"
    :
    : However, how to set a default property for a clas, or control.
    : clsBar.Barcode = "1234567"
    : can be write by using
    :
    : clsBar = "1234567"
    :
    : I think it can be set using some tool in VB. But I can't remember, so, can some body help.
    :
    : Thank you.
    :
    [grey]Use the Object Explorer [F2] and select the property you want.
    Click the Right mouse button, and select "Properties" from the popup menu. This will bring up the properties dialogue. Press the "Advanced >>" button and under "Attributes", check the "User Interface Default" check box.

    DjSpirit, support is hereby to be considered an occupational hazard[/grey]
  • jeffy_khorjeffy_khor Member Posts: 163
    I try it, but it come with 438 error

    object doesn't support this type of method and properties.

    What wrong with this.

    : : We can use
    : : text1 = "ABC"
    : : instead of
    : : text1.text = "ABC"
    : :
    : : However, how to set a default property for a clas, or control.
    : : clsBar.Barcode = "1234567"
    : : can be write by using
    : :
    : : clsBar = "1234567"
    : :
    : : I think it can be set using some tool in VB. But I can't remember, so, can some body help.
    : :
    : : Thank you.
    : :
    : [grey]Use the Object Explorer [F2] and select the property you want.
    : Click the Right mouse button, and select "Properties" from the popup menu. This will bring up the properties dialogue. Press the "Advanced >>" button and under "Attributes", check the "User Interface Default" check box.
    :
    : DjSpirit, support is hereby to be considered an occupational hazard[/grey]
    :

  • bednarjmbednarjm Member Posts: 82
    Why not just declare the properties?

    sidebar: We VB guy's (ok and gals) get lazy with the use of default properties. Always declare properties (even if default) - this will save [italic] much [/italic] time when you (or someone else) has to debug the project at some time in the future (I've been there). Also, VB.NET does not have default properties so why not get used to this now - it's good coding practice.


    jim b


  • Shawn CarterShawn Carter Member Posts: 0

    __ // http://forcoder.org // free ebooks and video tutorials about [ JavaScript C++ Visual Basic .NET PHP Objective-C C C# Java Swift Perl Go Scratch Ruby R PL/SQL MATLAB Delphi Python Assembly Visual Basic Alice Apex LabVIEW ABAP Logo Dart Scala Crystal Lua Scheme F# VBScript Prolog FoxPro Rust Transact-SQL Julia D COBOL Hack Bash Clojure Lisp SAS Ada Awk Erlang Fortran ML Kotlin ] ___________

Sign In or Register to comment.