| View previous topic :: View next topic |
| Author |
Message |
Never Again I post too much
Reputation: 0
Joined: 13 Jan 2007 Posts: 2000 Location: New Mexico
|
Posted: Sat Sep 08, 2007 6:36 pm Post subject: How to use TabControl for Delphi? |
|
|
It's me...... AGAIN.
I need to know how to use seperate buttons for the Tabs on TabControl like say if I wanted to show a picture when I click button1 but for the first tab only then a different picture when I click button2 but for the second tab, how would I be able to do that?
|
|
| Back to top |
|
 |
Symbol I'm a spammer
Reputation: 0
Joined: 18 Apr 2007 Posts: 5094 Location: Israel.
|
Posted: Sun Sep 09, 2007 8:41 am Post subject: |
|
|
Sorry, my other account is mute from some reason...
I said (Skyance)
| Code: | if TabControl1.TabIndex = 0 then begin //First tab is 0.
Image1.Visible := True;
Image2.Visible := False;
end;
if TabControl1.TabIndex = 1 then begin
Image1.Visible := False;
Image2.Visible := True;
end; |
But if you use more tabs, like 4+ then use if else, like:
| Code: | if TabControl1.TabIndex = 0 then begin
Image1.Visible := True
else
Image1.Visible := False; |
|
|
| Back to top |
|
 |
Never Again I post too much
Reputation: 0
Joined: 13 Jan 2007 Posts: 2000 Location: New Mexico
|
Posted: Sun Sep 09, 2007 8:56 am Post subject: |
|
|
Oooh alright thx.
But what about setting it different, kind of like Kaspersky's Universal Flash trainer it has like 6 tabs how would you make buttons like that, setting the url to the 1st tab when you click Button1.
|
|
| Back to top |
|
 |
Symbol I'm a spammer
Reputation: 0
Joined: 18 Apr 2007 Posts: 5094 Location: Israel.
|
Posted: Sun Sep 09, 2007 9:28 am Post subject: |
|
|
| Code: | if TabControl1.TabIndex = 0 then
ShockwaveFlash1.LoadMovie(0, 'url for tab 1');
if TabControl1.TabIndex = 1 then
ShockwaveFlash1.LoadMovie(0, 'url2');
if TabControl1.TabIndex = 2 then
ShockwaveFlash1.LoadMovie(0, 'url3');
if TabControl1.TabIndex = 3 then
ShockwaveFlash1.LoadMovie(0, 'url4');
| etc...
|
|
| Back to top |
|
 |
|