You are here: MessengerYouLike.IMSDK > IMSDK Reference > IMSDK Namespace > Classes > IMClient Class > IMClient Methods > IMClient.BeginAddGroup Method
MessengerYouLike
IMClient.BeginAddGroup Method

This Method Allows Users to add a group to there Contacts list.

C#
public BeginAddGroup(String GroupName);
Visual Basic
Public Sub BeginAddGroup(ByVal GroupName As String)
Parameters 
Description 
ByVal GroupName As String 
Name of Group That users Wants to Create 

This Sub Allows users to create new groups , The total Number of Groups Should Not Exceed the value set by property IMSDK.IMClient.MAXGroups,The Group is created with Name specified in the parameter GroupName 

Groups With Same Name Are allowed They are Identified With there ID's  

[Visual Basic]
 
 
'Create a new IMClient
Dim MC as new IMSDK.IMClient
 
 
'Call the Listen Sub
MC.Listen()
 
 
 
'Now Try to login
MC.BeginLogin(TxtUsername.Text,TxtPassword.Text)
 
 
 
 
'if username and password is valid then
Private Sub MC_OnLoggedin(ByVal UserObject As IMSDK.User) Handles MC.OnLoggedin
    Debug.WriteLine("Username logged in : " & MCUser.Username & " , " & MCUser.Password)
End Sub
 
 
 
 
'if username or password is invalid then
Private Sub MC_OnUsernameOrPasswordInvalid(ByVal Username As String, ByVal Password As String) Handles MC.OnUsernameOrPasswordInvalid
  Debug.WriteLine("Username password invalid : " & Username & " , " & Password)
End Sub
 
 
 
 
'Now Create new Group
 MC.BeginAddGroup(TxtGroupName.text)
 
 
 
When Group is Created
Private Sub MC_OnGroupAdded(ByVal GroupName As String) Handles MC.OnGroupAdded
    Debug.WriteLine("Group Added : " & GroupName)
End Sub
Copyright (c) 2007. All rights reserved.