SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 7 of 7
  1. #1
    Member
    Join Date
    Feb 2003
    Location
    Coimbatore,TN,India
    Posts
    31
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Change Label Font Style & Color in DOTNET Factory

    How to change Font Style and Color of Label in User Form which is create by DOTNet Factory Object.

    Set UILabel = DotNetFactory.CreateInstance("System.Windows.Forms .Label", "System.Windows.Forms")

    With UILabel
    .Location = Pos
    .Text = "User Details"
    .width = 80
    End With

    In the above code how to use Fontstyle/color proprty for changing Font Color and Font Style.

  2. #2
    Senior Member
    Join Date
    Mar 2008
    Posts
    126
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Change Label Font Style & Color in DOTNET Factory

    I too need the code to change the font.. Please help us!

  3. #3
    Moderator
    Join Date
    Jul 2005
    Location
    Delhi
    Posts
    15,575
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    7 Thread(s)
    Total Downloaded
    0

    Re: Change Label Font Style & Color in DOTNET Fact

    Try this

    UILabel.Font.Size = 12
    UILabel.Font.Bold = True

  4. #4
    Senior Member
    Join Date
    Mar 2008
    Posts
    126
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Change Label Font Style & Color in DOTNET Fact

    Hi Tarun am getting the following error,
    External object System.Drawing.Font::Bold has thrown the following exception:
    Method 'System.Drawing.Font.Bold' not found...

    Is this methods are not available in QTP dotnet factory?

    Also please help me in adding Picture to the Form..

    Set pboxLogo = DotNetFactory.CreateInstance("System.Windows.Forms .PictureBox", "System.Windows.Forms")

  5. #5
    Senior Member
    Join Date
    Mar 2008
    Posts
    126
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Change Label Font Style & Color in DOTNET Fact

    Tarun Please tell me whether it is possible to change the font style in QTP?

  6. #6
    Moderator
    Join Date
    Jul 2005
    Location
    Delhi
    Posts
    15,575
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    7 Thread(s)
    Total Downloaded
    0

    Re: Change Label Font Style & Color in DOTNET Fact

    You should look up on Online MSDN help for checking what properties and methods ate supported. Anways why would a PictureBox object support Font? It doesn't display any text

  7. #7
    Senior Member
    Join Date
    Mar 2008
    Posts
    126
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Change Label Font Style & Color in DOTNET Fact

    Tarun Sorry for bringing the Picturebox object in this thread.. Picturebox object is one query & font is another query.. font query is for Label object..

    I have checked in MSDN librrary.. they are using the statement which you have mentioned eg;(Label1.Font.Bold=True).. I think font method is not included in QTP dotnetfactory library ... thats why we are not able to use it.. becasue Label1.Text="User" is working fine in QTP..

 

 

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 11.54%
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 04:09 AM.

Copyright BetaSoft Inc.