Visual Basic Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgrammingVisual Basic Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old April 9th, 2005, 08:40 PM
KevinLee KevinLee is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Feb 2005
Posts: 36 KevinLee User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 h 13 m 9 sec
Reputation Power: 4
Question SendKey under VB6

Could anyone tell me how to use SendKey under VB6 for a "RIGHT" arrow key and a "RETURN/ENTER"?Any references I have to add?
Thanks!

Reply With Quote
  #2  
Old April 10th, 2005, 08:03 PM
Doug G Doug G is offline
Grumpier Old Moderator
ASP Free God 11th Plane (10000 - 10499 posts)
 
Join Date: Sep 2003
Posts: 10,143 Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 3 Weeks 4 Days 22 h 23 m 39 sec
Reputation Power: 181
http://msdn.microsoft.com/library/e...stmSendKeys.asp
F1 in VB should have found this for you.
__________________
======
Doug G
======
I didn't attend the funeral, but I sent a nice letter saying I approved of it. --Mark Twain

Reply With Quote
  #3  
Old April 12th, 2005, 06:20 PM
KevinLee KevinLee is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Feb 2005
Posts: 36 KevinLee User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 h 13 m 9 sec
Reputation Power: 4
Question

It does help! For curiosity I have quoted the following code -

Private Sub Form_Load()

Dim answer
Dim WshSell
answer = MsgBox("Please choose", 3 + 16, "Answer me")
MsgBox "Before auto answer is" & answer 'This should show 6

SendKeys "{LEFT}"
SendKeys "{LEFT}"
SendKeys "~"
If answer = 2 Then MsgBox "CANCEL"
If answer = 6 Then MsgBox "YES"
If answer = 7 Then MsgBox "NO"
MsgBox "After auto answer is" & answer "This should show 2
End Sub

The purpose is to choose "Cancel" which is on the far right side by going "Right" and "Right". But only to close the pop-up window. Is that a way that I could close the display window, therefore the action is automatic (let's say after 5 seconds) if there is NO response from the user. I want an answer NOT using VBYes, VBCancel....... Thanks.

Reply With Quote
  #4  
Old April 12th, 2005, 10:03 PM
Doug G Doug G is offline
Grumpier Old Moderator
ASP Free God 11th Plane (10000 - 10499 posts)
 
Join Date: Sep 2003
Posts: 10,143 Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 3 Weeks 4 Days 22 h 23 m 39 sec
Reputation Power: 181
You could use a timer control set to 5 seconds and use sendkeys in the timer event procedure.

Reply With Quote
  #5  
Old April 13th, 2005, 12:01 PM
KevinLee KevinLee is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Feb 2005
Posts: 36 KevinLee User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 h 13 m 9 sec
Reputation Power: 4
Question

Could I close the MsgBox automatically through VB6 after a certain (5 seconds) time by coding?

Thanks.

Reply With Quote
  #6  
Old April 13th, 2005, 09:18 PM
Doug G Doug G is offline
Grumpier Old Moderator
ASP Free God 11th Plane (10000 - 10499 posts)
 
Join Date: Sep 2003
Posts: 10,143 Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 3 Weeks 4 Days 22 h 23 m 39 sec
Reputation Power: 181
I don't know if you can close a VB msgbox, but if you make your own custom msgbox form you can certainly close that from code.

Reply With Quote
Reply

Viewing: ASP Free ForumsProgrammingVisual Basic Programming > SendKey under VB6


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway
Stay green...Green IT