Welcome to Dream.In.Code
Click Here
Getting VB Help is Easy!

Join 117,487 VB Programmers for FREE! Ask your question and get quick answers from experts. There are 2,388 online right now! We've got more than 500 tutorials and 2,000 snippets. Join and find out why Dream.In.Code is the #1 programming help community on the internet! Registration is fast and FREE... Join Now!



How Do I make Number Of Clicks?

 
Reply to this topicStart new topic

How Do I make Number Of Clicks?, Number Of Clicks

koolazngy94
post 29 Jul, 2008 - 03:21 PM
Post #1


New D.I.C Head

*
Joined: 29 Jul, 2008
Posts: 12

I want to make the numbers of click like when I click The Command Button, It will changed to 1, 2, 3,etc. Does Anyone know how to do that?
User is offlineProfile CardPM

Go to the top of the page


PsychoCoder
post 29 Jul, 2008 - 03:22 PM
Post #2


using DIC.Core;

Group Icon
Joined: 26 Jul, 2007
Posts: 7,821



Thanked 79 times

Dream Kudos: 8050

Expert In: VB, VB.Net, C#, SQL, ASP, ASP.Net, Web Development, HTML, CSS, Win32 API, Javascript, mySQL, J#, GDI, Boo.Net

My Contributions


Dream.In.Code has a policy by which we prefer to see a good faith effort on your part before providing source code for homework assignments. Please post the code you have written in an effort to resolve the problem, and our members would be happy to provide some guidance. Be sure to include a description of any errors you are encountering as well.

Please post like this:

Thank you for helping us helping you.
User is online!Profile CardPM

Go to the top of the page

no2pencil
post 29 Jul, 2008 - 03:24 PM
Post #3


Wet D.I.C.

Group Icon
Joined: 10 May, 2007
Posts: 5,418



Thanked 35 times

Dream Kudos: 2350

Expert In: Goofing Off

My Contributions


QUOTE(koolazngy94 @ 29 Jul, 2008 - 06:21 PM) *

I want to make the numbers of click like when I click The Command Button, It will changed to 1, 2, 3,etc. Does Anyone know how to do that?

I think that's refered to as Incremental logic.
User is offlineProfile CardPM

Go to the top of the page

koolazngy94
post 29 Jul, 2008 - 03:27 PM
Post #4


New D.I.C Head

*
Joined: 29 Jul, 2008
Posts: 12

sorry heres the code

CODE
Private Sub Command1_Click()
    If Command1.Caption = "Click Here To Start" Then
        Command1.Caption = "Start"
        Text1.Enabled = True
    Else
    
    If Command1.Caption = "Start" Then
        Timer1.Enabled = True
        Command1.Caption = "Stop"
        Text1.Enabled = False
    Else
        Timer1.Enabled = False
        Command1.Caption = "Start"
        Text1.Enabled = True
    
    End If
    End If
End Sub




Private Sub Label4_Click()

End Sub

Private Sub Command2_Click()
    If Command2.Caption = "Test" Then
        Command2.Caption = "1"
  
    End If
End Sub

Private Sub Text1_Change()
If Val(Text1.Text) < 0.0001 Then
        Text1.Text = ""
    End If
    Timer1.Interval = Val(Text1.Text) * 1000
End Sub

Private Sub Timer1_Timer()
  LeftClick
End Sub


Private Sub Command1_KeyDown(KeyCode As Integer, Shift As Integer)
    If KeyCode = vbKeyF1 Then
        Timer1.Enabled = False
        Command1.Caption = "Start"
        Text1.Enabled = True
    Else
        If KeyCode = vbKeyF2 Then
        Timer1.Enabled = True
        Command1.Caption = "Stop"
        Text1.Enabled = False
    End If
    End If
End Sub


I made a button called Test and I want it when I click it, the number will change. and there will be Reset Button. oh and i also need help with the hotkey. I cant really explain it but is like i open the program, i click on my desktop and hit F2, nothin happens, it suppose to click. is there a way to fix that?

This post has been edited by koolazngy94: 29 Jul, 2008 - 03:29 PM
User is offlineProfile CardPM

Go to the top of the page

koolazngy94
post 29 Jul, 2008 - 05:18 PM
Post #5


New D.I.C Head

*
Joined: 29 Jul, 2008
Posts: 12

please answer? mad.gif blink.gif smile.gif tongue.gif biggrin.gif biggrin.gif biggrin.gif
User is offlineProfile CardPM

Go to the top of the page

tope10
post 31 Jul, 2008 - 12:38 AM
Post #6


New D.I.C Head

*
Joined: 26 Jun, 2008
Posts: 21



Thanked 2 times
My Contributions


QUOTE


I didnt actually get your real problem, but i think that is when you click the button start it will start counting and display the value in the textbox. Is that what you want?

Regarding the Hot key, Try to put your code in the keypress event not on the keydown.

I have attach the code, just try to look on it, if that's what you want..



This post has been edited by tope10: 31 Jul, 2008 - 12:41 AM


Attached File(s)
Attached File  timer.zip ( 1.55k ) Number of downloads: 7
User is offlineProfile CardPM

Go to the top of the page

jeff223
post 24 Aug, 2008 - 06:32 AM
Post #7


New D.I.C Head

*
Joined: 24 Aug, 2008
Posts: 3

Well here's an extremely simple code:

CODE
Private Sub Command1_Click()
Command1.Caption = Command1.Caption + 1
End Sub
User is offlineProfile CardPM

Go to the top of the page

Fast ReplyReply to this topicStart new topic
Time is now: 10/7/08 10:48AM

Live VB Help!

VB Tutorials

Reference Sheets

VB Snippets

Bye Bye Ads

Free DIC T-Shirt

T-Shirt Example

Related Sites

Monthly Drawing

Thumb Drive

Partners

Top Contributors

Top 10 Kudos This Month