What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Skype & Technology » Tech Talk » N00bish VB question

N00bish VB question
Author: Message:
Choli
Elite Member
*****

Avatar
Choli

Posts: 4714
Reputation: 42
43 / Male / Flag
Joined: Jan 2003
RE: N00bish VB question
declare a global variable (outside any function or sub you put the declaration)
code:
Dim times as long
in the load sub of the form, make sure you initializa that variable to the proper number, 0 for example)
code:
private sub form1_load()
  ' more code
   times=0
end sub

and in the button click sub, you put this code:
code:
private sub button1_click()
   times=times+1'the user clicked the button once more
   select case times
         case 1 ' 1st time the button is clicked
                label1.caption="1st text"
         case 2 ' 2nd time the button is clicked
                label1.caption="2nd text"
         case 3 ' 3rd time the button is clicked
                label1.caption="3rd text"
          ' etc....
         case else ' all the other cases (ie: from the last click you have coded)
                 label1.caption="you've clicked the button more times than what I was expected and didn't coded any other text to be displayed .p"
     end select
end sub



there are other ways to do that too. If the texts to be displayed are always the same, you can create an array of text and use the times variable to access the proper text (label1.caption=label1_texts[times])

This post was edited on 06-04-2004 at 03:12 PM by Choli.
Messenger Plus! en espaņol:
<< http://www.msgpluslive.es/ >>
<< http://foro.msgpluslive.es/ >>
:plus4:
06-04-2004 03:10 PM
Profile PM Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
N00bish VB question - by Anubis on 06-04-2004 at 02:51 PM
RE: N00bish VB question - by Stigmata on 06-04-2004 at 02:58 PM
RE: N00bish VB question - by Anubis on 06-04-2004 at 03:01 PM
RE: N00bish VB question - by Stigmata on 06-04-2004 at 03:03 PM
RE: N00bish VB question - by Anubis on 06-04-2004 at 03:05 PM
RE: N00bish VB question - by Choli on 06-04-2004 at 03:10 PM
RE: N00bish VB question - by Sk3tch on 06-04-2004 at 03:10 PM
RE: N00bish VB question - by Anubis on 06-04-2004 at 03:12 PM
RE: N00bish VB question - by Choli on 06-04-2004 at 03:16 PM
RE: N00bish VB question - by Anubis on 06-04-2004 at 03:21 PM
RE: N00bish VB question - by dotNorma on 06-04-2004 at 03:22 PM
RE: N00bish VB question - by Mike on 06-04-2004 at 03:44 PM
RE: N00bish VB question - by Choli on 06-04-2004 at 05:15 PM
RE: N00bish VB question - by Millenium_edition on 06-04-2004 at 05:37 PM


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On