[Gambas-user] Dynamic Controls / Grid?
M0E Lnx
m0e.lnx at ...626...
Thu Jun 26 22:03:02 CEST 2008
Do you really mean (3) objects for each search result?
In case you do, You can do it like this.
Put the results in an array
then run trhough the array creating the stuff
like this
PUBLIC SUB DYNAMIC_OBJECTS()
DIM sResults as string '(this is the raw list of results)
DIM sRes as string[]
DIM i as integer
DIM sResult as string '(Single result) in the array
DIM txtBox as textbox
DIM tTextLabel as TextLabel
dim cbCheck as Checkbox
'We will assume you are separating your l ist with a space
sRes = split(sResults, " ")
FOR i = 0 to sRes.count - 1
txtBox = new textbox(YourParentHere)
tTextlabel = new textlabel(YourParentHere)
cbCheck = new checkbox(YourParentHere)
NEXT
END
Of couse, you'll have to set the properties for each of these objects
after you create them...
This code may not work out of the box, but it should give you an idea
of how to do this
On 6/26/08, Nate-37 <Nathan.Neff at ...626...> wrote:
>
> Hello,
>
> I would like to be able to create a Label, a Textbox and a Checkbox for a
> variable number of records.
>
> I'm not dealing with a database, I'm dealing with search results.
>
> So, if I find 3 search results, I would like to create a Label, a Textbox
> and a Checkbox for each search result like so:
>
>
> Search Results:
>
> Result Change To: Change?
> -----------------------------------
> Foo FOOFOO X
> Bar BARBAR X
> Baz
>
>
> Go!
>
> What is a good way of creating these dynamic controls, as well as arranging
> them so that they appear like in the example above?
>
> I'm playing around with the HPanel, VPanel, HBox and VBox, and will post my
> results if I find something that works. I would use a grid, except that I
> want to have a Checkbox in the 3rd column. Is there any way to place a
> checkbox in a Grid?
>
> Thanks,
> --Nate
> --
> View this message in context: http://www.nabble.com/Dynamic-Controls---Grid--tp18140539p18140539.html
> Sent from the gambas-user mailing list archive at Nabble.com.
>
>
> -------------------------------------------------------------------------
> Check out the new SourceForge.net Marketplace.
> It's the best place to buy or sell services for
> just about anything Open Source.
> http://sourceforge.net/services/buy/index.php
> _______________________________________________
> Gambas-user mailing list
> Gambas-user at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user
>
More information about the User
mailing list