Real Software Forums

The forum for Real Studio and other Real Software products.
[ REAL Software Website | Board Index ]
It is currently Sun Sep 15, 2019 9:16 am
xojo

All times are UTC - 5 hours




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Noob question again about list boxes
PostPosted: Thu Sep 09, 2010 7:35 am 
Offline

Joined: Thu Dec 10, 2009 2:00 pm
Posts: 101
Location: Calafornia
Let me start off by saying I know I am asking a lot questions, about simple things..to some people... but I am new to programming, and some of the stuff that I have seen in RB just makes me ask... more questions..

for instance the example on list-boxes move items form list1 to list2,
the code is different in the documentation than in the example that ships with real basic.

not a biggie, but it does not get deep into programming. I have bought The Novice book on RB but that touches the surface as well.

well here is my additional question on List boxes,

if using the example that comes with RS to move items in list 1 to list 2, how do you handle multiple columns.

Here is the base code from the docs. on dragrow event. it only ids the first column, how D/O i get the 2nd, 4rd so on.

Does it need to go into an array? then the same on the accpet drag event would have to be defined as well.

some of the things that I thought were inherent were if the list boxes were set up the same and you said select row that it actually meant row not cell. on another post I found that out....

Drag.PrivateRawData("text")=Me.List(Row)+EndOfLine //get the text
Me.RemoveRow(Row)
Return True //allow the drag

so based on this example how would you define a multi-column drag event


Top
 Profile  
Reply with quote  
 Post subject: Re: Noob question again about list boxes
PostPosted: Thu Sep 09, 2010 8:09 am 
Offline

Joined: Thu Dec 10, 2009 2:00 pm
Posts: 101
Location: Calafornia
Ok So I figured out how to grab multiple columns, (see code below) and drag them to a second list box. Problem I have now is that they get placed into the index column 0 on list box two does anyone now how to keep them separate?

list box 1

drag row
Drag.Text=me.cell(me.Listindex,0) + me.cell(me.listindex,1) + me.cell(me.listindex,2) ',1,2,3)

return True

list box 2

open event
me.AcceptTextDrop

drop object
if obj.TextAvailable then

me.AddRow(obj.text)
end if


Top
 Profile  
Reply with quote  
 Post subject: Re: Noob question again about list boxes
PostPosted: Fri Sep 10, 2010 6:00 pm 
Offline

Joined: Thu Feb 22, 2007 7:08 pm
Posts: 1384
The code below is not quite tested but should work.
Property:
Drop(-1) As String

ListBox1.DragRow:
redim drop(-1)

drop.append(me.cell(me.listindex, 0))
drop.append(me.cell(me.listindex, 1))

return true

ListBox2.Open:
me.accepttextdrop

ListBox2.DropObject:
me.addrow("")
me.cell(me.lastindex, 0) = drop(0)
me.cell(me.lastindex, 1) = drop(1)


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 5 hours


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group