Is this possible? The issue I'm having is I have 3 items in my combobox however when I maximize my window the items do not enlarge and are the same size(or relative) to what they were prior to maximizing, hence overlapping. Is there a way? I've ony known how to increase width.
Increase height of combobox drop down list?
Page 1 of 112 Replies - 2195 Views - Last Post: 10 April 2012 - 07:30 PM
Replies To: Increase height of combobox drop down list?
#2
Re: Increase height of combobox drop down list?
Posted 04 April 2012 - 08:46 AM
None of your other controls resize relatively automatically either - unless you have written code to do that or used the Anchor property on everything to make them resize.
I can't visualize what you are describing as the problem. The items in the combo box aren't resizing. So. That's pretty normal. How is it a problem? Can you show us screenshots? In this case a picture really is worth a thousand words.
I can't visualize what you are describing as the problem. The items in the combo box aren't resizing. So. That's pretty normal. How is it a problem? Can you show us screenshots? In this case a picture really is worth a thousand words.
#3
Re: Increase height of combobox drop down list?
Posted 04 April 2012 - 09:28 AM
Also, a combobox, much like a single line textbox has no changable height. In order to scale the height of a combobox you have to increase the size of the font it contains.
So if you were to try
Would result in 21 as that is the default height for the default VS font used.
But if you were to try
The combobox would grow to fit the new font in height.
And you would receive a message box showing 54 as that is the height it grew to from setting the default fontsize to 30.
You might look at this link on resizing controls with forms
So if you were to try
Combobox1.Height = 150 msgbox(Combobox1.Height)
Would result in 21 as that is the default height for the default VS font used.
But if you were to try
Combobox1.Font = New Font(Combobox1.Font.Name, 30) msgbox(Combobox1.Height
The combobox would grow to fit the new font in height.
And you would receive a message box showing 54 as that is the height it grew to from setting the default fontsize to 30.
You might look at this link on resizing controls with forms
This post has been edited by CharlieMay: 04 April 2012 - 09:33 AM
#4
Re: Increase height of combobox drop down list?
Posted 04 April 2012 - 11:35 AM
Thanks for the replies, I have attached a pic of what is currently happening. The modifying the text solution could work as a temporary solution however in order for it to not overlap I have to drastically reduce the text size(13) which makes it stand out(in a bad way
) compared to the rest of the enlarged form.
Attached File(s)
-
cbo.bmp (164.55K)
Number of downloads: 100
#5
Re: Increase height of combobox drop down list?
Posted 04 April 2012 - 11:53 AM
i believe you need to set the integral height property of the combo boxes to true. that should fix the boxes so they dont show partial items.
#6
Re: Increase height of combobox drop down list?
Posted 04 April 2012 - 11:55 AM
To make life easier on everyone else, here is the image included in a post so you don't have to download it.
#7
Re: Increase height of combobox drop down list?
Posted 04 April 2012 - 12:00 PM
It would appear that you have either set your Combobox DropDownHeight too low or you need to adjust it by setting to something that will show the dropdown text properly.
In my example above where I changed the font, If I were to populate that combobox and set the dropdownheight to something like 30 I would see the same results. Play around with that and see what you come up with.
In my example above where I changed the font, If I were to populate that combobox and set the dropdownheight to something like 30 I would see the same results. Play around with that and see what you come up with.
#8
Re: Increase height of combobox drop down list?
Posted 04 April 2012 - 12:08 PM
Thanks for uploading the image, I don't have access to any hosting sites at work, I appreciate it 
Charlie, I will check those settings and mess around with it. With your example, I put in 30, the text was enlarged but it was even more overlapped than the pic, I will see if there is a dropdown height property to set, I appreciate all the help.
Charlie, I will check those settings and mess around with it. With your example, I put in 30, the text was enlarged but it was even more overlapped than the pic, I will see if there is a dropdown height property to set, I appreciate all the help.
#9
Re: Increase height of combobox drop down list?
Posted 10 April 2012 - 02:42 PM
Issue is still persisting, sadly.
I did find out that it's a custom drawn combobox, if that helps.
The color and brush are delcared earlier, is there something i'm missing here that is causing the dropdownlist height to not resize upon maximizing? It's required that I have a custom drawn combobox in case some items in the combobox are ever longer than the combobox length.
I did find out that it's a custom drawn combobox, if that helps.
e.Graphics.FillRectangle(bgbrush, e.Bounds)
Dim r As New RectangleF(e.Bounds.X, e.Bounds.Y, e.Bounds.Width, e.Bounds.Height)
If e.Index >= 0 Then
e.Graphics.DrawString(comboObj.Items(e.Index).ToString, txtfnt, bgbrush, x, y)
End If
e.DrawFocusRectangle()
The color and brush are delcared earlier, is there something i'm missing here that is causing the dropdownlist height to not resize upon maximizing? It's required that I have a custom drawn combobox in case some items in the combobox are ever longer than the combobox length.
#10
Re: Increase height of combobox drop down list?
Posted 10 April 2012 - 03:04 PM
I don't know, perhaps try the SizeChanged event of the form.
#11
Re: Increase height of combobox drop down list?
Posted 10 April 2012 - 04:33 PM
Why not just use the .DropdownWidth property of the standard combobox?
You could probably even write a routine to get the width of the longest text in the collection and size the dropdownwidth accordingly.
Of course you would have to use Net Framework 4 for this feature.
You could probably even write a routine to get the width of the longest text in the collection and size the dropdownwidth accordingly.
Of course you would have to use Net Framework 4 for this feature.
#12
Re: Increase height of combobox drop down list?
Posted 10 April 2012 - 05:09 PM
Charlie: You're talking width while the OP is talking about a problem with HEIGHT of each item.
#13
Re: Increase height of combobox drop down list?
Posted 10 April 2012 - 07:30 PM
Quote
It's required that I have a custom drawn combobox in case some items in the combobox are ever longer than the combobox length.
tlhIn`toqYea, you're probably right, I guess I read length as the length of the text in the combobox. Not the amount of items in the dropdown.
But then that leaves me with why does it have to be owner-drawn to handle this? The font size will determine the height of the combobox. The DropDownHeight can handle the height and the dropdownwidth can handle the width. There's even a .MaxDropDownItem.
And even with owner-drawn, there is the ItemHeight property. The only issue is, I think all of these only fall under version 4 of the framework.
Page 1 of 1
|
|

New Topic/Question
Reply



MultiQuote






|