'-- Différentes possibilités/A more complete examples
$REsource btn_BMP As "C:\Rapidq\examples\QTButton\Boutons.bmp"' -- Remplacez-le par une image que vous possèdez
$REsource btn_BMP1 As "C:\Rapidq\examples\QTButton\Boutons_Plat.bmp"' -- Utiliser celui-ci pour créer un bouton
                                        '    plat.

Dim ico_BMP As QBitmap
With ico_BMP
    .Width = 18
    .Height = 18
    .Circle (1,1,17,17, -1, &HFFAADD)
    .Line(6,4,6,7,0)
    .Line(7,4,7,7,0)
    .Line(10,4,10,7,0)
    .Line(11,4,11,7,0)
    .Line(5,10,5,10,0)
    .Line(12,10,12,10,0)
    .Line(4,9,4,9,0)
    .Line(13,9,13,9,0)
    .Line(6,11,11,11,0)
End With

$Include "C:\Rapidq\examples\QTButton\QTButton89.inc"' -- Corrigez le chemin si nécessaire

'QTBtnBMP.BMPHandle = btn_BMP1

Declare Sub Boutons_Click(Sender As QTButton)
Declare Sub Boutons_MouseMove(X As Integer, Y As Integer, Shift As Integer, Sender As QButton)
Declare Sub QBouton_MouseMove(X As Integer, Y As Integer, Shift As Integer, Sender As QButton)
Declare Sub QBouton_MouseUp(btn As Integer, X As Integer, Y As Integer, Shift As Integer, Sender As QButton)

Declare Sub Enjolivure_Click(Sender As QTButton)

