Das geht aber doch mit einem "bool expanded" nicht... oder willst du das so machen, dass, soblad "ImageUrl" gesetzt ist, hat das vorang?
-----Urspr�ngliche Nachricht----- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Im Auftrag von [EMAIL PROTECTED] Gesendet: Donnerstag, 6. Januar 2005 12:45 An: [email protected] Betreff: RE: AW: [Asp.net] Einfaches Custom Control Problem? Ich hab mich vermutlich unklar ausgedr�ckt. Aber jetzt hast du in deinem Beispiel einfach das eine Bild entfernt. Letztendlich soll es im Custom Control ein Bild, welches abh�ngig vom Attribut Expanded ist und ein Bild, welches irgend ein anderes Bild anzeigt, haben: ---------------------------------------------- Bild Expanded od Collapsed � Irgendeinbild � ---------------------------------------------- >-- Original-Nachricht -- >From: "Andreas Rudischhauser" <[EMAIL PROTECTED]> >To: <[email protected]> >Subject: AW: [Asp.net] Einfaches Custom Control Problem? >Reply-To: [email protected] >Date: Thu, 6 Jan 2005 12:26:21 +0100 > > >Es geht sogar noch cooler wenn du von Image ableitest: > > using System; > using System.Web.UI; > using System.Web.UI.WebControls; > using System.ComponentModel; > > namespace test > { > /// <summary> > /// Summary description for WebCustomControl1. > /// </summary> > [DefaultProperty("Text"), > ToolboxData("<{0}:MyButton runat=server></{0}:MyButton>")] > public class MyButton : Image > { > > //Hier sperre ich das Setzten der ImageUrl > public override string ImageUrl > { > get > { > return base.ImageUrl; > } > } > > > > [Bindable(true), > Category("Appearance"), > DefaultValue(true)] > public bool Expanded > { > get > { > return this.expanded; > } > > set > { > this.expanded = value; > } > } > private bool expanded = true; > > [Bindable(true), > Category("Appearance"), > DefaultValue("")] > public string ImageUrlExpanded > { > get > { > return this.imageUrlExpanded; > } > set > { > this.imageUrlExpanded = value; > } > } > private string imageUrlExpanded = ""; > > [Bindable(true), > Category("Appearance"), > DefaultValue("")] > public string ImageUrlCollapsed > { > get > { > return this.imageUrlCollapsed; > } > > set > { > this.imageUrlCollapsed = value; > } > } > private string imageUrlCollapsed = ""; > > protected override void OnLoad(EventArgs e) > { > base.OnLoad (e); > base.ImageUrl = (this.expanded) ? >this.imageUrlExpanded : this.imageUrlCollapsed; > } > } > } > > >_______________________________________________ >Asp.net Mailingliste, Postings senden an: >[email protected] >An-/Abmeldung und Suchfunktion unter: >http://www.glengamoi.com/mailman/listinfo/asp.net _______________________________________________ Asp.net Mailingliste, Postings senden an: [email protected] An-/Abmeldung und Suchfunktion unter: http://www.glengamoi.com/mailman/listinfo/asp.net _______________________________________________ Asp.net Mailingliste, Postings senden an: [email protected] An-/Abmeldung und Suchfunktion unter: http://www.glengamoi.com/mailman/listinfo/asp.net
