SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Page 1 of 2 12 LastLast
Results 1 to 10 of 16
  1. #1
    Member
    Join Date
    Dec 2006
    Posts
    82
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Object.Backcolor.Name

    Hi,

    I am trying to retrieve Backcolor of a panel. I tried these codes but they throw Type mismatch error.

    Object.Backcolor
    Object.Backcolor.Name
    Object.Backcolor.R
    Object.Backcolor.G
    Object.Backcolor.B

    Your thoughts and suggestions might be helpful.

    Thanks,
    Stanley
    Stanley

    Enjoy with what you do!

  2. #2
    Moderator JakeBrake's Avatar
    Join Date
    Dec 2000
    Location
    St. Louis - Year 2025
    Posts
    15,609
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Object.Backcolor.Name

    It seems you are missing an assignment variable as in a partial vbscript fragment below...

    Dim BgColor

    BgColor = Object.Backcolor

  3. #3
    Member
    Join Date
    Dec 2006
    Posts
    82
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Object.Backcolor.Name

    Hi,

    Thank you for looking into it..

    I actually did not miss that way..

    I use TestPartner basically to test .Net applications.
    But I received no replies from TP forums
    http://www.sqaforums.com/showflat.ph...e=0#Post514580

    So I wished to know from .Net experts to suggest if there would be anything wrong in the code.

    Is this then some kind of TP Issues?
    Stanley

    Enjoy with what you do!

  4. #4
    Senior Member
    Join Date
    Nov 2005
    Location
    Valley Forge, PA
    Posts
    417
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Object.Backcolor.Name

    Couple of things,

    1. Did you instantiate "Object" ?
    2. Did you verify that BackColor is a valid attribute of "Object" by trying to set it, i.e. Object.BackColor = VBRed ?

    Joe

  5. #5
    Member
    Join Date
    Dec 2006
    Posts
    82
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Object.Backcolor.Name

    Hi Joe,

    1. I tried as JakeBrake mentioned earlier too.. No difference
    2. The colors cannot be named, as they have different related shades. If I trace through a Property Check, then I could see the R G B values..

    But when I wish to trace through code, it doesn't show up.
    Stanley

    Enjoy with what you do!

  6. #6
    Senior Member
    Join Date
    Nov 2005
    Location
    Valley Forge, PA
    Posts
    417
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Object.Backcolor.Name

    I'm not trying to name a color,
    I'm trying to see if "Object" has been properly referenced & instantiated.

    If it has been, then both the setting and/or reading of the attribute should cause the intellisense to kick in and and show all methods & attributes including BackColor.

    As soon as you type the period in:
    Object.
    you should see the appropriate intellisense.

    Joe

  7. #7
    Member
    Join Date
    Dec 2006
    Posts
    82
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Object.Backcolor.Name

    Hi Joe,

    This is much direct. There is no intellisence support.
    So what could be my next step.

    [ QUOTE ]

    I'm trying to see if "Object" has been properly referenced & instantiated.


    [/ QUOTE ]

    Which object do you refer to here? Is that in the application?

    Thanks for your support.
    Stanley

    Enjoy with what you do!

  8. #8
    Senior Member
    Join Date
    Nov 2005
    Location
    Valley Forge, PA
    Posts
    417
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Object.Backcolor.Name

    The "Object" in your original post.

    Joe

  9. #9
    Member
    Join Date
    Dec 2006
    Posts
    82
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Object.Backcolor.Name

    Can someone help me to instantiate the "Object", all I need is to use the code below.

    MsgBox DotNETPanel("panelName").Object.Backcolor.Name
    Stanley

    Enjoy with what you do!

  10. #10
    Senior Member
    Join Date
    Mar 2001
    Posts
    176
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Object.Backcolor.Name

    [ QUOTE ]

    I'm trying to see if "Object" has been properly referenced & instantiated.

    If it has been, then both the setting and/or reading of the attribute should cause the intellisense to kick in and and show all methods & attributes including BackColor.

    As soon as you type the period in:
    Object.
    you should see the appropriate intellisense.


    [/ QUOTE ]

    Jcd probably knows this, but I just wanted to point out that this approach (getting IntelliSense) requires that you set a Reference to the library. In other words, it is early-bound, which is why TP can get the IntelliSense. In my experience, not all libraries can be referenced (variety of reasons). It's handy when it works though (although it can be a pain if the library changes and you have to go through all your old scripts making references!).

    A late bound approach is also possible, whereby you don't set a Reference and simply call out to the property via .Object. No IntelliSense is provided via this approach (because it is late bound), but this way is more flexible (you can automate some libraries that cannot be referenced).

    Wsj, does your code ("MsgBox DotNETPanel("panelName").Object.Backcolor.Name") return anything? Or does it error?

 

 
Page 1 of 2 12 LastLast

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.36 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Resources saved on this page: MySQL 10.34%
vBulletin Optimisation provided by vB Optimise v2.6.4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.2.8 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominate (Lite) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Username Changing provided by Username Change (Free) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
BetaSoft Inc.
Digital Point modules: Sphinx-based search
All times are GMT -8. The time now is 11:58 PM.

Copyright BetaSoft Inc.