Results 1 to 2 of 2
  1. #1
    Join Date
    Jun 2004

    Unanswered: VB Beginner help

    I have two subs, sub A and sub B. Sub A has a line that calls sub b. Each looks the following way:
    sub A
    Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox1.SelectedIndexChanged
    sub B
    Public Sub chk1_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Chk1.CheckedChanged

    Problem is I get an error when I try to call Public Sub chk1_CheckedChanged. What does all of that stuff in the parentheses mean? what is handles? sorry, but I'm new to visual basic 2005

  2. #2
    Join Date
    Jul 2003
    Amsterdam, Nederland

    Post hope this will help you

    ok, when an other item is selected in the combobox it will check a other checkbox
    Say you have combobox with values :blue, yellow, green
    and as checkboxes you have : Sky ; Sun ; Tree
    if you select yellow the sun checkbox will be cheked
    if you select Green the Tree checkbox will be cheked

    The handle is an identifyer that is a particular item; in ODBC, this item can be an environment, connection, statement, or descriptor

    the parentheses are identifyer's that tells the next sub who has send the request
    Say you have A Form with 5 textboxes ; text1 text2 ect
    and a sub called Sub check_value (pform as form, textboxname as object)
    if pform.textboxname.text = '' then exit sub
    else do something

    in the buttonclick you write

    For Each Control in me.Controls ' me = the form called FormA
    if typeof Control = textbox then
    check_value (me,
    'the parentheses are : say who is calling the sub formA , wich controle 1 to 5
    end if

    PS use the help files theres a lot off info there, just dubbelclik the word your not sure off and press F1 (Ass long it is'nt self made like the parentheses) on those you click : SHIFT + F2

    if i write :
    dim i as Integer
    and below in the code there is :
    i = 0
    and you want to know what does i holds select the i and prss SHIFT +F2
    it will jump to the line where you have declard it so to the line :
    dim i as Integer
    now you now i can only hold a number

    Select Integer and press F1 and it will tell you its of a LONG type
    and it can hold up to 4 bytes A number between **2,147,483,648 and 2,147,483,647.

Posting Permissions

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