gettingstarted
[Top] [All Lists]

How to populate a ListBox from another window

To: Getting Started <gettingstarted at lists dot realsoftware dot com>
Subject: How to populate a ListBox from another window
From: Greg Olson-Hyde <isomfield at optusnet dot com dot au>
Date: Sat, 28 Aug 2004 14:02:37 +1000
Delivered-to: gettingstarted at lists dot realsoftware dot com
G'day all,

I have ListBox1 on a sheet window that I want to be empty and generic, then populated with different data depending on the window that opened it.

The data is small (15 rows max) and fixed for each window that I wish to use to populate ListBox1. If I put the following into the InitialValue property of ListBox1, it works, but it is not generic:

Head1   Head2   Head3
Data1.1 Data1.2 Data1.3
Data2.1 Data2.2 Data2.3...

I can get the data into ListBox1 from WITHIN the sheet window using an 'If' to check which window opened the sheet, then loading the relevant data:

  ListBox1.heading(-1)= "Head1"+Chr(9)+"Head2"+Chr(9)+"Head3"
  ListBox1.addrow ""
  ListBox1.cell(0,0)="Data1.1"
  ListBox1.cell(0,1)="Data1.2"
  ListBox1.cell(0,2)="Data1.3"
  ListBox1.addrow ""
  ListBox1.cell(1,0)="Data2.1"
  ListBox1.cell(1,1)="Data2.2"
  ListBox1.cell(1,2)="Data2.3"
etc.

I actually have 2 questions:

1. How can I get data into ListBox1 from another window? (just to make it more OOP) 2. Entering the data into the InitialValue property of a ListBox is so straight forward and easy, 'Tabs' and 'Returns'. Does it need to be as 'convoluted' as I have it above to add data to an empty ListBox, can you 'addrow' using one line like the headings? (I have tried but can't)

RB 5.5.2, Mac OS X 10.3.5
Cheers

Greg
Sydney Australia

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://www.realsoftware.com/listarchives/lists.html>

<Prev in Thread] Current Thread [Next in Thread>