Wednesday 3 November 2010

RefEdit Alternative: Let Textbox Handle it..

One of the most annoyances of VBA was the utility of RefEdit. Though working fine based on its mood of its own, with the trouble of focus and other petty issues.

Recently i stumbled upon a code illustrating the TextBox swiss army knife capabilties of providing a brilliant alternative to RefEdit control. the magic lies in the following code as follows when insetered during the form intiliazation process.

Me.txtRefChtData.DropButtonStyle = fmDropButtonStyleReduce 
'fmDropButtonStylePlain
'fmDropButtonStyleEllipsis
'fmDropButtonStyleArrow
Me.txtRefChtData.ShowDropButtonWhen = fmShowDropButtonWhenAlways

and the event handler for the same goes as follows:

Private Sub txtRefChtData_DropButtonClick()
 'do Somthing.. 
End Sub

and it does the jobs with no compatibiltiy and focus issues..


Download Solution
Download solution

No comments: