Print Page | Close Window

COM - VB - XAML Colourpicker Combo

Printed From: Codejock Forums
Category: General
Forum Name: Samples and Demo Applications
Forum Description: Post your samples and demo applications here.
URL: http://forum.codejock.com/forum_posts.asp?TID=10631
Printed Date: 26 April 2024 at 6:31pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: COM - VB - XAML Colourpicker Combo
Posted By: Boris
Subject: COM - VB - XAML Colourpicker Combo
Date 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



Replies:
Posted By: ijwelch
Date Posted: 16 May 2008 at 11:13pm
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



Posted By: Boris
Date Posted: 19 May 2008 at 10:21am
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


Posted By: ijwelch
Date Posted: 19 May 2008 at 9:54pm
This site has a little info and loads of links:

http://www.xaml.net/index.html - http://www.xaml.net/index.html



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net