Another ComboBox Markup Issue |
Post Reply |
Author | |
ScottW
Groupie Joined: 02 August 2005 Status: Offline Points: 82 |
Post Options
Thanks(0)
Posted: 04 February 2009 at 10:54am |
I can send an actual sample project if necessary, but to replicate this, just create a form with an ImageManager control and a ComboBox with DropdownList style. Add a single Icon to the ImageManager with ID 101. It should be a 16x16 icon. Then paste in this code and run. In the dropdown, it all looks great, but the selected item has the text clipped at the bottom. I tried using VerticalAlignment tag to bring the text up, but it doesn't seem to do anything. How can I fix this?
Private Sub Form_Load() SuiteControlsGlobalSettings.Icons.AddIcons ImageManager1.Icons With ComboBox1 .EnableMarkup = True .AddItem "<TextBlock><Image Width='16' Height='16' Source='101' />Item 1</TextBlock>" .AddItem "<TextBlock><Image Width='16' Height='16' Source='101' />Item 2</TextBlock>" .AddItem "<TextBlock><Image Width='16' Height='16' Source='101' />Item 3</TextBlock>" .ListIndex = 0 End With End Sub |
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
Hi,
try to move Image from TextBlock:
.AddItem "<StackPanel Orientation="Hirizontal"><Image Width='16' Height='16' Source='101'/><TextBlock>Item 1</TextBlock></StackPanel>"
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
jpbro
Senior Member Joined: 12 January 2007 Status: Offline Points: 1355 |
Post Options
Thanks(0)
|
I think that this happens because the ComboBox height is locked to the font height, regardless of the markup size (try changing the height of the combobox and you'll see that it always snaps back to a certain size). You can workaround this by setting the font size of the ComboBox to something larger than you are using for your markup text, and then explicitly declare you TextBox font size as the smaller font size that you actually want...
For example:
Note that I've also added the Run tag with a center Baseline alignment to keep the text aligned nicely with the image. |
|
Product: Xtreme SuitePro (ActiveX) version 16.2.6
Platform: Windows XP - SP3 Language: Visual Basic 6.0 SP6 |
|
jpbro
Senior Member Joined: 12 January 2007 Status: Offline Points: 1355 |
Post Options
Thanks(0)
|
Or Oleg's method seems to work ;)
Just change "Hirizontal" to "Horizontal" |
|
Product: Xtreme SuitePro (ActiveX) version 16.2.6
Platform: Windows XP - SP3 Language: Visual Basic 6.0 SP6 |
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
:) |
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |