【CSkin_Demo】CSkin好友列表的基础操作 本案例是对CSkin.dll中的好友列表的一个简单操作案例,刚新手入门的可以看看。
效果图: 1.获取选择好友。
2.删除选中好友。
3.闪烁选择好友。
更新时间:2013-12-21 窗体代码: [C#] 纯文本查看 复制代码 using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using CCWin.SkinControl;
namespace Demo
{
public partial class Form1 : Form
{
public Form1() {
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e) {
ChatListItem item = new ChatListItem("我的好友");
ChatListSubItem sub = new ChatListSubItem();
sub.NicName = "乔克斯";
sub.DisplayName = "小乔";
sub.Status = ChatListSubItem.UserStatus.QMe;
item.SubItems.Add(sub);
this.chatListBox1.Items.Add(item);
ChatListItem item2 = new ChatListItem("亲人");
ChatListSubItem sub2 = new ChatListSubItem();
sub2.NicName = "乔克斯";
sub2.DisplayName = "小乔";
sub2.Status = ChatListSubItem.UserStatus.QMe;
item2.SubItems.Add(sub2);
this.chatListBox1.Items.Add(item2);
}
private void chatListBox1_DoubleClickSubItem(object sender, ChatListEventArgs e) {
MessageBox.Show("你双击了" + e.SelectSubItem.NicName);
}
private void skinButton1_Click(object sender, EventArgs e) {
this.chatListBox1.SelectItem.SubItems.Remove(this.chatListBox1.SelectSubItem);
}
private void skinButton2_Click(object sender, EventArgs e) {
if (this.chatListBox1.SelectSubItem != null)
MessageBox.Show("你选中了" + this.chatListBox1.SelectSubItem.NicName + " 分组是" + this.chatListBox1.SelectSubItem.OwnerListItem.Text);
}
private void skinButton3_Click(object sender, EventArgs e) {
this.chatListBox1.SelectSubItem.IsTwinkle = true;
}
}
}
项目案例源码:
|