亚洲香蕉成人av网站在线观看_欧美精品成人91久久久久久久_久久久久久久久久久亚洲_热久久视久久精品18亚洲精品_国产精自产拍久久久久久_亚洲色图国产精品_91精品国产网站_中文字幕欧美日韩精品_国产精品久久久久久亚洲调教_国产精品久久一区_性夜试看影院91社区_97在线观看视频国产_68精品久久久久久欧美_欧美精品在线观看_国产精品一区二区久久精品_欧美老女人bb

首頁 > 編程 > C# > 正文

C#編程實現QQ界面的方法

2020-01-24 01:15:01
字體:
來源:轉載
供稿:網友

本文實例講述了C#編程實現QQ界面的方法。分享給大家供大家參考,具體如下:

步驟:

1.新建一個頁面,假如說叫VerticalMenu

2.把html代碼copy到html代碼區

3.把LoadTopMenu方法copy到cs代碼區

4.運行即可

1.html代碼

<STYLE type="text/css">  A:link {}{ COLOR: #000000; FONT-SIZE: 12px; TEXT-DECORATION: none}  A:visited {}{ COLOR: #000000; FONT-SIZE: 12px; TEXT-DECORATION: none}  A:hover {}{ COLOR: #006CD9; FONT-SIZE: 12px; TEXT-DECORATION: none}  BODY {}{ FONT-SIZE: 12px;}  TD {}{ FONT-SIZE: 12px; line-height: 150%}</STYLE><script language="JavaScript"><!--function showitem(id,name){  //打開彈出式頁面  //return ("<span><a href='"+id+"' target=_blank>"+name+"</a></span><br>")  //在框架中打開  return ("<span><a href='#' onclick=/"url('"+id+"');/">"+name+"</a></span><br>")}function url(id){  var source = document.getElementById('fMain');  source.src=id;}function switchoutlookBar(number){  var i = outlookbar.opentitle;  outlookbar.opentitle=number;  var id1,id2,id1b,id2b  if (number!=i && outlooksmoothstat==0){    if (number!=-1)    {      if (i==-1){        id2="blankdiv";        id2b="blankdiv";      }      else{        id2="outlookdiv"+i;        id2b="outlookdivin"+i;        document.all("outlooktitle"+i).style.border="1px none navy";        document.all("outlooktitle"+i).style.background=outlookbar.maincolor;        document.all("outlooktitle"+i).style.color="#ffffff";        document.all("outlooktitle"+i).style.textalign="center";      }      id1="outlookdiv"+number      id1b="outlookdivin"+number      document.all("outlooktitle"+number).style.border="1px none white";      document.all("outlooktitle"+number).style.background=outlookbar.maincolor; //title      document.all("outlooktitle"+number).style.color="#ffffff";      document.all("outlooktitle"+number).style.textalign="center";      smoothout(id1,id2,id1b,id2b,0);    }    else    {      document.all("blankdiv").style.display="";      document.all("blankdiv").sryle.height="100%";      document.all("outlookdiv"+i).style.display="none";      document.all("outlookdiv"+i).style.height="0%";      document.all("outlooktitle"+i).style.border="1px none navy";      document.all("outlooktitle"+i).style.background=outlookbar.maincolor;      document.all("outlooktitle"+i).style.color="#ffffff";      document.all("outlooktitle"+i).style.textalign="center";    }  }}function smoothout(id1,id2,id1b,id2b,stat){  if(stat==0){    tempinnertext1=document.all(id1b).innerHTML;    tempinnertext2=document.all(id2b).innerHTML;    document.all(id1b).innerHTML="";    document.all(id2b).innerHTML="";    outlooksmoothstat=1;    document.all(id1b).style.overflow="hidden";    document.all(id2b).style.overflow="hidden";    document.all(id1).style.height="0%";    document.all(id1).style.display="";    setTimeout("smoothout('"+id1+"','"+id2+"','"+id1b+"','"+id2b+"',"+outlookbar.inc+")",outlookbar.timedalay);  }  else  {    stat+=outlookbar.inc;    if (stat>100)      stat=100;    document.all(id1).style.height=stat+"%";    document.all(id2).style.height=(100-stat)+"%";    if (stat<100)       setTimeout("smoothout('"+id1+"','"+id2+"','"+id1b+"','"+id2b+"',"+stat+")",outlookbar.timedalay);    else    {      document.all(id1b).innerHTML=tempinnertext1;      document.all(id2b).innerHTML=tempinnertext2;      outlooksmoothstat=0;      document.all(id1b).style.overflow="auto";      document.all(id2).style.display="none";    }  }}function getOutLine(){  outline="<table "+outlookbar.otherclass+">";  for (i=0;i<(outlookbar.titlelist.length);i++)  {    outline+="<tr><td name=outlooktitle"+i+" id=outlooktitle"+i+" ";     if (i!=outlookbar.opentitle)       outline+=" nowrap align=center style='cursor:hand;background-color:"+outlookbar.maincolor+";color:#ffffff;height:20;border:1 none navy' ";    else      outline+=" nowrap align=center style='cursor:hand;background-color:"+outlookbar.maincolor+";color:white;height:20;border:1 none white' ";    outline+=outlookbar.titlelist[i].otherclass    outline+=" onclick='switchoutlookBar("+i+")'><span class=smallFont>";    outline+=outlookbar.titlelist[i].title+"</span></td></tr>";    outline+="<tr><td name=outlookdiv"+i+" valign=top align=center id=outlookdiv"+i+" style='width:100%"    if (i!=outlookbar.opentitle)       outline+=";display:none;height:0%;";    else      outline+=";display:;height:100%;";    outline+="'><div name=outlookdivin"+i+" id=outlookdivin"+i+" style='overflow:auto;width:100%;height:100%'>";    for (j=0;j<outlookbar.itemlist[i].length;j++)      outline+=showitem(outlookbar.itemlist[i][j].key,outlookbar.itemlist[i][j].title);    outline+="</div></td></tr>"  }  outline+="</table>"  return outline}function show(){  var outline;  outline="<div id=outLookBarDiv name=outLookBarDiv style='width=100%;height:100%'>"  outline+=outlookbar.getOutLine();  outline+="</div>"  document.write(outline);}function theitem(intitle,instate,inkey){  this.state=instate;  this.otherclass=" nowrap ";  this.key=inkey;  this.title=intitle;}function addtitle(intitle){  outlookbar.itemlist[outlookbar.titlelist.length]=new Array();  outlookbar.titlelist[outlookbar.titlelist.length]=new theitem(intitle,1,0);  return(outlookbar.titlelist.length-1);}function additem(intitle,parentid,inkey){  if (parentid>=0 && parentid<=outlookbar.titlelist.length)  {    outlookbar.itemlist[parentid][outlookbar.itemlist[parentid].length]=new theitem(intitle,2,inkey);    outlookbar.itemlist[parentid][outlookbar.itemlist[parentid].length-1].otherclass=" nowrap align=left style='height:5' ";    return(outlookbar.itemlist[parentid].length-1);  }  else    additem=-1;}function outlook(){  this.titlelist=new Array();  this.itemlist=new Array();  this.divstyle="style='height:100%;width:100%;overflow:auto' align=center";//可以在這里設置對齊方式  this.otherclass="border=0 cellspacing='0' cellpadding='0' style='height:100%;width:100%'valign=middle align=center ";  this.addtitle=addtitle;  this.additem=additem;  this.starttitle=-1;  this.show=show;  this.getOutLine=getOutLine;  this.opentitle=this.starttitle;  this.reflesh=outreflesh;  this.timedelay=50;  this.inc=10;  this.maincolor = "#336699"}function outreflesh(){  document.all("outLookBarDiv").innerHTML=outlookbar.getOutLine();}function locatefold(foldname){  if (foldname=="")    foldname = outlookbar.titlelist[0].title  for (var i=0;i<outlookbar.titlelist.length;i++)  {    if(foldname==outlookbar.titlelist[i].title)    {      outlookbar.starttitle=i;      outlookbar.opentitle=i;    }  }}var outlookbar=new outlook();var tempinnertext1,tempinnertext2,outlooksmoothstatoutlooksmoothstat = 0;<%=LoadVerticalMenu()%>//從數據庫產生垂直菜單//--></script><table id="mnuList" style="WIDTH:150px;HEIGHT: 100%" cellspacing="0" cellpadding="0" align="left"  border="0">  <tr>    <td bgcolor="#F0F0E5" id="outLookBarShow" style="HEIGHT: 100%" valign="top" align="middle"      name="outLookBarShow">      <script language="JavaScript">      <!--      locatefold("")      outlookbar.show()       //-->      </script>    </td>  </tr></table>

2.cs代碼

public class VerticalMenu : System.Web.UI.Page{  protected DataRow[] father;  protected DataRow[] first;    private void Page_Load(object sender, System.EventArgs e)    {      // 模擬QQ菜單    }  public static string ConnectionString=System.Configuration .ConfigurationSettings .AppSettings["ConnectionString"];      GetDataSet#region GetDataSet    public static DataSet GetDataSet(string sql)    {      SqlDataAdapter  sda =new SqlDataAdapter(sql,ConnectionString);      DataSet ds=new DataSet();      sda.Fill(ds);      return ds;    }    #endregion  protected string LoadVerticalMenu()  {  string sqlFather="select * from PowerSetting";  DataSet dsFather=GetDataSet(sqlFather);  father=dsFather.Tables[0].Select("IsBoot=0","IsBoot");  string menu="";  foreach(DataRow drfather in father)  {    menu+="var t;";    menu+="t=outlookbar.addtitle('"+drfather["Description"]+"');";    first=dsFather.Tables[0].Select("ParentID='"+Convert.ToInt32(drfather["ParentID"])+"' and IsBoot=1","IsBoot");    foreach(DataRow drfirst in first)    {      menu+="outlookbar.additem('"+drfirst["Description"]+"',t,'"+drfirst["Url"]+"');";    }  }  return menu;  }    Web Form Designer generated code#region Web Form Designer generated code    override protected void OnInit(EventArgs e)    {      //      // CODEGEN: This call is required by the ASP.NET Web Form Designer.      //      InitializeComponent();      base.OnInit(e);    }    /**//**//**//// <summary>    /// Required method for Designer support - do not modify    /// the contents of this method with the code editor.    /// </summary>    private void InitializeComponent()    {      this.Load += new System.EventHandler(this.Page_Load);    }    #endregion}

3.數據庫腳本

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[PowerSetting]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)drop table [dbo].[PowerSetting]GOCREATE TABLE [dbo].[PowerSetting] (  [PowerSettingID] [int] IDENTITY (1, 1) NOT NULL ,      --id  [ParentID] [int] NOT NULL ,            --父節點id  [Description] [nvarchar] (255) COLLATE Chinese_PRC_CI_AS NULL ,  --菜單描述內容  [Icon] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,    --要顯示圖標  [Url] [nvarchar] (255) COLLATE Chinese_PRC_CI_AS NULL ,    --url  [Target] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,    --_self,_blank等  [CreateByID] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,  --創建人id  [CreateON] [datetime] NULL ,          --創建日期  [IsEnabled] [bit] NULL ,            --是否可用  [IsBoot] [int] NULL             --是不是根節點;1是其他不是) ON [PRIMARY]GO

更多關于C#相關內容感興趣的讀者可查看本站專題:《C#數據結構與算法教程》、《C#常見控件用法教程》、《C#面向對象程序設計入門教程》及《C#程序設計之線程使用技巧總結

希望本文所述對大家C#程序設計有所幫助。

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
亚洲香蕉成人av网站在线观看_欧美精品成人91久久久久久久_久久久久久久久久久亚洲_热久久视久久精品18亚洲精品_国产精自产拍久久久久久_亚洲色图国产精品_91精品国产网站_中文字幕欧美日韩精品_国产精品久久久久久亚洲调教_国产精品久久一区_性夜试看影院91社区_97在线观看视频国产_68精品久久久久久欧美_欧美精品在线观看_国产精品一区二区久久精品_欧美老女人bb
久久久人成影片一区二区三区| 欧美成人免费全部观看天天性色| 亚洲国产精品va在线| 91麻豆国产语对白在线观看| 亚洲国产精品网站| 91精品视频在线免费观看| 国内精品伊人久久| 中文字幕九色91在线| 精品国内亚洲在观看18黄| 91国产精品电影| 成人国产在线视频| 91九色单男在线观看| 久久精品国产亚洲精品| 全亚洲最色的网站在线观看| 欧美日韩国产中字| 欧美黑人一区二区三区| 欧美中文字幕视频在线观看| 久久精品久久精品亚洲人| 亚洲精品久久7777777| 国产精品入口夜色视频大尺度| 欧美猛少妇色xxxxx| 精品久久久久久| 亚洲aⅴ男人的天堂在线观看| 国产亚洲视频在线| 欧美激情在线观看视频| 久久久免费电影| 影音先锋日韩有码| 中文字幕亚洲图片| 欧美性猛交xxxx偷拍洗澡| 激情成人中文字幕| 91精品久久久久久久久久入口| 国产精品久久久久久久久免费| 久久九九有精品国产23| 亚洲国产91色在线| 91在线无精精品一区二区| 日韩中文字幕久久| 尤物九九久久国产精品的特点| 国产亚洲综合久久| 国产精品久久久久久久久免费看| 成人精品在线视频| 91久久国产精品| 久久久久国产一区二区三区| 成人久久久久久久| 欧美xxxx14xxxxx性爽| 97精品伊人久久久大香线蕉| 国产精品视频在线观看| 久久久免费高清电视剧观看| 亚洲成人精品视频| 久久久国产精品亚洲一区| 成人疯狂猛交xxx| 国语自产精品视频在免费| 欧美日韩一二三四五区| 粉嫩av一区二区三区免费野| 日韩综合中文字幕| 大胆人体色综合| 日本一区二区三区四区视频| 91在线免费网站| 国产欧美日韩亚洲精品| 国产成人精品网站| 久久久久久久香蕉网| 国产欧洲精品视频| 午夜精品福利电影| 久久精品电影网| 国产美女高潮久久白浆| 国产精品夜间视频香蕉| xxxxx91麻豆| 国产精品视频久久| 欧美尤物巨大精品爽| 久久av资源网站| 国产精品成人av性教育| 欧美一级在线亚洲天堂| 456国产精品| 日韩精品极品在线观看播放免费视频| 黑人巨大精品欧美一区二区一视频| 国产在线视频2019最新视频| 日韩av在线免费| 日本成人激情视频| 欧美日韩国产成人在线观看| 欧美精品激情blacked18| 91免费的视频在线播放| 国产精品偷伦免费视频观看的| 亚洲免费精彩视频| 国产精品麻豆va在线播放| 中文字幕亚洲在线| 91伊人影院在线播放| 日韩av在线免费观看一区| 国产亚洲欧洲在线| 欧美日韩一区二区在线| 久久久久国产一区二区三区| 欧美性生交xxxxx久久久| 日本一区二区不卡| 日韩中文字幕视频| 亚洲欧洲xxxx| 国产精品久久久久久久久男| 国内精品久久影院| 日韩精品在线播放| 成人激情视频在线播放| 久久香蕉频线观| 亚洲精品自在久久| 国产一区二区丝袜| 综合激情国产一区| 91丝袜美腿美女视频网站| 国产在线拍偷自揄拍精品| 91沈先生在线观看| 亚洲精品视频播放| 欧美日韩一区二区免费视频| 国产精品入口夜色视频大尺度| 欧美日韩另类在线| 国产精品三级网站| 成人国产精品免费视频| 亚洲成人精品久久| 国产精品视频久久久久| 国产网站欧美日韩免费精品在线观看| 欧美激情精品久久久久久变态| 国产精品亚洲аv天堂网| 日韩精品欧美国产精品忘忧草| 国产91亚洲精品| 97久久精品在线| 国产精品一区二区在线| 孩xxxx性bbbb欧美| 国产在线a不卡| 成人两性免费视频| 欧美日韩国产精品一区二区不卡中文| 久久国产精品久久久| 国产91|九色| 欧美激情aaaa| 亚洲一区二区国产| 亚洲欧洲在线观看| 欧美性做爰毛片| 九九九久久久久久| 日韩中文字幕在线| 一本色道久久88精品综合| 亚洲欧美在线一区二区| 韩国一区二区电影| 国产精品丝袜久久久久久高清| 亚洲欧美中文日韩v在线观看| 国产精品久久久久久搜索| 成人性生交xxxxx网站| 亚洲a∨日韩av高清在线观看| 国产日韩欧美日韩大片| 日韩一级裸体免费视频| 久久九九免费视频| 日本欧美一级片| 中文字幕视频一区二区在线有码| 日韩欧美成人免费视频| 国产午夜精品一区理论片飘花| 国产欧美一区二区三区在线看| 欧美日韩精品在线播放| 91在线网站视频| 国产精品美女视频网站| 国产一区二区动漫| 欧美激情在线一区| 91久久久久久| 亚洲乱码一区av黑人高潮| 91高清免费视频| 亚洲一区二区中文字幕| 欧美激情二区三区| 91精品在线看| 亚洲白拍色综合图区| 国产成人久久久| 国产精品夜色7777狼人| 亚洲直播在线一区| 欧美一区二区三区艳史| 国产日韩欧美91|