Results 1 to 3 of 3
  1. #1
    Join Date
    Apr 2004
    Location
    Kampala, Uganda
    Posts
    32

    Unanswered: Tab control changing pages as its controls are disabled

    I've got a tab control with 3 pages, each showing bound grids and text boxes. These controls are disabled depending on which record I'm looking at (the tab control is not disabled though, because the user still has read only access to the record).

    The problem is that if I'm looking at the third page and then change records to one which causes the controls to be disabled, the controls on the first tab are displayed, but the third tab is still the top one ie the third tab is still at the front but showing the first page, not the third page.

    I've tried having a control on each tab which never gets disabled and disabling the controls in different orders, but I cant find a solution.

    Any ideas?

  2. #2
    Join Date
    Mar 2004
    Location
    www.scirocco.ca
    Posts
    346

    Re: Tab control changing pages as its controls are disabled

    It may be a bug in the tab control?

    In the code before you change records that causes this behavior store the current tab in a variable

    Dim intTab as integer

    intTab = TabControl.Tab

    In the code following where you change records that causes this behavior add the following code.

    TabControl.Tab = intTab

    (This is standard property Tab maybe your tab control uses a different property name TabPage or TabItem etc... Adapt the code for your tab)
    http://www.scirocco.ca/images/banner...occobanner.gif

    Download for FREE the ADO/DAO Data Controls that makes life EASIER developing database applications in: VB, FoxPro, Access, VC++, .NET etc... Navigate, Add New, Delete, Update, Search, Undo and Save your changes. Supports Disconnected Recordsets and Transactions!

    Or try our Ask An Expert service to answer any of your questions!

  3. #3
    Join Date
    Apr 2004
    Location
    Kampala, Uganda
    Posts
    32

    Its a custom control thing

    After lots of wasted time;

    The last suggestion posted works... but only with standard controls. The problem is with the grid I'm using, its a freeware enhanced flex grid I downloaded of the web, and the problem only occurs when I'm using this particular control. So now I'm using a different one and everything is OK.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •