1. How to get ellipsis () when you press Alt+Ctrl+(.) in a textbox (like in Word97) Top

Of course you can just check when a user press Alt+Ctrl+(.) in the textbox KeyDown event and type the ellipsis yourself. Yes, but a dot (.) will appear directly after the ellipsis. I found a way how you can escape typing a dot. See the following code:

Private Sub TextBox1_KeyDown(KeyCode As Integer, Shift As Integer) 
  If KeyCode = 190 Then            ' 190 is a code for the dot (.) 
      If Shift = vbCtrlMask + vbAltMask Then 
         TextBox1.SelText = Chr(133)' 133 is a code for the ellipsis (...) 
        ' You need to lock the textbox to avoid typing the dot 
         TextBox1.Locked = True 
      End If 
  End If 
End Sub 


Private Sub TextBox1_KeyUp(KeyCode As Integer, Shift As Integer) 
   If KeyCode = 190 Then 
      If Shift = vbCtrlMask + vbAltMask Then 
        ' You need to unlock the textbox to give an opportunity 
        ' to a user to type a text further
         TextBox1.Locked = False 
      End If 
   End If 
End Sub
Home Top