Results 1 to 2 of 2

Thread: IRC Help

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Feb 2008
    Posts
    207

    IRC Help

    I am connected to IRC. I'm trying to get it so when someone clicks "Join Channel" a new form comes up with a textbox and button. I have that part figured out, but after they click "OK" in the new window, how do I send the data of that textbox back to the main IRC form so it joins the new channel. Here is a few pictures.

    Main Chat Form:



    Join New Channel Form:


  2. #2
    "Digital Revolution"
    Join Date
    Mar 2005
    Posts
    4,471

    Re: IRC Help

    There are several ways to do it...public variable in a module, public sub in the main form, or a public property. Personally, I use properties now for this kind of thing. Here's an example:

    In the main IRC form:
    vb Code:
    1. 'General declarations section, below Option Explicit somewhere...
    2. Private p_Channel As String
    3.  
    4. 'With your other procedures.
    5. Public Property Get Channel() As String
    6.     Channel = p_Channel
    7. End Property
    8.  
    9. Public Property Let Channel(ByRef NewValue As String)
    10.     p_Channel = NewValue
    11.     'Channel has changed, join?
    12.     If Len(NewValue) > 0 Then
    13.         'Code to join new channel
    14.     End If
    15. End Property

    Then in the form that pops up and asks for a channel name, in the command button you can put:

    vb Code:
    1. Private Sub cmdJoin_Click()
    2.     'Main IRC form     Name of channel box
    3.     frmIRC.Channel = txtChannel.Text
    4.     Unload Me
    5. End Sub

    I think this way is easier and cleaner than a public sub or variable somewhere.

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