Create Form As QForm
    Caption = "Examples de QTButton Examples"
    ClientWidth = 329
    ClientHeight = 260
    Center
    Create TButton As QTButton
        Left = 8
        Top = 8
        NumBMPs =4
        Caption = "Sélectionné"
        OnClick = Boutons_Click
        OnMouseMove = Boutons_MouseMove
    End Create
    Create TButton2 As QTButton
        Left = 8
        Top = 38
        Caption = "Normal"
        NumBMPs =4
        OnClick = Boutons_Click
        OnMouseMove = Boutons_MouseMove
    End Create
    Create TButton3 As QTButton
        Enabled = 0
        Left = 8
        Top = 68
        NumBMPs =4
        Caption = "Désactivé"
        OnClick = Boutons_Click
        OnMouseMove = Boutons_MouseMove
    End Create
    Create TButton4 As QTButton
        Default = 1
        Left = 8
        Top = 98
        Caption = "Défaut"
        NumBMPs =4
        OnClick = Boutons_Click
        OnMouseMove = Boutons_MouseMove
    End Create
    Create TButton5 As QTButton
        Default = 1
        Left = 8
        Top = 128
        Caption = "&Sous-ligné"
        NumBMPs =4
        OnClick = Boutons_Click
        OnMouseMove = Boutons_MouseMove
        Hint = "Appuyez simultanément ALT+S pour voir ce qui arrivera"
        ShowHint = 1
    End Create
    Create TButton6 As QTButton
        Left = 98
        Top = 8
        Height = 60
        NumBMPs =4
        Caption = "Multi-Lignes" +chr$(10) +"Retaillé" +chr$(10) +"Multi-Lines"
        OnClick = Boutons_Click
        OnMouseMove = Boutons_MouseMove
        Hint = "Pour créer un effet multi-lignes ajoutez chr$(10) " +chr$(10) +_
               "entre les mots où vous voulez créer l'effet."
        ShowHint = 1
    End Create
    Create TButton7 As QTButton
        Left = 98
        Top = 98
        Height = 20
        Width = 20
        Caption = "..."
        NumBMPs =4
        OnClick = Boutons_Click
        OnMouseMove = Boutons_MouseMove
    End Create
    Create TButton8 As QTButton
        Left = 128
        Top = 98
        Height = 20
        Width = 20
        NumBMPs =4
        Hint = "Vide"
        ShowHint = 1
        OnClick = Boutons_Click
        OnMouseMove = Boutons_MouseMove
    End Create
    Create TButton9 As QTButton
        BMP = ico_BMP.BMP
        Spacing = 1
        Left = 158
        Top = 98
        Height = 20
        Width = 20
        NumBMPs =4
        Hint = "Avec uniquement une image"
        ShowHint = 1
        OnClick = Boutons_Click
        OnMouseMove = Boutons_MouseMove
    End Create
    Create TButton10 As QTButton
        kind = 2
        Left = 188
        Top = 8
        NumBMPs =4
        Caption = "Fermer"
        Hint = "Un QTButton avec Kind = 1"
        ShowHint = 1
        OnClick = Boutons_Click
        OnMouseMove = Boutons_MouseMove
    End Create
    Create TButton11 As QButton
        kind = 2
        Left = 188
        Top = 38
        Caption = "Fermer"
        Hint = "Un bouton classic avec Kind = 1"
        ShowHint = 1
        OnMouseMove = QBouton_MouseMove
        OnMouseUp = QBouton_MouseUp
        OnClick = Boutons_Click
    End Create
    Create TButton12 As QButton
        Left = 188
        Top = 68
        Caption = "&Classique"
        Hint = "Un bouton classic"
        ShowHint = 1
        OnMouseMove = QBouton_MouseMove
        OnMouseUp = QBouton_MouseUp
        OnClick = Boutons_Click
    End Create
    Create TButton13 As QTButton
        Left = 188
        Top = 98
        BMP = ico_BMP.BMP
        'BMPHandle = ico_BMP
        NumBMPs = 4
        Caption = "Bitmap"
        Hint = "Un bouton avec une image"
        ShowHint = 1
        OnClick = Boutons_Click
        OnMouseMove = Boutons_MouseMove
    End Create
    Create TButton14 As QTButton
        Layout = 2
        Left = 188
        Top = 128
        BMP = ico_BMP.BMP
        'BMPHandle = ico_BMP
        Height = 40
        Spacing = 3
        NumBMPs = 4
        Caption = "Au dessus"
        Hint = "Un bouton avec une image placée au dessus du texte"
        ShowHint = 1
        OnClick = Boutons_Click
        OnMouseMove = Boutons_MouseMove
    End Create
    Create TButton15 As QTButton
        Layout = 2
        Left = 302
        Top = 8
        Height = 20
        Width = 20
        Spacing = 3
        NumBMPs = 4
        Font.Bold = 1
        Caption = ">"
        Hint = "Alterner l'enjolivure"
        ShowHint = 1
        OnClick = Enjolivure_Click
        OnMouseMove = Boutons_MouseMove
    End Create
    CREATE TButton16 AS QTButton
        Left = 288
        Top = 48
        Width = 23
        Height = 22
        NumBMPs = 4
        GroupIndex = 1
    END CREATE
    CREATE TButton17 AS QTButton
        Left = 288
        Top = 72
        Width = 23
        Height = 22
        NumBMPs = 4
        GroupIndex = 1
    END CREATE
    CREATE TButton18 AS QTButton
        Left = 288
        Top = 96
        Width = 23
        Height = 22
        NumBMPs = 4
        GroupIndex = 1
    END CREATE
    CREATE TButton19 AS QTButton
        Left = 288
        Top = 128
        Width = 23
        Height = 22
        NumBMPs = 4
        GroupIndex = 2
    END CREATE
    CREATE TButton20 AS QTButton
        Left = 288
        Top = 152
        Width = 23
        Height = 22
        NumBMPs = 4
        GroupIndex = 2
    END CREATE
    Create Image As QImage
        AutoSize = 1
        Top = 128
        Left = 98
        BMP = QTBtnBMP.BMP
    End Create
    Create Label1 As QLabel
        Top = 158
        Left = 8
        Caption = "Image du bouton / Button bitmap :"
    End Create
    Create Image1 As QImage
        AutoSize = 1
        Top = 174
        Left = 8
        BMP = QTBtnBMP.BMP
    End Create
End Create

