Forum > Portuguese
PageControl e TabSheet
BraveDOG:
Ola,
Tenho um Formulário contendo um PageControl (pgcAbas) e 4 TabSheets (tab1, tab2...). Dentro de cada TabSheet, tenho componentes do tipo TEdit. O que não estou conseguindo é: Quando clico no Tab1, o foco passe para o primeiro campo, que seria txtCNPJ, quando clicasse em Tab2, o foco fosse parar no primeiro campo que é txtDataContrato, e por ai vai.
Já tentei os eventos OnChange, OnCanging, OnEnter, OnMouseEnter do PageControl e nada deu certo.
Handoko:
Translated using Google Translate:
--- Quote ---Hello,
I have a Form containing a PageControl (pgcAbas) and 4 TabSheets (tab1, tab2 ...). Within each TabSheet, I have components of type TEdit. What I'm not getting is: When I click on Tab1, the focus goes to the first field, which would be txtCNPJ, when I clicked on Tab2, the focus would be on the first field that is txtDataContract, and so on.
I've tried the OnChange, OnCanging, OnEnter, OnMouseEnter events of PageControl and nothing worked.
--- End quote ---
We need more information. What is the component type of txtCNPJ and txtDataContract? Are they TEdit?
I use TPageControl, so far never have any serious issue. There must be something wrong in your code. Can you show us your code?
To do it:
Create a new folder and copy all the necessary files into it except: the binary (*.exe), *.bak and the lib folder. Compress the folder and send it to the forum. If it uses any database, please also include them.
valdir.marcos:
--- Quote from: BraveDOG on July 13, 2018, 03:45:46 pm ---Ola,
Tenho um Formulário contendo um PageControl (pgcAbas) e 4 TabSheets (tab1, tab2...). Dentro de cada TabSheet, tenho componentes do tipo TEdit. O que não estou conseguindo é: Quando clico no Tab1, o foco passe para o primeiro campo, que seria txtCNPJ, quando clicasse em Tab2, o foco fosse parar no primeiro campo que é txtDataContrato, e por ai vai.
Já tentei os eventos OnChange, OnCanging, OnEnter, OnMouseEnter do PageControl e nada deu certo.
--- End quote ---
Brazilian Portuguese:
Eu anexei um exemplo bem simples que funciona.
English:
I have attached a very simple example that just works.
wp:
Seems to work correctly for me (Windows 10/64 bit, Laz trunk/FPC 3.0.4 32 bit). What is your operating system? Which Lazarus/FPC version? Which Bitness?
BraveDOG:
Obrigado a todos por responderem.
valdir.marcos: olhei seu código aqui e funcionou ( o seu exemplo) vou olhar o que fiz de errado no meu !!!
Super Obrigado !!!
Navigation
[0] Message Index
[#] Next page