Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Controls
  New Posts New Posts RSS Feed - ItemData for Listbox
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

ItemData for Listbox

 Post Reply Post Reply
Author
Message
tobi View Drop Down
Senior Member
Senior Member
Avatar

Joined: 09 September 2004
Location: Germany
Status: Offline
Points: 451
Post Options Post Options   Thanks (0) Thanks(0)   Quote tobi Quote  Post ReplyReply Direct Link To This Post Topic: ItemData for Listbox
    Posted: 13 April 2009 at 10:21am
Hi,

in my c# application I want to add items to the CJ Listbox and then set something like Tag or ItemData to the
corresponding database ID ...

I think ItemData is the right thing, but how can I set it after or while adding a new item ?

Thanks
Back to Top
jpbro View Drop Down
Senior Member
Senior Member
Avatar

Joined: 12 January 2007
Status: Offline
Points: 1354
Post Options Post Options   Thanks (0) Thanks(0)   Quote jpbro Quote  Post ReplyReply Direct Link To This Post Posted: 13 April 2009 at 10:30am
You should use the NewIndex property for the ItemData index parameter immediately after you add the new item using the AddItem method. In VB6 your code would look like this:


For i = 0 to 9
   Me.ComboBox1.AddItem "Test" & i
   Me.ComboBox1.ItemData(Me.ComboBox1.NewIndex) = i
Next i


You should be able to infer the C# code from that. (This code sets the ItemData property for each newly added item to the value in the counter "i", you wuold change that to be your database index #).
Product: Xtreme SuitePro (ActiveX) version 16.2.6
Platform: Windows XP - SP3

Language: Visual Basic 6.0 SP6

Back to Top
tobi View Drop Down
Senior Member
Senior Member
Avatar

Joined: 09 September 2004
Location: Germany
Status: Offline
Points: 451
Post Options Post Options   Thanks (0) Thanks(0)   Quote tobi Quote  Post ReplyReply Direct Link To This Post Posted: 13 April 2009 at 11:42am
In c# and with ListBox the ItemData method is not listed in context menu ???
Back to Top
jpbro View Drop Down
Senior Member
Senior Member
Avatar

Joined: 12 January 2007
Status: Offline
Points: 1354
Post Options Post Options   Thanks (0) Thanks(0)   Quote jpbro Quote  Post ReplyReply Direct Link To This Post Posted: 13 April 2009 at 8:54pm
I see the ItemData property in VB6 with version 13.0.0. What version of the suite controls are you using?
Product: Xtreme SuitePro (ActiveX) version 16.2.6
Platform: Windows XP - SP3

Language: Visual Basic 6.0 SP6

Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 14 April 2009 at 12:47am
Hi,
 
.NET renames it to set_ItemData:
 
axListBox1.set_ItemData(...)
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.172 seconds.