COM - VB - XAML Colourpicker Combo |
Post Reply |
Author | |
Boris
Senior Member Joined: 21 June 2007 Location: United Kingdom Status: Offline Points: 179 |
Post Options
Thanks(0)
Posted: 15 May 2008 at 5:14am |
Hi Oleg, Thanks for your recent help with Markup.
Can you also point me in the right direction to create a small block of colour before any text appears in the list when using a combo with markup. I need to show a user defined colour before some text which is also user defined. Something like the attached image .... The control I am using here is from vbaccellerator and is the OwnerDrawComboList. I need to create these colours when the combo loads as the user can change the colours in system settings so icons etc are out. Can you help I'm rather stumped?
Regards
|
|
Boris
Product: Xtreme SuitePro (ActiveX) version 16.4.0 16.3.1 Platform: Windows XP (32bit) - SP 3 Language: Visual Basic 6.0 SP6 VS 2005-2008-2010-2013 |
|
ijwelch
Senior Member Joined: 20 June 2006 Status: Offline Points: 262 |
Post Options
Thanks(0)
|
Try the following sub to add each item to list:
Private Sub pAddComboItem(lColor As Long, sText As String, Optional lData As Long = 0) Dim sColor As String Dim lRed As Long, lGreen As Long, lBlue As Long lRed = lColor And &HFF lGreen = (lColor And &HFF00&) \ &H100& lBlue = (lColor And &HFF0000) \ &H10000 sColor = Right$("0" & Hex$(lRed), 2) & Right$("0" & Hex$(lGreen), 2) & Right$("0" & Hex$(lBlue), 2) ComboBoxMarkup.AddItem "<StackPanel Orientation='Horizontal'>" & _ "<Rectangle Fill='#" & sColor & "' Stroke='#000000' Width='14' Height='14'/>" & _ "<TextBlock Padding = '2' VerticalAlignment='Center'>" & sText & "</TextBlock></StackPanel>" ComboBoxMarkup.ItemData(ComboBoxMarkup.NewIndex) = lData End Sub |
|
Boris
Senior Member Joined: 21 June 2007 Location: United Kingdom Status: Offline Points: 179 |
Post Options
Thanks(0)
|
Hi,
That worked a treat!!
I am having trouble with this as I have never used markup before. I have always managed to avoid using it. Could you point me to somewhere where I could get some online help in understanding mark up.?
Regards
|
|
Boris
Product: Xtreme SuitePro (ActiveX) version 16.4.0 16.3.1 Platform: Windows XP (32bit) - SP 3 Language: Visual Basic 6.0 SP6 VS 2005-2008-2010-2013 |
|
ijwelch
Senior Member Joined: 20 June 2006 Status: Offline Points: 262 |
Post Options
Thanks(0)
|
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 |