The Philippine Electronics and Technology Forum
February 10, 2012, 02:08:27 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
 
   Home   Help Search Login Register  

Pages: [1]   Go Down
  Print  
Author Topic: visual basic 6.0 question! need reply asap! thx..  (Read 408 times)
bokisnotageek
LR44 Battery
*

Pogi/Ganda Points: 0
Offline Offline

Posts: 0


« on: July 30, 2010, 01:17:26 PM »

Hello Forum,
I have a simple (I hope) question. When I press a command button, I would like the function it is programmed to do to repeat as long as the button is click and held. I can't seem to find a function to do this.
Thanks for the help.
Logged
The Philippine Electronics and Technology Forum
« on: July 30, 2010, 01:17:26 PM »

 Logged
dummy_c
Diesel Generator
*

Pogi/Ganda Points: 88
Offline Offline

Gender: Male
Posts: 1045


Learning PIC uC. Posting datasheets on my wall.


WWW
« Reply #1 on: August 12, 2010, 01:36:19 PM »

Problema ko rin ito nuon. Dahil na din sa kulang na time para matuto sa VB. Instead gumamit nlang ako ng timer to check if the button is pressed.


Note:
Kung ako sayo huwag ka gumamit ng salitang ASAP kasi parang minamadali mo sila dito. Hindi ka tuloy na sagotan ng mga masters. Grin
Logged

alyas
Gas Turbine
**

Pogi/Ganda Points: 167
Offline Offline

Posts: 2520



WWW
« Reply #2 on: August 12, 2010, 02:47:49 PM »

Maski sa VB 2010 walang ganyang event.  The nearest thing you can do is make it a click on click off button.

Edit:  Pwede din ata .... sa loob ng loop mo for the button click event, pwede ka gumawa ng checking if the button is still clicked or not.

Logged

alyas
Gas Turbine
**

Pogi/Ganda Points: 167
Offline Offline

Posts: 2520



WWW
« Reply #3 on: August 12, 2010, 03:36:06 PM »

Nag-aaral din ako ng Visual Basic, VB2010 nga lang.

Eto siguro masmadaling gawin.

Subukan mo gumamit ng button1.keydown at button1.keyup event handler.  The button1.keydown event will start your routine and the button1.keyup will stop your routine.  Di ko lang alam kung may ganyan din sa VB6.
Logged

dummy_c
Diesel Generator
*

Pogi/Ganda Points: 88
Offline Offline

Gender: Male
Posts: 1045


Learning PIC uC. Posting datasheets on my wall.


WWW
« Reply #4 on: August 12, 2010, 03:57:36 PM »

Nag-aaral din ako ng Visual Basic, VB2010 nga lang.

Eto siguro masmadaling gawin.

Subukan mo gumamit ng button1.keydown at button1.keyup event handler.  The button1.keydown event will start your routine and the button1.keyup will stop your routine.  Di ko lang alam kung may ganyan din sa VB6.


Pwede hoh ba makapagbigay ka ng kunting sample code kung paano mo ginawa master.. Thanks.
Logged

alyas
Gas Turbine
**

Pogi/Ganda Points: 167
Offline Offline

Posts: 2520



WWW
« Reply #5 on: August 12, 2010, 05:24:49 PM »


Pwede hoh ba makapagbigay ka ng kunting sample code kung paano mo ginawa master.. Thanks.
Mali pala, hindi gumagana sa command button .... sa keys pala sa keyboard yun gumagana (yung keyup at keydown).
Logged

dummy_c
Diesel Generator
*

Pogi/Ganda Points: 88
Offline Offline

Gender: Male
Posts: 1045


Learning PIC uC. Posting datasheets on my wall.


WWW
« Reply #6 on: August 12, 2010, 05:53:54 PM »

Mali pala, hindi gumagana sa command button .... sa keys pala sa keyboard yun gumagana (yung keyup at keydown).

Yah tina try ko nga hindi gagana,hehe.. Anyways salamat po.
Logged

NanotecH
Lead Acid Battery
*******

Pogi/Ganda Points: 43
Offline Offline

Posts: 767



« Reply #7 on: August 12, 2010, 07:27:21 PM »

@ts, possible yan kung gagamitan ng WithEvents, RaiseEvent sa class module...
Logged

220V/10A input = 220V/30A output...Fact or Fiction?  Myth or Reality?
One word is enough for a wise man.
"Never tell the truth to people who are not worthy of it." - Mark Twain
overmind
CR2032 Battery
**

Pogi/Ganda Points: 1
Offline Offline

Posts: 34



« Reply #8 on: September 01, 2010, 01:30:22 AM »

sister, try mo gamitin yung MouseDown and MouseUp events ng command button..

sample program: gawa ka ng 1 textbox and 1 command button
- when clicked a function that counts 1 to 30000 in an endless loop will appear on the textbox and will stop after the button is released

<code>
Dim boolx As Boolean

Private Sub Command1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
boolx = True
test1
End Sub

Private Sub Command1_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
boolx = False
End Sub

Private Sub test1()
Dim xx As Integer
Do While boolx = True
    xx = xx + 1
    Text1.Text = xx
    If xx = 30000 Then xx = 0
    DoEvents
Loop
End Sub

</code>
Logged

Knowing others is wisdom, knowing yourself is Enlightenment.
7_SeVeN_7
Technical People
Solar Power Satellite
*****

Pogi/Ganda Points: 380
Offline Offline

Posts: 5954


There is no delight in owning anything unshared.


« Reply #9 on: September 08, 2010, 04:09:37 PM »

spam!
Logged

E-Gizmo Mechatronix Central: www.e-gizmo.com

Tel #: (63)(2) 536-3378
Globe +63915-973-7691
Smart +63921-779-0748

Location Map

YM: julie.egizmo  aka Born2BeWired  Grin
The Philippine Electronics and Technology Forum
   

 Logged
Pages: [1]   Go Up
  Print  
 
Jump to:  


Related Topics
Subject Started by Replies Views Last post
The Impact of Visual Basic on Electronics versus Visual C++
General Electronics and Technology Discussion
underprezzure 11 1540 Last post November 01, 2008, 05:04:23 PM
by ef - el - ay - pee
Need hep(Visual Basic 6.0)
Computer Programming/Software Engineering
midnytsugar 17 1879 Last post March 21, 2009, 12:41:41 PM
by Dennis
Visual Basic
Personal, Academic and Commercial Electronics Projects
prettyNpink07 1 474 Last post March 20, 2009, 10:43:45 PM
by eveready battery
Visual basic
General Electronics and Technology Discussion
prettyNpink07 1 453 Last post March 21, 2009, 06:12:45 AM
by torquewrench
Help on Vista Home Basic... ASAP.. :)
General Computers and Internet Talk
dajuanenonli 8 945 Last post May 08, 2009, 04:32:11 PM
by dajuanenonli
SQL with visual basic 6..
Computer Software
jkl_0 0 294 Last post September 02, 2009, 06:58:44 PM
by jkl_0
QUICK QUESTION...NID ANSWER ASAP
Communications Engineering
chicobulilit 3 480 Last post July 08, 2011, 01:40:36 PM
by torpedo
Powered by MySQL Powered by PHP Powered by SMF 1.1.15 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!