Autor Beitrag
SSC streezer
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 110

WinXP, Vista Ultimate
C# (VS 05 n' 08), PHP
BeitragVerfasst: Mo 06.10.08 09:27 
Hallo zusammen,

ich hab mich gefragt ob es möglich ist Bilder vor den Drop Down items anzeigen zu lassen.

in HTML geht das schön - hier ein beispiel: aktuell.de.selfhtml....nbilder/beispiel.htm

klar - mir ist bewusst dass es nichts zusammenhängendes hat - aber ist eins chönes beispiel so wie ichs gerne machen möchte...

nun, ist so etwas möglich mit C# ?


gruss,
mike

_________________
>> Swiss Soldiers Clan << visit us
SSC streezer Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 110

WinXP, Vista Ultimate
C# (VS 05 n' 08), PHP
BeitragVerfasst: Mo 06.10.08 10:04 
also ich hab hier was gefunden - aber der code funktioniert irgendwie nicht...

kann das jemand wiederlegen? oder gibt es eine andere lösung für mein problem?

www.csharphelp.com/a...ives/archive280.html

_________________
>> Swiss Soldiers Clan << visit us
lothi
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 114
Erhaltene Danke: 3



BeitragVerfasst: Mo 06.10.08 12:42 
Hallo

Ich glaube nicht das es eine andere Lösung als in:

ausblenden Quelltext
1:
2:
protected override void OnDrawItem(DrawItemEventArgs ea)
    {

das Bild in die Combobox zu bringen. Ausser du nimmst etwas fertiges.

Die andere Frage ist, was geht denn nicht?

Gruss Lothi
SSC streezer Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 110

WinXP, Vista Ultimate
C# (VS 05 n' 08), PHP
BeitragVerfasst: Mo 06.10.08 12:50 
die einträge für das dropdown control hab ich mittels GUI gemacht (rechtsklick -> edit items).

und irgendwie wird das was geschrieben von comboBox.Items.Add(new ComboBoxExItem("Text0"0));

aber das klappt nicht - oder ist das gar nicht dafür da ein item in das dropdown einzufügen mit dem bildindex 0 ?

komplieren tut es jedenfalls alles..

_________________
>> Swiss Soldiers Clan << visit us
SSC streezer Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 110

WinXP, Vista Ultimate
C# (VS 05 n' 08), PHP
BeitragVerfasst: Mo 06.10.08 13:31 
ok habs hingekriegt...

folgende sachen müssen in den konstruktor:

ausblenden C#-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
cmb_sprache.ImageList = imageList;
                cmb_sprache.Items.Clear();
                cmb_sprache.Items.Add(new ComboBoxExItem("Deutsch"7));
                cmb_sprache.Items.Add(new ComboBoxExItem("Englisch"8));
                cmb_sprache.Items.Add(new ComboBoxExItem("Französisch"9));
                cmb_sprache.Items.Add(new ComboBoxExItem("Italienisch"10));

                cmb_sprache.DropDownStyle = ComboBoxStyle.DropDownList;


dann funzt es - einfach die klasse noch erstellen mit dem code der auf dem obigen link steht...

_________________
>> Swiss Soldiers Clan << visit us