Re: Defining Active Tab
- From: Jan Hyde <StellaDrinker@xxxxxxxxxxxxxxxxxxx>
- Date: Thu, 20 Jul 2006 16:51:45 +0100
Chris Jones <chris.jones@xxxxxxxxx>'s wild thoughts were
released on Thu, 20 Jul 2006 15:49:40 +0100 bearing the
following fruit:
I did try it and it did work albeit without the If statement. The O was
a zero in the code, just a mistake on my part when making the post.
The textboxes were cleared of all data however they were replaced with a
space which is something I knew about.
Basically what I'm aiming for is a global 'clear fields' button that
will clear only the active tab's textboxes.
Something along the lines of
If active tab = tab1
clear 1.text
clear 2.text
clear 3.text
else
If active tab = tab2
clear 4.text
clear 5.text
If your email address is real you should recieve a small
sample project. Feel free to ask any questions about it here
(posting the bit of code you want help on - for the benefit
of others)
Jan Hyde wrote:
Chris Jones <chris.jones@xxxxxxxxx>'s wild thoughts were
released on Thu, 20 Jul 2006 10:10:52 +0100 bearing the
following fruit:
For clearing a set of textboxes only if the current active tab is tab 0
would the syntax be something like this?
-----
Private Sub ResetFields_Click()
If SSTab.Tab = O Then
IDtxt.Text = " "
IDExpHTxt.Text = " "
IDExpGTxt.Text = " "
End If
End Sub
-----
Thanks,
Did you try it ;-)
Of course it won't clear the textboxes because your code
above will put a since space in those textboxes
Should be
IDtxt.Text = ""
And you want SSTab.Tab = 0 (Zero)
rather than the code above which is
SStab.Tab = O (The letter O)
J
Chris Jones wrote:
Jan:
"You should have 1 frame on every tab, all your controls
should be on that frame, there are several reasons for this."
I thought you meant to have each of the buttons that are used by
multiple tabs on each of the tabs they'd be used on.
Bob:
I'm quite new to VB Bob and was aware that this wasn't the correct
syntax however I was hoping someone would help with that.
Jan Hyde wrote:
Chris Jones <chris.jones@xxxxxxxxx>'s wild thoughts were
released on Mon, 17 Jul 2006 15:59:46 +0100 bearing the
following fruit:
So you think I should ditch the idea of global buttons altogether?No?!
Jan Hyde wrote:
Chris Jones <chris.jones@xxxxxxxxx>'s wild thoughts were
released on Mon, 17 Jul 2006 12:38:42 +0100 bearing the
following fruit:
Thanks again Jan,No, there is no single command, which ever way you decide to
I understand the principle of your suggestion but the actual
implementation I'm a bit hazy on.
Originally I had intended to use an If statement to say
If
Active Tab = Tab1
then
Form1.SStab.tab.textbox1.clear
Form1.SStab.tab.textbox2.clear
Form1.SStab.tab.textbox3.clear
Form1.SStab.tab.textbox4.clear
Form1.SStab.tab.textbox5.clear
Form1.SStab.tab.textbox6.clear
Else...
And then repeating this all in the same command so that only the
active tab's textboxes would be cleared.
So by using frames i'll be able to clear all the currently active
frame's textboxes with a single command?
do it you're going to have to do each control individually.
J
Thanks Again,Jan Hyde (VB MVP)
Chris.
Jan Hyde wrote:
Chris Jones <chris.jones@xxxxxxxxx>'s wild thoughts were
released on Mon, 17 Jul 2006 10:34:00 +0100 bearing the
following fruit:
Thanks Jan,You should have 1 frame on every tab, all your controls
I now have another problem :) Funny how the more we find out the
more questions we have eh?
Anyway as I said, I'm looking to perform a series of actions on
multiple tabs without having to duplicate buttons. One of these
actions is to clear all the text boxes in the active tab.
Using Form1.SStab.Tab.textbox1.Clear will clear the field
'textbox1' in the active tab in form1 I presume however is there
a way to clear all the textboxes on the active tab rather than
just 1 at a time?
should be on that frame, there are several reasons for this.
This makes your job easier, since you can cycle through the
forms control collection and check it's container property.
If the parent is the frame the corresponds to the tab you
want to clear then you can clear the contents of that
control otherwise ignore and move to the next control.
Post back if you have any trouble with it and either I or
someone else will post some code.
Thanks,Jan Hyde (VB MVP)
Chris.
Jan Hyde wrote:
Chris Jones <chris.jones@xxxxxxxxx>'s wild thoughts were
released on Fri, 14 Jul 2006 11:42:44 +0100 bearing the
following fruit:
SStab, Thanks.IIRC
SSTab.Tab
J
Jan Hyde wrote:Jan Hyde (VB MVP)
Chris Jones <chris.jones@xxxxxxxxx>'s wild thoughts were
released on Fri, 14 Jul 2006 10:12:36 +0100 bearing the
following fruit:
Hi there,Tell us which tab control your using and we'll tell ya.
I'm creating a program that performs various actions on 2
smartcards. Within the main form there are 8 tabs, each with
various text fields. To the left of this set of tabs is a
frame with the action buttons. I'd like a way of defining the
active tab so that I dont have to create the buttons again in
each tab
Any help is appreciated.
Jan Hyde (VB MVP)
Jan Hyde (VB MVP)
Jan Hyde (VB MVP)
Jan Hyde (VB MVP)
--
On the door of a music library: Bach in a minuet. (Syman Hirsch)
.
- References:
- Re: Defining Active Tab
- From: Jan Hyde
- Re: Defining Active Tab
- From: Chris Jones
- Re: Defining Active Tab
- From: Chris Jones
- Re: Defining Active Tab
- From: Jan Hyde
- Re: Defining Active Tab
- From: Chris Jones
- Re: Defining Active Tab
- Prev by Date: Re: Defining Active Tab
- Next by Date: Re: Missing Forms
- Previous by thread: Re: Defining Active Tab
- Next by thread: Re: ListBox with two colums for each record
- Index(es):