Setting the width of the autocomplete drop-down list in the text box

I am using a text box in a .NET 2 winforms application that is customizable using custom autocomplete. Is there anyway code that I can increase the width of the list that appears with offers with a full set of sentences?

Ideally, I would like to do this without increasing the width of the text field, since I do not have enough space in the user interface.

+5
source share
3 answers

, , , , , , .

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=3311429&SiteID=1

Public Class Form1
Private WithEvents T As TextBox
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    T = New TextBox
    T.SetBounds(20, 20, 100, 30)
    T.Font = New Font("Arial", 12, FontStyle.Regular)
    T.Multiline = True
    T.Text = "Type Here"
    T.SelectAll()
    Controls.Add(T)
End Sub
Private Sub T_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles T.TextChanged
    Dim Width As Integer = TextRenderer.MeasureText(T.Text, T.Font).Width + 10
    Dim Height As Integer = TextRenderer.MeasureText(T.Text, T.Font).Height + 10
    T.Width = Width
    T.Height = Height
End Sub

+1

, . , , ( API Windows) TextBox, , .

0

, TextBox API , Windows. , .NET.

0

All Articles