Results 1 to 34 of 34

Thread: Blue border appear around a Button? [Resolved]

Hybrid View

  1. #1
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    Re: Blue border appear around a Button?

    Quote Originally Posted by Dave Sell
    Either way, I guess. This is a "Client Request"
    Yay, one of those.

    If you want another way...

    Set your scalemode to Pixels. Add a picture box to your usercontrol with coordinates (0, 0) and name it picLines. Then move your cmdButton to (2, 2). Then try this resize code:
    VB Code:
    1. Private Sub UserControl_Resize()
    2.     cmdButton.Height = ScaleHeight - 4
    3.     cmdButton.Width = ScaleWidth - 4
    4.     With picLines
    5.         .Height = ScaleHeight
    6.         .Width = ScaleWidth
    7.         .Line (0, 0)-(.Width, 0), RGB(0, 0, 255)
    8.         .Line (.Width, 0)-(.Width, .Height), RGB(0, 0, 255)
    9.         .Line (.Width, .Height)-(0, .Height), RGB(0, 0, 255)
    10.         .Line (0, .Height)-(0, 0), RGB(0, 0, 255)
    11.     End With
    12. End Sub


  2. #2

    Thread Starter
    PowerPoster Dave Sell's Avatar
    Join Date
    Mar 2004
    Location
    /dev/null
    Posts
    2,961

    Re: Blue border appear around a Button?

    Quote Originally Posted by penagate
    Yay, one of those.

    If you want another way...

    Set your scalemode to Pixels. Add a picture box to your usercontrol with coordinates (0, 0) and name it picLines. Then move your cmdButton to (2, 2). Then try this resize code:
    VB Code:
    1. Private Sub UserControl_Resize()
    2.     cmdButton.Height = ScaleHeight - 4
    3.     cmdButton.Width = ScaleWidth - 4
    4.     With picLines
    5.         .Height = ScaleHeight
    6.         .Width = ScaleWidth
    7.         .Line (0, 0)-(.Width, 0), RGB(0, 0, 255)
    8.         .Line (.Width, 0)-(.Width, .Height), RGB(0, 0, 255)
    9.         .Line (.Width, .Height)-(0, .Height), RGB(0, 0, 255)
    10.         .Line (0, .Height)-(0, 0), RGB(0, 0, 255)
    11.     End With
    12. End Sub

    OK, thanks for going the extra mile, but I am still concerned what the UserControl will look like when I need the blue border to "go away"... Will there be a goofy background border? Maybe I can make the picbox transparent?
    Nobody knows what software they want until after you've delivered what they originally asked for.

    Don't solve problems which don't exist.

    "If I had eight hours to cut down a tree, I'd spend six hours sharpening my axe." --- Abraham Lincoln (1809-1865)

    2 idiots don't make a genius.

  3. #3
    Giants World Champs!!!! Mark Gambo's Avatar
    Join Date
    Sep 2003
    Location
    Colorado
    Posts
    2,965

    Re: Blue border appear around a Button?

    Quote Originally Posted by Dave Sell
    OK, thanks for going the extra mile, but I am still concerned what the UserControl will look like when I need the blue border to "go away"... Will there be a goofy background border? Maybe I can make the picbox transparent?

    No just use my function and change the border to the color of the background of the form etc.
    Regards,

    Mark

    Please remember to rate posts! Rate any post you find helpful. Use the link to the left - "Rate this Post". Please use [highlight='vb'] your code goes in here [/highlight] tags when posting code. When a question you asked has been resolved, please go to the top of the original post and click "Thread Tools" then select "Mark Thread Resolved."


  4. #4

    Thread Starter
    PowerPoster Dave Sell's Avatar
    Join Date
    Mar 2004
    Location
    /dev/null
    Posts
    2,961

    Re: Blue border appear around a Button?

    Quote Originally Posted by Mark Gambo
    No just use my function and change the border to the color of the background of the form etc.
    I will never know the color of the "form". This is a COM UserControl, which can be used all over the place. This is part of the problem.
    Nobody knows what software they want until after you've delivered what they originally asked for.

    Don't solve problems which don't exist.

    "If I had eight hours to cut down a tree, I'd spend six hours sharpening my axe." --- Abraham Lincoln (1809-1865)

    2 idiots don't make a genius.

  5. #5
    Giants World Champs!!!! Mark Gambo's Avatar
    Join Date
    Sep 2003
    Location
    Colorado
    Posts
    2,965

    Re: Blue border appear around a Button?

    Quote Originally Posted by Dave Sell
    I will never know the color of the "form". This is a COM UserControl, which can be used all over the place. This is part of the problem.
    Sorry, I missed that, then why not setting the .Visible Property to false?
    Regards,

    Mark

    Please remember to rate posts! Rate any post you find helpful. Use the link to the left - "Rate this Post". Please use [highlight='vb'] your code goes in here [/highlight] tags when posting code. When a question you asked has been resolved, please go to the top of the original post and click "Thread Tools" then select "Mark Thread Resolved."


  6. #6

    Thread Starter
    PowerPoster Dave Sell's Avatar
    Join Date
    Mar 2004
    Location
    /dev/null
    Posts
    2,961

    Re: Blue border appear around a Button?

    All,

    Thanks for the great responses! I am uploading a simple sample control and then I will try your suggestions. You all are welcome to make your own mods to prove your points.

    Just make a new "ActiveX Control" Project, and compile this control to an .OCX, then use it on a new EXE Form. You will see what I mean when you try these things.
    Attached Files Attached Files
    Nobody knows what software they want until after you've delivered what they originally asked for.

    Don't solve problems which don't exist.

    "If I had eight hours to cut down a tree, I'd spend six hours sharpening my axe." --- Abraham Lincoln (1809-1865)

    2 idiots don't make a genius.

  7. #7

    Thread Starter
    PowerPoster Dave Sell's Avatar
    Join Date
    Mar 2004
    Location
    /dev/null
    Posts
    2,961

    Re: Blue border appear around a Button?

    Here is my solution. Tell me what you think: Will I have problems on different screen resolutions (Curse the dreaded twip-monster).

    VB Code:
    1. Option Explicit
    2.  
    3. Private Sub cmdButton_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
    4.     cmdButton.Top = 50
    5.     cmdButton.Left = 50
    6.     cmdButton.Height = Height - 100
    7.     cmdButton.Width = Width - 100
    8. End Sub
    9.  
    10. Private Sub cmdButton_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
    11.     cmdButton.Top = 0
    12.     cmdButton.Left = 0
    13.     cmdButton.Height = Height
    14.     cmdButton.Width = Width
    15. End Sub
    16.  
    17. Private Sub UserControl_Resize()
    18.     cmdButton.Height = Height
    19.     cmdButton.Width = Width
    20.     '
    21.     BlueBorder.Height = Height
    22.     BlueBorder.Width = Width
    23. End Sub
    Attached Files Attached Files
    Nobody knows what software they want until after you've delivered what they originally asked for.

    Don't solve problems which don't exist.

    "If I had eight hours to cut down a tree, I'd spend six hours sharpening my axe." --- Abraham Lincoln (1809-1865)

    2 idiots don't make a genius.

Posting Permissions

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



Click Here to Expand Forum to Full Width