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!

Using notebook tool and changing focus 1

Status
Not open for further replies.

buttersoft

Programmer
Jun 11, 2000
75
CH
I have got a form and have used the notebook tool to place a 6-tabbed notebook on that form.

When the form is exited from, I want to Set Focus to the first notebook.page i.e. the first TAB. However, as it works now, it always gives Focus to the LAST notebook.page i.e. the last one I added.

How can I change this?
 
SPB,

Call the moveto() method of the notebook and *then* call the moveTo() method of the specific page object. For example:

doDefault
Notebook1.moveto()
NotePage9.moveto()

Tip: Use the Object Explorer to quicky rename the objects in a Notebook.

Hope this helps...

-- Lance




 
I tried this, but I am not sure of the moveto() of the notebook. In fact I could not see in the object explorer anything like moveto().

Can you please give me a step by step. I have renamed the objects in the notebook to:-

FTSE100Page, FTSE250Page, TechmarkPage, USHiTechPage, PortfolioPage, DownloadsPage

WOuld be better to also have a number? I see in the object explorer that these pages are numbered 1 to 6 anyway.
 
I got around this another way, when in the design mode, moved notebook pages to the desired location using rotate. Then before CLOSE the form go FILE SAVE then close it!

I also afterwards made 2 rows of three tabs and ended back up with 6 across and it now opens up with focus on the first page, which is as I wanted it.

Thanks.
 
Well, that's certainly the preferred solution. You must always take care when saving your forms to ensure that:

-- The right notbook page is selected
-- Colors are properly setup (if doing dynamic highlighting)
-- Filters have been removed
-- the proper index has been selected in Order/Range
-- etc.

I use a script to verify that things are where I want them; I run it just before creating a distribution to send out to a client.

As far as your ealier questions are concerned:

A step by step might be a bit difficult, as I'm not completely clear on your form's design, but the key points are:

1. It's a good idea to manually name anything you intend to call in code. To do that,
select the object in question, inspect (right-click), choose Properties, and then enter a new name.

2. Ctrl+Space is a shortcut for displaying the Object Inspector at design time. Make sure you're displaying both tabs; that lets you navigate the objects on your form more easily.

3. Remember that the Notebook itself is a different object than the pages it contains. Each page is also a separate object. I generally use the object view to select the notbook and then right click it to get to the Propety sheet.

4. Using a number as part of the name is a preference. I generally use descriptive names, though there are times when a trailing number can be useful, especially if you're using code to control various things. In that case, it can make your code more generic.

Hope this helps...

-- Lance

 
Thank you Lance,

I found your comments and info very useful
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top