Results 1 to 11 of 11

Thread: Calling lines of information **Solved!**--"AHHA"

  1. #1

    Thread Starter
    Member
    Join Date
    Sep 2003
    Posts
    38

    Calling lines of information **Solved!**--"AHHA"

    How can I create a form that I can call information from? such as



    Blah_doStuff

    =========================
    Blah_doStuff

    label.caption= "stuff"
    text.text="im text"

    =========================
    you know what I mean?

    But not in the same Sub.. calling from another sub....

    or callign information for a module... using VB 6.0
    Last edited by scroll; Nov 20th, 2003 at 10:48 PM.
    --
    "If it Stinks Throw it Out" --Scroll

  2. #2
    Banished Cander's Avatar
    Join Date
    Dec 2000
    Location
    Why do you care?
    Posts
    6,913
    Sorry but that doesnt make any sense.
    Stack Overflow
    See the features of Visual Studio 2010 and C# 4.0: The 10-4 show on Channel9

  3. #3

    Thread Starter
    Member
    Join Date
    Sep 2003
    Posts
    38
    I have a bunch of stuff... that I want to reapeat....



    set_labels_to_stuff




    and somewhere else in the form there will be a list of stuff
    that "set_labels_to_stuff" will do




    set_labels_to_stuff=
    =====================
    Set a Label
    Change a Picture
    Change A Textboc
    =====================

    SO when it reads "set_labels_to_stuff" it do the following stuff
    --
    "If it Stinks Throw it Out" --Scroll

  4. #4

  5. #5
    Banished Cander's Avatar
    Join Date
    Dec 2000
    Location
    Why do you care?
    Posts
    6,913
    Evere heared of a Subroutine?
    VB Code:
    1. Public Sub stufftodo
    2.        the stuff you want to do
    3. End Sub
    Stack Overflow
    See the features of Visual Studio 2010 and C# 4.0: The 10-4 show on Channel9

  6. #6
    INXSIVE Bruce Fox's Avatar
    Join Date
    Sep 2001
    Location
    Melbourne, Australia
    Posts
    7,429
    On a Form, place a TextBox, Lable and a CommandButton:
    VB Code:
    1. Option Explicit
    2.  
    3. Private Sub Form_Load()
    4.     Text1.Text = "Start"
    5.     Label1.Caption = "Stop"
    6. End Sub
    7.  
    8. Private Sub Command1_Click()
    9.     If Text1.Text = "Start" Then Label1.Caption = "Start"
    10. End Sub


    Is that what you mean.




    Bruce.

  7. #7
    Hyperactive Member D12Bit's Avatar
    Join Date
    Oct 2000
    Location
    Guatemala
    Posts
    373
    Please ...rephrase your request into something with less "stuff" in it

    something like...

    I want to change the Captions of all my labels to "Blah,blah"
    and also to fill with defaults some textboxes...

    but also...try to write a Before and an After the procedure that you want.
    "Who Dares Wins" - "Quien se Arriesga Gana"
    Mail me at:

  8. #8
    INXSIVE Bruce Fox's Avatar
    Join Date
    Sep 2001
    Location
    Melbourne, Australia
    Posts
    7,429
    I'm on the same wavelenghth pal (I think so ). Like:
    VB Code:
    1. Select Case Label1.Caption
    2.     Case "Stuff 1"
    3.         'Load Picture X
    4.         'Cange TextBox X
    5.     Case "Stuff 2"
    6.         'Load Picture Y
    7.         'Cange TextBox Y
    8.     Case "Stuff 3"
    9.         'Load Picture Z
    10.         'Cange TextBox Z
    11. End Select

    Once the Label1 has had a Caption set, then down at the Select Case will do actions based on the Caption.



    Bruce.

  9. #9
    PowerPoster
    Join Date
    Sep 2003
    Location
    Edmonton, AB, Canada
    Posts
    2,629
    i think he wants to make a function, or just a sub routine like mentioned before..

    VB Code:
    1. Private Sub Form_Load()
    2.   'do stuff
    3.     doStuff
    4. End Sub
    5.  
    6. Private Sub Command1_Click()
    7.   'do stuff again
    8.     doStuff
    9. End Sub
    10.  
    11. Private Function doStuff()
    12.   label1.Caption = "caption"
    13.   text1.Text = "text"
    14. End Function
    Like Archer? Check out some Sterling Archer quotes.

  10. #10

    Thread Starter
    Member
    Join Date
    Sep 2003
    Posts
    38

    AHHA

    AHHA..... Thanks but I figured it out.....

    All I had to do was create my own functions....


    thanks for trying anyway!
    --
    "If it Stinks Throw it Out" --Scroll

  11. #11
    INXSIVE Bruce Fox's Avatar
    Join Date
    Sep 2001
    Location
    Melbourne, Australia
    Posts
    7,429
    Wait


    If your NOT returning something (as in a Function), then use a Sub!


    Functions should Return, Subs don't.




    EDIT: I was way way off (to your original post), sorry




    Bruce.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width