Results 1 to 7 of 7

Thread: How to customize Autocomplete font size?!

  1. #1

    Thread Starter
    Lively Member HOTFIX's Avatar
    Join Date
    Sep 2008
    Posts
    91

    Question How to customize Autocomplete font size?!

    Hi…

    I'm looking for vb.net codes to customize font size for autocomplete feature which populating suggestions from database column…

    Name:  autocomplete.jpg
Views: 3839
Size:  28.2 KB

    These are the codes from my project :
    Code:
     Dim cmd = New OleDbCommand("Select [Item 1] from tabel", Me.Conn)
                Dim reader = cmd.ExecuteReader()
                Dim list As New AutoCompleteStringCollection
                While reader.Read
                    list.Add(reader.Item("Item 1"))
                End While
                tbx.AutoCompleteMode = AutoCompleteMode.SuggestAppend
                tbx.AutoCompleteSource = AutoCompleteSource.CustomSource
                tbx.AutoCompleteCustomSource = list
    Any idea please

    Regards…

  2. #2
    Karen Payne MVP kareninstructor's Avatar
    Join Date
    Jun 2008
    Location
    Oregon
    Posts
    6,713

    Re: How to customize Autocomplete font size?!

    Not sure about what you mean by font size as all you need to do is set the font property of the TextBox to the size you want.

    Code:
            Me.TextBox1.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, _
                                   System.Drawing.FontStyle.Regular, _
                                   System.Drawing.GraphicsUnit.Point, CType(0, Byte))

    Does not matter if it comes from a database the concept is the same.

  3. #3

    Thread Starter
    Lively Member HOTFIX's Avatar
    Join Date
    Sep 2008
    Posts
    91

    Re: How to customize Autocomplete font size?!

    Quote Originally Posted by kevininstructor View Post
    Not sure about what you mean by font size as all you need to do is set the font property of the TextBox to the size you want.

    Code:
            Me.TextBox1.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, _
                                   System.Drawing.FontStyle.Regular, _
                                   System.Drawing.GraphicsUnit.Point, CType(0, Byte))

    Does not matter if it comes from a database the concept is the same.


    Hi "kevininstructor"…

    Thanks for reply…

    Actually I'm looking how to make the autocomplete text font size bigger!? That is the "pop list" which appears below the textbox (not the textbox itself)!

    I hope my "Q." is clear now...

    Any suggestions PLZ…

  4. #4
    Karen Payne MVP kareninstructor's Avatar
    Join Date
    Jun 2008
    Location
    Oregon
    Posts
    6,713

    Re: How to customize Autocomplete font size?!

    Quote Originally Posted by HOTFIX View Post
    Hi "kevininstructor"…

    Thanks for reply…

    Actually I'm looking how to make the autocomplete text font size bigger!? That is the "pop list" which appears below the textbox (not the textbox itself)!

    I hope my "Q." is clear now...

    Any suggestions PLZ…
    Look at making the ComboBox Draw mode DrawMode.OwnerDrawVariable and handle drawing the list manually in the DrawItem event of the ComboBox.

  5. #5
    PowerPoster
    Join Date
    Apr 2007
    Location
    The Netherlands
    Posts
    5,070

    Re: How to customize Autocomplete font size?!

    Quote Originally Posted by kevininstructor View Post
    Look at making the ComboBox Draw mode DrawMode.OwnerDrawVariable and handle drawing the list manually in the DrawItem event of the ComboBox.
    There is no ComboBox, he is talking about the AutoComplete list that pops up. I doubt custom drawing the TextBox would have any effect here (as the AutoComplete popup is likely a different control).

    That said, I have no idea how to do what you want, yet it seems like a simple request... From half a minute of googling (I hope you did more) it doesn't seem to be possible, at least not in any simple way.

    The only option I can see at this point is implementing your own AutoComplete list. Not very difficult to get the basics working, but getting it to behave exactly like a real AutoComplete list is probably complex.

  6. #6
    Karen Payne MVP kareninstructor's Avatar
    Join Date
    Jun 2008
    Location
    Oregon
    Posts
    6,713

    Re: How to customize Autocomplete font size?!

    Quote Originally Posted by NickThissen View Post
    There is no ComboBox, he is talking about the AutoComplete list that pops up. I doubt custom drawing the TextBox would have any effect here (as the AutoComplete popup is likely a different control).

    That said, I have no idea how to do what you want, yet it seems like a simple request... From half a minute of googling (I hope you did more) it doesn't seem to be possible, at least not in any simple way.

    The only option I can see at this point is implementing your own AutoComplete list. Not very difficult to get the basics working, but getting it to behave exactly like a real AutoComplete list is probably complex.
    In regards to no ComboBox, seems my eyes saw something different than what was there.

    Concerning
    Quote Originally Posted by NickThissen View Post
    implementing your own AutoComplete list
    You would think this would be easy but as you mentioned it is a different control and to get it to match up with the behavior of existing auto complete but I think unless it is a deal breaker it is a lot of work to create a custom control to do this. I wonder what happens if setting where changed under Window's Accessibility setting would help or setting font size to Large.

  7. #7

    Thread Starter
    Lively Member HOTFIX's Avatar
    Join Date
    Sep 2008
    Posts
    91

    Re: How to customize Autocomplete font size?!

    THANKS NickThissen,kevininstructor ...


    As I have done research over the web(google,msdn,CodeProject...etc) !
    I can see the only way be done is using custom control, so hopefully someone develops a basic "AutoComplete" custom user control for such novice programmer which can set the font size, appearance and color ...

    Regards...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width