Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Pageframe tab switching using keyboard 1

Status
Not open for further replies.

ITSmwong

Programmer
Aug 28, 2002
5
CA
Hello,

I was just wondering if anyone knew how to switch between tabs on a pageframe in FoxPro. I know in Windows (eg. Display Properties Pageframe), you can hit Ctrl+PageDown or Ctrl+PageUp to move from one tab to the other but that doesn't work in my FoxPro application.

Any ideas on how to make it work like this or other alternatives? I have a client that does not want to use the mouse at all and this was one situation I could not get around without using the mouse.

Thanks in advance guys!

Mike
 
Arrow keys work for me.

Slighthaze = NULL
[sub]craig1442@mchsi.com[/sub][sup]
"Whom computers would destroy, they must first drive mad." - Anon​
[/sup]
 
Hi:

Captions of e.g. 2 pages :
\<First Page
\<Second page

During program execution The 'F' of First page is underlined
Same with 'S'of second page

You can tab using Alt+F or Alt+S key

-Bart
 
If you don't like either of these suggestions and you want it to work the way the Display Properties dialog works as you explained it (CTRL+PGDN and CTRL+PGUP) you could use something like the following. Cut-N-Paste the code into a prg and run it from within VFP.


Code:
PUBLIC oForm
oForm = CREATEOBJECT(&quot;clsKeyTabs&quot;)
oForm.show()

DEFINE CLASS clskeytabs AS form

	DoCreate = .T.
	Caption = &quot;TAB NAVIGATION&quot;
	Name = &quot;Form1&quot;

	ADD OBJECT pageframe1 AS pageframe WITH ;
		ErasePage = .T., ;
		PageCount = 5, ;
		Top = 36, ;
		Left = 60, ;
		Width = 241, ;
		Height = 169, ;
		Name = &quot;Pageframe1&quot;, ;
		Page1.Caption = &quot;Page1&quot;, ;
		Page1.Name = &quot;Page1&quot;, ;
		Page2.Caption = &quot;Page2&quot;, ;
		Page2.Name = &quot;Page2&quot;, ;
		Page3.Caption = &quot;Page3&quot;, ;
		Page3.Name = &quot;Page3&quot;, ;
		Page4.Caption = &quot;Page4&quot;, ;
		Page4.Name = &quot;Page4&quot;, ;
		Page5.Caption = &quot;Page5&quot;, ;
		Page5.Name = &quot;Page5&quot;

	PROCEDURE pageframe1.Destroy
		ON KEY LABEL CTRL+PGDN
		ON KEY LABEL CTRL+PGUP
	ENDPROC

	PROCEDURE pageframe1.Init
		ON KEY LABEL CTRL+PGDN ;
			_screen.activeform.pageframe1.ActivePage = ;
			IIF(_screen.activeform.pageframe1.ActivePage = 1, ;
			_screen.activeform.pageframe1.pagecount, ;
			_screen.activeform.pageframe1.ActivePage - 1)

		ON KEY LABEL CTRL+PGUP ;
			_screen.activeform.pageframe1.ActivePage = ;
			IIF(_screen.activeform.pageframe1.ActivePage = _screen.activeform.pageframe1.pagecount, ;
			1, _screen.activeform.pageframe1.ActivePage + 1)
	ENDPROC

ENDDEFINE

Slighthaze = NULL
[sub]craig1442@mchsi.com[/sub][sup]
&quot;Whom computers would destroy, they must first drive mad.&quot; - Anon​
[/sup]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top