Sub Boutons_Click
    ShowMessage "Vous avez cliqué sur le bouton :  " +sender.caption +chr$(10)+_
                "You've clicked on button :  " +sender.caption
    Image1.BMP = Sender.BMP
End Sub
Sub Boutons_MouseMove

    ' Now that we've insert MouseMove inside our program the internal MouseMove have been
    ' canceled, to combine the new MouseMove event with the internal one, simply add these 
    ' lines; ObjectName.InheritOnMouseMove(x,y,shift)
    ' But what happen when more than one Object use the same SUB event, we need to detect 
    ' which Object call the event, since if we only add ;
    ' ObjectName.InheritOnMouseMove(x,y,shift)
    ' ObjectName2.InheritOnMouseMove(x,y,shift)
    ' ObjectName2 MouseMove event will also fireup when Mouving over ObjectName to resolve 
    ' this we use conditional statements; if , elseif, select case.

    ' Fireup internal mousemove event for the current object
    SELECT CASE Sender.Handle' We use Handle since Caption will not be returned when using
                             ' btns without caption
        Case TButton.Handle: TButton.InheritOnMouseMove(x,y,shift)
        Case TButton2.Handle: TButton2.InheritOnMouseMove(x,y,shift)
        Case TButton3.Handle: TButton3.InheritOnMouseMove(x,y,shift)
        Case TButton4.Handle: TButton4.InheritOnMouseMove(x,y,shift)
        Case TButton5.Handle: TButton5.InheritOnMouseMove(x,y,shift)
        Case TButton6.Handle: TButton6.InheritOnMouseMove(x,y,shift)
        Case TButton7.Handle: TButton7.InheritOnMouseMove(x,y,shift)
        Case TButton8.Handle: TButton8.InheritOnMouseMove(x,y,shift)
        Case TButton9.Handle: TButton9.InheritOnMouseMove(x,y,shift)
        Case TButton10.Handle: TButton10.InheritOnMouseMove(x,y,shift)
        Case TButton13.Handle: TButton13.InheritOnMouseMove(x,y,shift)
        Case TButton14.Handle: TButton14.InheritOnMouseMove(x,y,shift)
        Case TButton15.Handle: TButton15.InheritOnMouseMove(x,y,shift)
    END SELECT

    ' Now our new event
    Image1.BMP = Sender.BMP
End Sub

Sub QBouton_MouseMove
    If (X < 0) Or (Y < 0) Or (X > sender.Width) _
        Or (Y > Sender.Height) Then
        ' le pseudo-evénement MOUSELEAVE
        ' the MOUSELEAVE pseudo-event
        ReleaseCapture_QTBtn
        ' dans cet example, on retourne le caption à la normal
        ' in this example revert the caption to normal
        Sender.Font.Bold = 0
        Sender.Font.Color = -2147483630
        
    ElseIf GetCapture_QTBtn() <> Sender.Handle Then
        ' le pseudo-evénement MOUSEENTER
        ' the MOUSEENTER pseudo-event
        SetCapture_QTBtn Sender.Handle
        ' dans cet example, on met le caption en gras
        ' in this example, make the caption bold
        Sender.Font.Bold = 1
        Sender.Font.Color = -2147483635
        Image1.BMP = Sender.BMP
    End If
End Sub

Sub QBouton_MouseUp
    ReleaseCapture_QTBtn
    Sender.Font.Bold = 0
    Sender.Font.Color = -2147483630
End Sub

Sub Enjolivure_Click(Sender As QTButton)
    Static curSkin As Integer

    If curSkin < 1 Then 
        QTBtnBMP.BMPHandle = btn_BMP1
        curSkin = 1
    Else
        QTBtnBMP.BMPHandle = btn_BMP
        curSkin = 0
    End If
    TButton.ReDraw
    TButton2.ReDraw
    TButton3.ReDraw
    TButton4.ReDraw
    TButton5.ReDraw
    TButton6.ReDraw
    TButton7.ReDraw
    TButton8.ReDraw
    TButton9.ReDraw
    TButton10.ReDraw
    TButton13.ReDraw
    TButton14.ReDraw
    TButton15.ReDraw
 
End Sub

Form.ShowModal