Normal Topic READONLY BUT wthout Tab Pages (Read 551 times)
Amor
Full Member
Members
***
Offline


No personal text

Posts: 366
Location: Germany
Joined: Feb 7th, 2004
READONLY BUT wthout Tab Pages
Apr 8th, 2008 at 8:08pm
Print Post Print Post  
Hello!
I want  to make my entire form layout read only. Please how would I write a ReadOnly to the entire layout but without the Tab pages ?

Thank you.
  

Dr. med. Amor Belhareth&&Medizin Labor &&Germany
Back to top
 
IP Logged
 
Carl Underwood
Senior Member
Members
*****
Offline



Posts: 1351
Location: New Hampshire
Joined: Mar 11th, 2003
Re: READONLY BUT wthout Tab Pages
Reply #1 - Apr 8th, 2008 at 9:14pm
Print Post Print Post  
Is this what you need?

Code
Select All
var n as int
var i as int
var vElementList as string
var vElement as string

// Set read-only for all elements
vElementList = @StringArrayElementList()
n = @NumberOfElements()
For i = 1 to n
	vElement = @AccessStringArray(vElementList, i)
	ReadOnly( @(vElement), 1)	// 0 = writable, 1 = read-only, 2 = read-only but not grayed
Next

// UnSet read-only for some elements
vElementList = "LE1;LE0"
n = @CountStringArray(vElementList)
For i = 1 to n
	vElement = @AccessStringArray(vElementList, i)
	ReadOnly( @(vElement), 0)	// 0 = writable, 1 = read-only, 2 = read-only but not grayed
Next 

  


Carl Underwood
CDU Computer Consulting LLC
Epsom, New Hampshire
Back to top
IP Logged
 
Amor
Full Member
Members
***
Offline


No personal text

Posts: 366
Location: Germany
Joined: Feb 7th, 2004
Re: READONLY BUT wthout Tab Pages
Reply #2 - Apr 8th, 2008 at 9:31pm
Print Post Print Post  
Hello Sear Karl!

thanks for the flying reply. Karl i would like to see the LE´s on the Tab Pages . So i can navigate between the different Tab Pages and can see his/its LE's.

Thanks.
  

Dr. med. Amor Belhareth&&Medizin Labor &&Germany
Back to top
 
IP Logged
 
Carl Underwood
Senior Member
Members
*****
Offline



Posts: 1351
Location: New Hampshire
Joined: Mar 11th, 2003
Re: READONLY BUT wthout Tab Pages
Reply #3 - Apr 9th, 2008 at 1:13am
Print Post Print Post  
Use this improved version. It will only set editable elements to ReadOnly status. You will still be able to click on the TabPages.

The 2nd half is only needed if you want to reset some of the elements back to editable status. You would simply change "MyLE1;MyLE2;MyLE3" to contain the names of your own elements.

Code
Select All
var n as int
var i as int
var vType as int
var vElementList as string
var vElement as string

// Set read-only for all elements
vElementList = @StringArrayElementList()
n = @NumberOfElements()
For i = 1 to n
	vElement = @AccessStringArray(vElementList, i)
	vType = @ElementType(@(vElement))
	if (vType > 999 and vType < 1009) or vType = 1024	// 1024 = Text Editor Element
		ReadOnly( @(vElement), 1)	// 0 = writable, 1 = read-only, 2 = read-only but not grayed
Next

// UnSet read-only for some elements
vElementList = "MyLE1;MyLE2;MyLE3"
n = @CountStringArray(vElementList)
For i = 1 to n
	vElement = @AccessStringArray(vElementList, i)
	ReadOnly( @(vElement), 0)	// 0 = writable, 1 = read-only, 2 = read-only but not grayed
Next  


  


Carl Underwood
CDU Computer Consulting LLC
Epsom, New Hampshire
Back to top
IP Logged
 
Amor
Full Member
Members
***
Offline


No personal text

Posts: 366
Location: Germany
Joined: Feb 7th, 2004
Re: READONLY BUT wthout Tab Pages
Reply #4 - Apr 9th, 2008 at 4:32pm
Print Post Print Post  
Hello Karl,

Thank you so much for the Help.

Please tell me how to set the readonly on the Subforms on the tabs.

Dr. Belhareth
  

Dr. med. Amor Belhareth&&Medizin Labor &&Germany
Back to top
 
IP Logged
 
Carl Underwood
Senior Member
Members
*****
Offline



Posts: 1351
Location: New Hampshire
Joined: Mar 11th, 2003
Re: READONLY BUT wthout Tab Pages
Reply #5 - Apr 10th, 2008 at 1:34pm
Print Post Print Post  
BTW, it looks like I forgot to mention that the code I posted should be placed in the Form :: On Form Entry event.

For the subforms, you would also place the code in the Form :: On Form Entry event of the subform.
  


Carl Underwood
CDU Computer Consulting LLC
Epsom, New Hampshire
Back to top
IP Logged