|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
arraylist to use in another formI'm not seeing things right today. I have an arraylist I create and load
in one form. To display the information from the array list I'm opening a richtextbox in another form - stupid time - how do I pass the array list to the load function of the new form?? //al al jones wrote:
> I'm not seeing things right today. I have an arraylist I create and load Class FormArrayListPassing> in one form. To display the information from the array list I'm opening a > richtextbox in another form - stupid time - how do I pass the array list to > the load function of the new form?? > > //al dim mArrayList as ArrayList sub New(iArrayList as ArrayList) initializeComponents mArrayList = iArrayList end sub End Class Well...
Might be a hundred ways to do this... Don't worry I won't and can't enumerate all hundred ;-) 1. Create a Public property of type Arraylist within the New form. Before showing this newForm, set the value of the property to your ArrayList. 2. Create an overloaded Sub New procedure (constructor) for your New form, which accepts an ArrayList as parameter. Then call that method instead of the usual constructor. Rest of the 98 ways... umm... maybe next time ? lolz Regards, Cerebrus. On Sun, 09 Apr 2006 16:23:39 GMT, al jones wrote:
> I'm not seeing things right today. I have an arraylist I create and load I'm not really talking to myself - thank you both. Once I see what your> in one form. To display the information from the array list I'm opening a > richtextbox in another form - stupid time - how do I pass the array list to > the load function of the new form?? > > //al code does Chris (thanks to Marks suggestion) it makes sense. There are days I'd love to go back to the simplicity of codeing COBOL for a mainframe - and then there are days where I'd gladly drop every computer I have off the top of the Eiffel Tower! Thank you both //al Al in the same way as you would do it in Cobol if that was a Call by
overloading the Sub New in your second form. But mostly is it easier to make in this case your arraylist friend in form 1 Set a property in your second form and than use that (it can as well with a field, in the way I show it you here quick and dirty) Form1 Friend MyArrayList as new arraylist Form2 Friend myArrayList as arraylist Form1 procedure dim frm2 as Form2 frm2.myArrayList = me.myArraylist frm2.show 'I prefer this with frm2.showdialog, with the show you can get complications. I hope this helps, Cor Show quoteHide quote "al jones" <alfredmjo***@shotmail.com> schreef in bericht news:ow6fdqqrx4pc.14szeo14trxi3.dlg@40tude.net... > I'm not seeing things right today. I have an arraylist I create and load > in one form. To display the information from the array list I'm opening a > richtextbox in another form - stupid time - how do I pass the array list > to > the load function of the new form?? > > //al Cor, as Xerebus said, there are probably 100 different ways to do it... I
like yours, but had already used his (which works). Thanks for the additional education ... The last COBOL *I* wrote was something like COBOL 74 (on an HP series 3) - it was all single (as I recall) programs, there was no call yet, that came about in COBOL 80 (or later), didn't it?? //al On Mon, 10 Apr 2006 08:36:01 +0200, Cor Ligthert [MVP] wrote: Show quoteHide quote > Al in the same way as you would do it in Cobol if that was a Call by > overloading the Sub New in your second form. > > But mostly is it easier to make in this case your arraylist friend in form 1 > Set a property in your second form and than use that (it can as well with a > field, in the way I show it you here quick and dirty) > > Form1 > Friend MyArrayList as new arraylist > > Form2 > Friend myArrayList as arraylist > > Form1 procedure > dim frm2 as Form2 > frm2.myArrayList = me.myArraylist > frm2.show > 'I prefer this with > frm2.showdialog, with the show you can get complications. > > I hope this helps, > > Cor > > "al jones" <alfredmjo***@shotmail.com> schreef in bericht > news:ow6fdqqrx4pc.14szeo14trxi3.dlg@40tude.net... >> I'm not seeing things right today. I have an arraylist I create and load >> in one form. To display the information from the array list I'm opening a >> richtextbox in another form - stupid time - how do I pass the array list >> to >> the load function of the new form?? >> >> //al Hmmm... "Xerebrus" is a nice name too ! Thanks for that new nick, Al,
it's cool ! LOL ! Regards, On 11 Apr 2006 21:10:59 -0700, Cerebrus wrote:
> Hmmm... "Xerebrus" is a nice name too ! Thanks for that new nick, Al, <chuckle> Oops, sorry guy, it as getting late and I was thinking about> it's cool ! LOL ! > > Regards, getting my old bod to bed - slippery fingers and all that. Glad you like the alternative form, but did you notice that you also further altered it?? //al
simple thread question
appending colored / fonted <?> text to a richtextbox Drawing points in degrees!!! 32bit image quality in menus and tool bar strips VB2005 - Secure Access to SQL Server through Application Only Textbox Click Event needed. Drawing a square (or circles) before each item of a treeview 'System.Security.SecurityException' with .NET 2005 Only After 2003 to 2005 Upgrade Wizard, Getting System.Security.SecurityException Looking for a License Package |
|||||||||||||||||||||||