Click here to Skip to main content
15,886,720 members
Please Sign up or sign in to vote.
3.00/5 (1 vote)
See more:
Hi ,

I have created a form application with tabcontrol which contains 3 tab pages. I wish to set a click event for tabpage but unable to do . for example when i click on tabpage2 a text should be displayed on richtextboxsaying "you have clicked tab2"

This is my form

http://i282.photobucket.com/albums/kk269/dxm4i/tab.jpg[^]


added this to tabpage2 code
C++
this->tabPage2->Click += gcnew System::EventHandler(this, &Form1::tabPage2_Click);
;

Created this click event
C++
private: System::Void tabPage2_Click(System::Object^  sender, System::EventArgs^  e) {
            richTextBox1->Text=String::Format("You are in tab2", tabPage2->Text);

But didn't get the desired results . Assistance needed

[edit]Code blocks sorted out, link linkified, tags corrected.[/edit]
Posted
Updated 22-Jun-11 21:44pm
v2
Comments
Christian Graus 23-Jun-11 3:42am    
Why is your question tagged VB.NET ? What 'results' do you get ? Does it fire ? Does it run ? How does it behave differntly to what you hoped for ?
Sandeep Mewara 23-Jun-11 4:53am    
Elaborate "desired result" and the issues you are facing.
steven8Gerrard 23-Jun-11 5:19am    
when i click on the tabpage1 or say tabpage2 it should display a textin richtextbox "you have clicked on tab2" . Now i dont get any such text

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900