473,397 Members | 1,961 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,397 software developers and data experts.

Page OnClick event

553 512MB
I am having difficulty in doing this.

If a page on a Tab Control is clicked
Then do something

I mean page by not the whole page but when you switch from one page to another on the Tab control (The small rectangle with page name on).

I have tried this and many other methods, but dont work :
Expand|Select|Wrap|Line Numbers
  1. Private Sub Page30_Click()
  2.     MsgBox "Page 30 clicked"
  3. End Sub
  4.  
Help please
Jul 27 '07 #1
2 4115
missinglinq
3,532 Expert 2GB
The Click event of a tabbed page refers to the clicking on the actual page, what you would think of as the "background" of the page, not to the tab at the top that is used to switch from page to page. To accompish what you want to do, requires a little diddling!

In Design View Click on Page 30 and place a textbox on it; name it DummyTextBox.

Goto Properties - Events then click to the right of the On Got Focus event and select Code Builder. When the appropriate sub comes up place this code in it MsgBox "Page30 was clicked" so that it looks like this:
Expand|Select|Wrap|Line Numbers
  1. Private Sub DummyTextBox_GotFocus()
  2.  MsgBox "Page30 was clicked"
  3. End Sub
Now go back to Design View and click on Page30 to select it.

Goto View - Tab Order and move DummyTextBox so that it is the first control to receive focus on the page. Click OK.

Select the DummyTextBox control and shrink it as small as possible.

Run the form and click on Page30. The messagebox should popup with the message "Page30 was clicked" showing.

Now you can go back into the VBE and replace

MsgBox "Page30 was clicked"

with whatever code you want to run when the page is clicked.

Linq
Jul 27 '07 #2
questionit
553 512MB
Hey Linq

thanks very much. that method's great !!

i am realizing since have started learning VB that there are many weaknesses in this programming language such as this one - cant do onClick event when top of page is clicked..

Probably, C# or VC++ is the best...

The Click event of a tabbed page refers to the clicking on the actual page, what you would think of as the "background" of the page, not to the tab at the top that is used to switch from page to page. To accompish what you want to do, requires a little diddling!

In Design View Click on Page 30 and place a textbox on it; name it DummyTextBox.

Goto Properties - Events then click to the right of the On Got Focus event and select Code Builder. When the appropriate sub comes up place this code in it MsgBox "Page30 was clicked" so that it looks like this:
Expand|Select|Wrap|Line Numbers
  1. Private Sub DummyTextBox_GotFocus()
  2.  MsgBox "Page30 was clicked"
  3. End Sub
Now go back to Design View and click on Page30 to select it.

Goto View - Tab Order and move DummyTextBox so that it is the first control to receive focus on the page. Click OK.

Select the DummyTextBox control and shrink it as small as possible.

Run the form and click on Page30. The messagebox should popup with the message "Page30 was clicked" showing.

Now you can go back into the VBE and replace

MsgBox "Page30 was clicked"

with whatever code you want to run when the page is clicked.

Linq
Jul 27 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: dominosly | last post by:
Okay, this is a rather complicated problem, so here is the short of it: I am using a custom designed user control that simply writes out a plain old html submit button to the page. When the...
9
by: PK9 | last post by:
I'm having an issue with the "Refresh" of an asp.net page. The refresh is actually calling my last onClick event. I thought that asp.net was supposed to be stateless in that it shouldn't...
4
by: PK9 | last post by:
I have a button at the top of my page that I have an onClick event handler for which makes some new controls (at the bottom of my page) visible. When the user clicks the button I make the new...
1
by: RedGST | last post by:
Hello, Im somewhat new to asp.net, so bear with me. I have created a form that has a Listbox along with 2 command buttons & a few other non-important controls. The command button is tied to...
9
by: tshad | last post by:
This is from my previous post, but a different issue. I have the following Javascript routine that opens a popup page, but doesn't seem to work if called from an asp.net button. It seems to work...
3
by: Sameer | last post by:
I have a webpage that has a link button. This link button on click opens up a new page. This is what is happening: 1. Load the web page. 2. Click on the link. 3. Refresh the web-page. Result:...
3
by: lofty00 | last post by:
hello, sorry about the repost - I've been posting to several groups and I've decided it's better to make a single repost to all of them rather than an extra post in each. I've been trying to...
2
by: Ken Fine | last post by:
In code, I'm adding javascript attributes to form elements on an ASP.NET page: body.Attributes.Add("onClick", "highlight(event);"); body.Attributes.Add("onKeyUp", "highlight(event);");...
6
by: Jeremy | last post by:
I've got a floating div which becomes visible when a link is clicked. I want the div to be hidden when the user clicks anywhere on the page except for whithin the div. What is the best way to do...
1
by: Jordan S. | last post by:
I'm just wondering if this would work. Please note that I'm not asking *how* to raise events. I'm clear on that. What I'm not clear on is the sequence in which events are raised by custom controls...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.