Results 1 to 3 of 3

Thread: change the border color of a label after running the program

  1. #1
    pooya1072 is offline VB.NET Forum Enthusiast
    .NET Framework
    .NET 4.0
    Join Date
    Jul 2012
    Posts
    83
    Reputation
    61

    change the border color of a label after running the program

    Hi friends
    There is two control in my form,a label and a button , i want when i click the button ,the color of label's border change.
    Thanks

  2. #2
    jmcilhinney's Avatar
    jmcilhinney is offline VB.NET Forum Moderator
    .NET Framework
    .NET 4.0
    Join Date
    Aug 2004
    Location
    Sydney, Australia
    Posts
    13,801
    Reputation
    1705
    Assuming that you've set BorderStyle property of the Label, you can't easily change the colour of that border, as far as I'm aware. I'd suggest that the easiest option is to put the Label on a Panel and make the Panel the appropriate number of pixels bigger in each direction. The overhanging Panel will then create a border around the Label and you can change it's colour by setting the BackColor property of the Panel.

  3. #3
    pooya1072 is offline VB.NET Forum Enthusiast
    .NET Framework
    .NET 4.0
    Join Date
    Jul 2012
    Posts
    83
    Reputation
    61
    Ok , i got it ....
    Anyway ......
    Thanks

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •