Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Forms and scroll bars
Message
 
To
04/04/2002 00:14:30
Jordan Pastourel
Worksafe Management Systems
Toowong, Australia
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00640700
Message ID:
00640854
Views:
20
>all i did was create a form, change the scrollbar property to 2 and added the following code to the load event:
>
>set default to f:\
>use in 0 c:\compdtl
>use in 0 c:\wims
>***********************************************
>*** Setting up the checkboxes on the left side
>***
>longest = 0 && the longest width of field name
>top1 = 0 && the top for the next chaeckbox to be placed at
>select compdtl
>r=afields(thearr)
>
>for i=1 to r && adds in all the fields from the existing table
> addname = 'source' + alltrim(str(i))
> thisform.addobject(addname, 'CheckBox')
> thisform.&addname..top = top1
> thisform.&addname..autosize = .t.
> thisform.&addname..caption = alltrim(thearr[i,1])
> thisform.&addname..alignment = 1
> thisform.&addname..tag = str(i)
> top1 = top1+20
> if thisform.&addname..width > longest
> longest = thisform.&addname..width && the longest width
> endif
>endfor
>
>for k=1 to r && positions all the checkboxes in a line
> addname = 'source'+alltrim(str(k))
> thisform.&addname..left = longest
> thisform.&addname..visible = .t.
>endfor
>
>***********************************************
>*** Setting up the checkboxes on the right side
>***
>top1 = 0 && the top for the next chaeckbox to be placed at
>select wims
>r=afields(thearr2)
>
>for l=1 to r && adds in all the fields from the existing table
> addname = 'imp' + alltrim(str(l))
> thisform.addobject(addname, 'CheckBox')
> thisform.&addname..top = top1
> thisform.&addname..left = longest + 600
> thisform.&addname..autosize = .t.
> thisform.&addname..caption = alltrim(thearr2[l,1])
> thisform.&addname..alignment = 0
> thisform.&addname..tag = str(l)
> thisform.&addname..visible = .t.
> top1 = top1+20
>endfor
>
>
>
>so as you can see it just gets 2 tables fields and displays them on a form as a checkbox.

I think the Load() event might be not a good place to add controls like that. Try to move your code (after opening the tables) into form.Init()
Try also to reset thisform.scrollbars = 2 after you set your checkboxes.
Nick Neklioudov
Universal Thread Consultant
3 times Microsoft MVP - Visual FoxPro

"I have not failed. I've just found 10,000 ways that don't work." - Thomas Edison
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform