SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 6 of 6
  1. #1
    Junior Member
    Join Date
    Oct 2003
    Posts
    8
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Checking DotNetLabels

    All,

    What is the most efficient way to check if a DotNetLabel is bold? So far, the only way I found is to create a property check.
    Thanks! [img]images/icons/smile.gif[/img]

    Rosauro

  2. #2
    Advanced Member
    Join Date
    Jan 2002
    Location
    Detroit, Michigan
    Posts
    525
    Post Thanks / Like
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Checking DotNetLabels

    If you are using 5.03.00 you can use .Object for .NET. What this allows you to do is to call methods and properties like you would if the object was an ActiveX control.

    You add a Dot Net Reference from the Tools menu (a bit like adding a VBA reference).

    The you can write code like this ...
    </font><blockquote><font size="1" face="Verdana, Arial, Helvetica">code:</font><hr /><pre style="font-size:x-small; font-family: monospace;">Dim o As TestPartnerInterop_System_Windows_Forms.Label
    Set o = DotNETLabel(&quot;Name=label1&quot.Object

    MsgBox o.Font.Bold</pre><hr /></blockquote><font size="2" face="Verdana, Arial, Helvetica">
    //*eggbox

  3. #3
    Junior Member
    Join Date
    Oct 2003
    Posts
    8
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Checking DotNetLabels

    EggBox,

    Thanks.
    Which DLL or EXE did you use to come up with the above? Would it be the application or a system DLL/EXE?

    Rosauro

  4. #4
    Senior Member
    Join Date
    Sep 2001
    Location
    Philly
    Posts
    1,231
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Checking DotNetLabels

    if you are using TP 5.3 (will not work in earlier), this is built into TestPartner using the .OBJECT method. No dll reference is required.
    ~Alias~

  5. #5
    Junior Member
    Join Date
    Oct 2003
    Posts
    8
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Checking DotNetLabels

    Eggbox,

    Disregard. I found the DLL. For those interested, it is located in \winnt\microsoft.net\framework\v1.1.4322 and it is called system.windows.forms.dll (at least in Win2K Pro. It is easier to find if you search for the FRAMEWORK folder in your windows explorer)

    Alias,

    I tried to remove the above .NET reference but as soon as I get to my line of code with the dim statement similar to EggBox's, it displays an undefined user-type message. How did you get your code to run without the reference? Can you post a sample?

    Thanks to both of you.

    Rosauro

  6. #6
    Senior Member
    Join Date
    Sep 2001
    Location
    Philly
    Posts
    1,231
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Checking DotNetLabels

    Do this... no reference needed:

    MsgBox DotNETLabel("Name=Label1").Object.Font.Bold
    ~Alias~

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Search Engine Optimisation provided by DragonByte SEO v2.0.40 (Pro) - vBulletin Mods & Addons Copyright © 2017 DragonByte Technologies Ltd.
Resources saved on this page: MySQL 10.71%
vBulletin Optimisation provided by vB Optimise v2.7.1 (Pro) - vBulletin Mods & Addons Copyright © 2017 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.3.0 (Pro) - vBulletin Mods & Addons Copyright © 2017 DragonByte Technologies Ltd.
vBNominate (Lite) - vBulletin Mods & Addons Copyright © 2017 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Pro) - vBulletin Mods & Addons Copyright © 2017 DragonByte Technologies Ltd.
Username Changing provided by Username Change (Free) - vBulletin Mods & Addons Copyright © 2017 DragonByte Technologies Ltd.
BetaSoft Inc.
Digital Point modules: Sphinx-based search
All times are GMT -8. The time now is 12:20 AM.

Copyright BetaSoft Inc.