You are here: MessengerYouLike.IMSDK > IMSDK Reference > IMSDK Namespace > Classes > IMClient Class > IMClient Events > IMClient.OnFriendBlocked Event
MessengerYouLike
IMClient.OnFriendBlocked Event

When Logged in User Blocks a contact

C#
public event OnFriendBlocked;
Visual Basic
Public Event OnFriendBlocked(ByVal FriendUsername As String)
Return Values 
Description 
ByVal FriendUsername As String 
User of Friend that is Blocked 

When IMSDK.IMClient.BeginFriendBlockUnBlock Completes this event is fired if the parameter Block is set to true in the sub IMSDK.IMClient.BeginFriendBlockUnBlock

[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
 
 
 
 
 
 
'To Block a Contact
MC.BeginFriendBlockUnBlock(TxtFriendusername.text, True)
 
 
 
'Then Event
 Private Sub MC_OnFriendBlocked(ByVal FriendUsername As String) Handles MC.OnFriendBlocked
   Debug.WriteLine(FriendUsername & " Blocked")
 End Sub
 
 
 
 
 
 
'To Unblock a Contact
MC.BeginFriendBlockUnBlock(TxtFriendusername.text, False)
 
 
 
'Then Event
Private Sub MC_OnFriendUnBlocked(ByVal FriendUsername As String) Handles MC.OnFriendUnBlocked
     Debug.WriteLine(FriendUsername & " UnBlocked")
End Sub
Copyright (c) 2007. All rights reserved.