TabControl Ver 1.0
사용법..ㅡ.ㅡ;만들어 놓은 지는 꽤 되지만..만들고 그때 프로젝트 외에 다른 프로젝트에서 써본적이 없다..ㅋ~
2005년 1월에 만든거네..ㅡ.ㅡ;
[소스코드]
#region 탭 컨트롤 설정 private void Initialize() { ArrayList altText = new ArrayList(); ArrayList selectedImage = new ArrayList(); ArrayList unSelectedImage = new ArrayList(); if (this.CafeType == 4) { altText.Add("카페소개"); selectedImage.Add("http://image.starlibrary.com/web/english/button71_over.gif"); unSelectedImage.Add("http://image.starlibrary.com/web/english/button71.gif"); altText.Add("제품안내"); selectedImage.Add("http://image.starlibrary.com/web/english/button72_over.gif"); unSelectedImage.Add("http://image.starlibrary.com/web/english/button72.gif"); altText.Add("카페운영자"); selectedImage.Add("http://image.starlibrary.com/web/english/button73_over.gif"); unSelectedImage.Add("http://image.starlibrary.com/web/english/button73.gif"); altText.Add("카페영어회"); selectedImage.Add("http://image.starlibrary.com/web/english/button74_over.gif"); unSelectedImage.Add("http://image.starlibrary.com/web/english/button74.gif"); } else { altText.Add("행사안내"); selectedImage.Add("http://image.starlibrary.com/web/english/button11_over.gif"); unSelectedImage.Add("http://image.starlibrary.com/web/english/button11.gif"); if (this.CafeType == 0 || this.CafeType == 2)//문화카페, 양평캠프 { altText.Add("관련필독도서"); selectedImage.Add("http://image.starlibrary.com/web/read/button33_over.gif"); unSelectedImage.Add("http://image.starlibrary.com/web/read/button33.gif"); } else { altText.Add("참여안내"); selectedImage.Add("http://image.starlibrary.com/web/english/button12_over.gif"); unSelectedImage.Add("http://image.starlibrary.com/web/english/button12.gif"); } } altText.Add("참여하기"); selectedImage.Add("http://image.starlibrary.com/web/english/button13_over.gif"); unSelectedImage.Add("http://image.starlibrary.com/web/english/button13.gif"); altText.Add("앨범"); selectedImage.Add("http://image.starlibrary.com/web/english/button14_over.gif"); unSelectedImage.Add("http://image.starlibrary.com/web/english/button14.gif"); altText.Add("게시판"); selectedImage.Add("http://image.starlibrary.com/web/english/button15_over.gif"); unSelectedImage.Add("http://image.starlibrary.com/web/english/button15.gif"); this.TabControl1.AlternateText = altText; this.TabControl1.SelectedImage = selectedImage; this.TabControl1.UnSelectedImage = unSelectedImage; } #endregion private void TabControl1_SelectedIndexChanged(object sender, Cafe.UserControls.TabControl.SelectedIndexChangedEventArgs e) { Components.Base db = new Cafe.Components.Base(); if (this.CafeType == 4) //단위사업장 { switch (e.CurrnetPosition) { case 0: this.content.Visible = true; this.ifr.Attributes["Src"] = ""; this.content.InnerHtml = db.InfoText(this.CafeId); break; case 1: this.content.Visible = true; this.ifr.Attributes["Src"] = ""; this.content.InnerHtml = db.GoodsInfo(this.CafeId); break; case 2: this.content.Visible = true; this.ifr.Attributes["Src"] = ""; this.content.InnerHtml = db.AdminInfo(this.CafeId); break; case 3: this.content.Visible = true; this.ifr.Attributes["Src"] = ""; this.content.InnerHtml = db.Keyword(this.CafeId); break; case 4: this.content.Visible = false; this.ifr.Attributes["Src"] = "Join.aspx?Id=" + this.CafeId + "&CafeType=" + this.CafeType; break; case 5: this.content.Visible = false; this.ifr.Attributes["Src"] = "Album.aspx?Id=" + this.CafeId + "&CafeType=" + this.CafeType; break; case 6: this.content.Visible = false; this.ifr.Attributes["Src"] = "Board.aspx?Id=" + this.CafeId + "&CafeType=" + this.CafeType; break; } } else { switch (e.CurrnetPosition) { case 0: this.content.Visible = true; this.ifr.Attributes["Src"] = ""; this.content.InnerHtml = db.InfoText(this.CafeId); break; case 1: if (this.CafeType == 0 || this.CafeType == 2) { this.content.Visible = false; this.ifr.Attributes["Src"] = "MustBook.aspx?Id=" + this.CafeId + "&CafeType=" + this.CafeType; } else if (this.CafeType == 1 || this.CafeType == 3 || this.CafeType == 4) { this.content.Visible = true; this.ifr.Attributes["Src"] = ""; this.content.InnerHtml = db.Keyword(this.CafeId); } else { this.content.Visible = false; this.ifr.Attributes["Src"] = ""; } break; case 2: this.content.Visible = false; this.ifr.Attributes["Src"] = "Join.aspx?Id=" + this.CafeId + "&CafeType=" + this.CafeType; break; case 3: this.content.Visible = false; this.ifr.Attributes["Src"] = "Album.aspx?Id=" + this.CafeId + "&CafeType=" + this.CafeType; break; case 4: this.content.Visible = false; this.ifr.Attributes["Src"] = "Board.aspx?Id=" + this.CafeId + "&CafeType=" + this.CafeType; break; } } } |
※ 구현환경
.NET Framework 1.1
Microsoft Visual Studio.NET 2003
Microsoft Windows XP SP2
파일 받기