You are here: MessengerYouLike.IMSDK > Tutorials > Contacts Management > Move Contact
MessengerYouLike
Move Contact

How to Move a Contact From one Group to Another

  1. Complete Login User

 

 

  1. Now Call the Asynchronous Method IMSDK.IMClient.BeginMoveFriend

 

[Visual Basic]
Private Sub MoveFriendToToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MoveFriendToToolStripMenuItem.Click
        Dim frmg As New FrmMoveFriend
        Dim fr As MessengerYouLike.IMSDK.Friends.MFriend

        Try

            fr = IMC.FindContactListFriend(tvwfriends.SelectedNode.Tag.ToString)
            If fr Is Nothing Then
                Exit Sub
            End If

        Catch ex As Exception
            Exit Sub
        End Try


        For i As Integer = 0 To IMCUser.Groups.Count - 1
            Dim lt As New ListViewItem
            With lt
                .Text = IMCUser.Groups.Item(i).GroupName
                .Tag = IMCUser.Groups.Item(i).UID
            End With
            frmg.lv1.Items.Add(lt)
        Next


        frmg.ShowDialog()
        If frmg.DialogResult = Windows.Forms.DialogResult.OK Then
            IMC.BeginMoveFriend(fr.FriendUsername, frmg.lv1.SelectedItems.Item(0).Tag.ToString)
        End If
        frmg.Close()
        frmg.Dispose()
    End Sub

 

 

 

 

  1. When Move Friend is Completed then event IMSDK.IMClient.OnMoveFriendCompleted is fired

 

Private Sub IMC_OnMoveFriendCompleted(ByVal FriendUsername As String) Handles IMC.OnMoveFriendCompleted
        Debug.WriteLine("Move Friend ( " & FriendUsername & " ) Completed")
End Sub
You are here: MessengerYouLike.IMSDK > Tutorials > Contacts Management > Move Contact
Copyright (c) 2007. All rights reserved.