>>>>I'm sorry to ask you again & again for small things...But pls help me on this..
>>>>
>>>>Currently I have that form of 6 pages saved as a scx file,
>>>>
>>>>which I'll save it as a class now...
>>>>
>>>>After saving it as a class, How I can call it ??
>>>>
>>>>Actually this 6 page form I want to load on the basis of accesslvl of user...
>>>>
>>>>Say if a user is allowed to acess pages 1, 3, 5
>>>>
>>>>The form at the start should only load 1st page, but as tabs displays 3 & 5..
>>>>
>>>>When he clicks on 3rd or 5th page, the program should load 3rd page or 5th..
>>>>
>>>>Pls tell me how I can do this thing...
>>>
>>>Here's how I would do it:
>>>1. modify the form (not the form class) && see step 4 for reason
>>>2. edit page 3
>>>3. select all controls (ctrl+A)
>>>4. (in the menu) file/save as class && not available if modifying a class
>>>5. choose "selected controls"
>>>6. name it as "page3"
>>>7. delete all controls from page 3 && this prevents it from loading
>>>8. in page3.activate() put:
>>>. if UserAllowedToEditPage3() and type('this.page3')='U'
>>>. this.addobject("page3","page3")
>>>. this.page3.visible = .t.
>>>. else
>>>. this.refresh()
>>>. endif
>>>
>>>do the same kind of thing with each page.
>>>
>>>Bill
>>Just noticed Bill already replied. Thanks Bill.
>>Just an addition as a safety belt in addobject keep object names and class names different and don't forget to initiate your classlib with *set classlib to ...*
>
>Thanks to you both, I'm going to try these things.. & see the outcome...
>
>If I will face any problem, I will come back to u again..
>
>But I have another problem regarding Moving the navigator bar to form instead of making it only individual pages..
>
>I'm facing problem in refreshing controls on a pageframe...
>
>Because of which I wrote individual record navigator bars on eachpage..
>
>where I'm manually writing commands like this..
>
>thisform.mypage.page1.add.enabled=.t.
>thisform.mypage.page1.mygrid.readonly=.f.
>
>etc.
>
>Pls advs. that is there any general purpose routine to enable/disable controls on a pageframe...
Hi Vinod,
You could use for..endfor to cycle the controls and set them :
with thisform.mypageframe.activepage
for ix=1 to .controlcount
.controls(ix).readonly = !thisform.editmode
endfor
endwith
or :
in activate of pageframe
with this
for ix=1 to .controlcount
.controls(ix).readonly = !thisform.editmode
endfor
endwith
This is only an example though. You must control the type of controls also (containers, editboxes etc.). Check txtbtns class in wizstyle.vcx