Step to use the subclassing control

 

  1. Unzip the subclassing.zip file. Run setup.exe in order to install the control and register it.
  2.  

  3. Open Visual Basic and click on a standard EXE.
  4. From the main menu select project -> Component…

    Make sure to select SubClassing Control 1.1

     

  5. From the ToolBar select the Big S of subclassing and plug the control on form1
  6.  

     

  7. Plug on form1 also a textbox
  8.  

     

  9. In the Form_Load event write:
  10. Private Sub Form_Load()

    SubClassingCtl1.SetControlHandle(SubClassingCtl1) = Text1.hWnd

    End Sub

     

  11. In the SubClassingCtl1_Message event write:
  12. Private Sub SubClassingCtl1_Message(msg As Long, wp As Long, lp As Long, Hwnd As Long)

    If msg = SubClassing.WM_RBUTTONUP Then

    MsgBox ("control Subclassed")

    SubClassingCtl1.StopMessage = True

    End If

    End Sub

     

  13. Press F5
  14.  

  15. Click with the right button on the text box.
    If every thing worked well instead of the standard menu it should appear a message box
    You have just changed the behavior of the text box.

 

1