|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Combo box to start at first character after user selectsThe text in my combo box is longer than the control can show, when I click on
the down arrow, I can see the whole text, but when I select one of the items, the text box of the combo box shows the end of the text. Due to limited room I can not expanded the combo box control, so I want to show the front of the text and not the default back of the text when a user selects a value. Currently the user selects from the combo box, then has to hit the "home" key to see the beginning of the text. Hi Mike,
To make the cursor scroll to the first character of the line, we can simulate pressing the Home key. We just send a key press message to the control using SendKeys class. Here is an example. Private Sub ComboBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox1.TextChanged SendKeys.Send("{HOME}") End Sub If anything is unclear, please feel free to let me know. Kevin Yu Microsoft Online Community Support ================================================== Get notification to my posts through email? Please refer to http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif ications. Note: The MSDN Managed Newsgroup support offering is for non-urgent issues where an initial response from the community or a Microsoft Support Engineer within 1 business day is acceptable. Please note that each follow up response may take approximately 2 business days as the support professional working with you may need further investigation to reach the most efficient resolution. The offering is not appropriate for situations that require urgent, real-time or phone-based interactions or complex project analysis and dump analysis issues. Issues of this nature are best handled working with a dedicated Microsoft Support Engineer by contacting Microsoft Customer Support Services (CSS) at http://msdn.microsoft.com/subscriptions/support/default.aspx. ================================================== (This posting is provided "AS IS", with no warranties, and confers no rights.) I get the error message, "SendKeys cannot run inside this application because
the application is not handling Windows messages. Either change the application to handle messages, or use the SendKeys.SendWait method." What does that mean? Show quoteHide quote "Kevin Yu [MSFT]" wrote: > Hi Mike, > > To make the cursor scroll to the first character of the line, we can > simulate pressing the Home key. We just send a key press message to the > control using SendKeys class. Here is an example. > > Private Sub ComboBox1_TextChanged(ByVal sender As System.Object, ByVal > e As System.EventArgs) Handles ComboBox1.TextChanged > SendKeys.Send("{HOME}") > End Sub > > If anything is unclear, please feel free to let me know. > > Kevin Yu > Microsoft Online Community Support > > ================================================== > Get notification to my posts through email? Please refer to > http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif > ications. > Note: The MSDN Managed Newsgroup support offering is for non-urgent issues > where an initial response from the community or a Microsoft Support > Engineer within 1 business day is acceptable. Please note that each follow > up response may take approximately 2 business days as the support > professional working with you may need further investigation to reach the > most efficient resolution. The offering is not appropriate for situations > that require urgent, real-time or phone-based interactions or complex > project analysis and dump analysis issues. Issues of this nature are best > handled working with a dedicated Microsoft Support Engineer by contacting > Microsoft Customer Support Services (CSS) at > http://msdn.microsoft.com/subscriptions/support/default.aspx. > ================================================== > > (This posting is provided "AS IS", with no warranties, and confers no > rights.) > > Hi Mike,
Could you let me know what kind of application you're working on? Is it a windows form app? Kevin Yu Microsoft Online Community Support ================================================== (This posting is provided "AS IS", with no warranties, and confers no rights.) Yes, it is a win form app, VB 2003.
Show quoteHide quote "Kevin Yu [MSFT]" wrote: > Hi Mike, > > Could you let me know what kind of application you're working on? Is it a > windows form app? > > Kevin Yu > Microsoft Online Community Support > ================================================== > > (This posting is provided "AS IS", with no warranties, and confers no > rights.) > > Hi Mike,
In VB2003, try to handle the SelectedIndexChanged event like the following: Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles ComboBox1.SelectedIndexChanged SendKeys.Send("{HOME}") End Sub Does this working on your machine? Kevin Yu Microsoft Online Community Support ================================================== (This posting is provided "AS IS", with no warranties, and confers no rights.)
Best way to get a Junior Programmer up to speed
Re: Is VB.NET Stable?? To Aaron Kemp - Ahole Extrordinare String to Byte & Vice Versa Exposing Com Interfaces of a .Net Class Library (Trouble Regsvr32) deployment of project migrating MSDE to SQLExpress End Processing in Multithreaded App Cross-thread operation not valid. catching close button Transparent text box. Calculate inside a form and use the same form as Insert record form |
|||||||||||||||||||||||