Register for your free account! | Forgot your password?

Go Back   elitepvpers > Coders Den > .NET Languages
You last visited: Today at 22:13

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



[C#] DrawItem Problem

Discussion on [C#] DrawItem Problem within the .NET Languages forum part of the Coders Den category.

Closed Thread
 
Old   #1
 
_Roman_'s Avatar
 
elite*gold: 0
Join Date: May 2010
Posts: 1,620
Received Thanks: 237
[C#] DrawItem Problem

Hi,

ich habe folgendes Problem. Wenn ich bei meiner ListBox einen normalen Mausklick mache, kommt eine ArgumentOutOfRangeException. In den Details steht dann irgendwas mit DrawItem Ereignis. Das Komische dabei ist, dass es nicht passiert, wenn ich das Programm über die IDE öffne. Ich habe es mit AdvancedInstaller in einen Installer gepackt und installiert. Und nur bei der installierten Form tritt der Fehler auf.
Hier der dazugehörige DrawItem Code

Code:
        public void epDraw(DrawItemEventArgs ev, ListBox objectives, int current)
        {
            //set red or green text color, depends on objective status
            ev.DrawBackground();
            int i = ev.Index;

            Font myfont = ev.Font;
            Brush mybrush;
            mybrush = Brushes.Red;

            switch (Projectmethods.Access.Marks[current][i])
            {
                case true:
                    mybrush = Brushes.Green;
                    myfont = new Font("Comic Sans MS", 12.25f, FontStyle.Strikeout);
                    break;

                case false:
                    mybrush = Brushes.Red;
                    myfont = new Font("Comic Sans MS", 12.25f);
                    break;
            }

            ev.Graphics.DrawString(objectives.Items[i].ToString(), myfont, mybrush, ev.Bounds);
            objectives.Update();
        }
_Roman_ is offline  
Closed Thread


Similar Threads Similar Threads
[Problem]Habe ein Problem und zwar spinnt mein VPC etwas(ohne Grund)?!
07/28/2011 - Metin2 Private Server - 10 Replies
Also wie schon gesagt meins Server spinnt wodurch kiks usw. kommen :( ich lade euch die Screens in den Anhang, mit der Hoffnung, dass ihr mir helfen könnt :) wäre echt sehr nice :)



All times are GMT +1. The time now is 22:13.


Powered by vBulletin®
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2025 elitepvpers All Rights Reserved.