快捷搜索:  as  test  1111  test aNd 8=8  test++aNd+8=8  as++aNd+8=8  as aNd 8=8

亿鼎博娱乐官网网址_集报网



会飞的鱼前段光阴写了篇文章,先容若何实现类似QQ神色对话框的功能,详细描述见文章《c# 类似于QQ神色弹出框功能的二种实现措施》。刚好近来我也有类似的需求,我刚开始的设法主见是在Panel中动态创建PictureBox来加载QQ神色,如:

private void InitImageControl(int colCount, int rowCount)

{

for (int i = 0; i

因为代码对照简单,就直接贴代码了:

加载QQ神色

private int currentPageIndex = 1;//当前页代码

private int pageSize = 0;//统共页数

///

/// 加载QQ神色

///

///

当前页

///

每页显示神色的行数

///

每页显示神色的列数

private void LoadQQFace(int currentPage,int rowCount,int colCount)

{

currentPageIndex = currentPage;

string _template = string.Empty;

string templateFile = Application.StartupPath + @"\template.html";//网页模版

_template = File.ReadAllText(templateFile);

//图像的设置设置设备摆设摆设文件

string _configInfo = string.Empty;

string configFile = Application.StartupPath + @"\face.xml";

DataSet ds = new DataSet();

ds.ReadXml(configFile);

DataTable亿鼎博娱乐官网网址 dtFaces = ds.Tables[0];

int totalCount =dtFaces.Rows.Count;

pageSize = totalCount % (rowCount * colCount) == 0 ? totalCount / (rowCount * colCount) : totalCount / (rowCount * colCount)+1;

//加载表格

string tableRowContent=string.Empty;

for (int i = 1; i ";

}

else

{

tableRow += "

";

}

}

tableRow += "";

tableRowContent += tableRow;

}

int LeftLimt = 29 * (colCount / 2);

int RightLimt = (colCount亿鼎博娱乐官网网址 - 3) * 29;

_templ亿鼎博娱乐官网网址ate = _template.WordStr("$TableRow$", tableRowContent).WordStr("$LeftLimt$",LeftLimt.ToString()).WordStr("$RightLimt$",RightLimt.ToStrin亿鼎博娱乐官网网址g());

//设置网页的背景致和窗体的同等

Color bgColor = this.BackColor;

string webBgColor = ColorTranslator.ToHtml(bgColor);

_template = _template.WordStr("$BgColor$", webBgColor);

//设置导航

string pageStr = currentPage + "/" + pageSize;

string navigation = "

"+pageStr+" 上一页 下一页

";

_template = _template.WordStr("$Navigation$", navigation);

//存莅临时文件

string tempHtmlFile = Path.GetTempPath() + "tempHtmlFile.html";

File.WriteAllText(tempHtmlFile, _template);

webBrowser1.Navigate(tempHtmlFile);

webBrowser1.DocumentCompleted += new WebBrowserDocumentCompletedEventHandler(webBro亿鼎博娱乐官网网址wser1_DocumentCompleted);

this.Width =29*colCount+21;

this.Height = 29 * rowCount+80;

}

免责声明:以上内容源自网络,版权归原作者所有,如有侵犯您的原创版权请告知,我们将尽快删除相关内容。

您可能还会对下面的文章感兴趣: