Print Page | Close Window

List Box Question

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: ActiveX COM
Forum Description: Topics related to Codejock ActiveX COM products
URL: http://forum.codejock.com/forum_posts.asp?TID=13021
Printed Date: 23 November 2024 at 5:20am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: List Box Question
Posted By: arezoosaboori
Subject: List Box Question
Date Posted: 27 December 2008 at 4:32am
Hi,
I use this code to add items to a list box:

       ListBoxMarkup.AddItem "<Border BorderThickness='2' BorderBrush='DodgerBlue' Margin='0, 2, 0, 2' Padding='3'><StackPanel Orientation='Horizontal'>" & _
       "<Image Source='100'/>" & _
       "<Grid><Grid.ColumnDefinitions><ColumnDefinition Width='Auto'/><ColumnDefinition Width='*'/></Grid.ColumnDefinitions>" & _
       "<Grid.RowDefinitions><RowDefinition/><RowDefinition/></Grid.RowDefinitions>" & _
       "<TextBlock TextAlignment='Right' FontWeight='Bold' Foreground='Navy' Text='IP:'/>" & _
       "<TextBlock TextAlignment='Right' Grid.Row='1' FontWeight='Bold' Foreground='Navy' Text='Country:'/>" & _
       "<TextBlock Margin='6, 0, 0, 0' Grid.Column='1' Text='" & MyResult(0) & "'/>" & _
       "<TextBlock Margin='6, 0, 0, 0'  Grid.Column='1' Grid.Row='1'  Text='" & "Loopback" & "'/>" & _
       "</Grid></StackPanel></Border>"

And result is like this:



There are 4 items added to the list box, I just want the 2 inner items with flags to be changed : I want flags in the right .
Is that possible to only move icons/flags to the right?
Thank you for your help :)






Replies:
Posted By: Oleg
Date Posted: 29 December 2008 at 3:11am
So just change order of Image and Grid.
Move
"<Image Source='100'/>"
after
</Grid>


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: arezoosaboori
Date Posted: 29 December 2008 at 6:18am
Hello and thank you very much for your tip
That works but still items are sticky and not having a good view!
So can I send icons to the right corner?
Where marked in this picture?
Thank you a lot




Posted By: Oleg
Date Posted: 30 December 2008 at 5:52am
Hi,
 
Try this
 
ListBoxMarkup.AddItem "<Border BorderThickness='2' BorderBrush='DodgerBlue' Margin='0, 2, 0, 2' Padding='3'><Grid>" & _
       "<Grid><Grid.ColumnDefinitions><ColumnDefinition Width='Auto'/><ColumnDefinition Width='*'/></Grid.ColumnDefinitions>" & _
       "<Grid.RowDefinitions><RowDefinition/><RowDefinition/></Grid.RowDefinitions>" & _
       "<TextBlock TextAlignment='Right' FontWeight='Bold' Foreground='Navy' Text='IP:'/>" & _
       "<TextBlock TextAlignment='Right' Grid.Row='1' FontWeight='Bold' Foreground='Navy' Text='Country:'/>" & _
       "<TextBlock Margin='6, 0, 0, 0' Grid.Column='1' Text='Hi'/>" & _
       "<TextBlock Margin='6, 0, 0, 0'  Grid.Column='1' Grid.Row='1'  Text='" & "Loopback" & "'/>" & _
       "</Grid>" & _
       "<Image HorizontalAlignment='Right' Source='100'/>" & _
        "</Grid></Border>"


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS



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