outer2000(天外流星) 
怎么能点击使用又不得到焦点?

解决方案 »

  1.   

    使用Label + Line 吧!!很简单的!!!
      

  2.   

    我有一个很笨,但很灵的办法。屡用屡爽。在窗体中建一个临时的文本框,隐藏在其他控件的后面。在希望去掉虚框的按钮添加如下代码:
    Private Sub Command1_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
        Txt_Tmp.SetFocus
    End Sub当然也可以用MouseDown之类。
      

  3.   

    我就是不想用另外的控件,我记得我以前看到过的,但是当时没在意,好像是一个API一类的东西,唉,真是可惜,一到想用的时候又找不到了,谢谢上面的兄弟。
      

  4.   

    用下列API就可以去掉按钮上的虚框,但在什么时候使用下当的执行代码我没找到好位置,
    因为cammand没有paint事件,所以不能很好的擦除.
    你看看吧.
    Private Declare Function DrawFocusRect Lib "user32" (ByVal hDc As Long, lpRect As RECT) As Long
    Private Declare Function GetDC Lib "user32" (ByVal hwnd As Long) As LongPrivate Type RECT
        Left As Long
        Top As Long
        Right As Long
        Bottom As Long
    End TypeDim hDc As Long
    Dim hRect As RECT
        
    hDc = GetDC(Command1.hwnd)
    hRect.Left = 4
    hRect.Top = 4
    hRect.Right = Command1.Width / 15 - 4
    hRect.Bottom = Command1.Height / 15 - 4
    DrawFocusRect hDc, hRect
      

  5.   


      用PICTUREBOX代替,再用API将PICTUREBOX的Body设成CommandButton那样的就可以啦.
      

  6.   

    不需要任何API
    你使用下面两个属性即可搞定:
    MaskColor=你按钮的底色
    UseMaskColor=True
      

  7.   

    巴顿大哥,你的方法不行呀,底色就是BackColor吧,真的不行,我用的是VB6.