Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > Beginning VB 6
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Beginning VB 6 For coders who are new to Visual Basic, working in VB version 6 (not .NET).
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Beginning VB 6 section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old February 12th, 2006, 01:56 AM
Registered User
 
Join Date: Jan 2006
Location: , , .
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to kevsboy
Default looping events

Good day members! Is there a way where I can loop events? Say:

Public Sub textBox1_KeyPress(ByVal KeyAscii As MSForms.ReturnInteger)
  'Do something

End Sub

Public Sub textBox2_KeyPress(ByVal KeyAscii As MSForms.ReturnInteger)
  'Do something

End Sub

Public Sub textBox3_KeyPress(ByVal KeyAscii As MSForms.ReturnInteger)
  'Do something

End Sub

..... and so on.

What if I have 50 textbox objects, and I need to act on key press entry, is there a way where I don't have to enter these 50 events?

Example:


Public Sub Me.Controls(textBox(i))_KeyPress(ByVal KeyAscii As MSForms.ReturnInteger)
  'Do something

End Sub

Is there such thing? Thanks for your help!

Reply With Quote
  #2 (permalink)  
Old February 12th, 2006, 02:14 AM
Friend of Wrox
 
Join Date: Oct 2004
Location: India.
Posts: 224
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via MSN to ashu_from_india Send a message via Yahoo to ashu_from_india
Default

if u r using VB6, then u can use Control Arrays

Reply With Quote
  #3 (permalink)  
Old February 12th, 2006, 11:04 PM
Registered User
 
Join Date: Jan 2006
Location: , , .
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to kevsboy
Default

Got that right ! Thanks!

Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Looping ssaranam SQL Server 2005 2 April 17th, 2008 01:40 AM
looping mrjoka Classic ASP Basics 1 September 26th, 2007 12:21 AM
Looping deepsea007 XSLT 1 June 14th, 2007 12:13 PM
Looping through rows amysara Excel VBA 1 April 17th, 2007 12:14 AM
Looping..? dedex C# 2 January 6th, 2005 11:24 PM



All times are GMT -4. The time now is 09:05 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.