Click here to Skip to main content
15,913,685 members
Home / Discussions / C#
   

C#

 
AnswerRe: Virus Pin
Hamid_RT4-Jan-07 18:44
Hamid_RT4-Jan-07 18:44 
AnswerRe: Virus Pin
Tyler454-Jan-07 20:34
Tyler454-Jan-07 20:34 
GeneralRe: Virus Pin
Pete O'Hanlon4-Jan-07 22:26
mvePete O'Hanlon4-Jan-07 22:26 
AnswerRe: Virus Pin
Mircea Puiu4-Jan-07 20:49
Mircea Puiu4-Jan-07 20:49 
AnswerRe: Virus Pin
lost in transition 5-Jan-07 4:06
lost in transition 5-Jan-07 4:06 
Questionend of line character Y position Pin
netJP12L4-Jan-07 11:15
netJP12L4-Jan-07 11:15 
AnswerRe: end of line character Y position Pin
Christian Graus4-Jan-07 11:30
protectorChristian Graus4-Jan-07 11:30 
QuestionEmbedded Progressbar Problem Pin
slugonamission4-Jan-07 10:28
slugonamission4-Jan-07 10:28 
I've tried for a while to get a progressbar embedded within a listview, but just have one problem. If you resize the column that the progressbar is in so that it can fill the whole row, then the progressbar doesn't resize correctly when the scrollbar is moved. See the picture below. This only happens for columnindex > 0

This is the code I am using

protected override void OnDrawSubItem(DrawListViewSubItemEventArgs e)
        {
            if (e.Item.GetType() == typeof(MyListViewItem))
            {
                MyListViewItem item = (MyListViewItem)e.Item;

                if (item.Bars.ContainsKey(e.ColumnIndex))
                {
                    e.DrawDefault = false;
                    //Find where the bar should be drawn by adding up the widths of the columns below this one

                    if (e.ColumnIndex > 0)
                    {
                        int runningTotal = 0;
                        for (int i = e.ColumnIndex - 1; i >= 0; i--)
                        {
                            System.Diagnostics.Debug.WriteLine(e.ColumnIndex);
                            runningTotal += this.Columns[i].Width;
                        }

                        //Add on the left client bound
                        runningTotal += e.Item.Bounds.Left;
                        item.Bars[e.ColumnIndex].Location = new System.Drawing.Point(runningTotal, e.Bounds.Location.Y);
                        item.Bars[e.ColumnIndex].Width = this.Columns[e.ColumnIndex].Width;
                        item.Bars[e.ColumnIndex].Height = e.Bounds.Size.Height;
                    }
                    else
                    {
                        int clientBound = e.Item.Bounds.Left;

                        item.Bars[e.ColumnIndex].Location = new System.Drawing.Point(clientBound, e.Bounds.Location.Y);
                        item.Bars[e.ColumnIndex].Width = this.Columns[e.ColumnIndex].Width;
                        item.Bars[e.ColumnIndex].Height = e.Bounds.Size.Height;
                    }
                }
                else
                    e.DrawDefault = true;
            }
            else
                e.DrawDefault = true;
            
            base.OnDrawSubItem(e);
        }


I have also overridden "OnColumnWidthChanging" to resize the bars when the column width changes, and also overridden WndProc to try and catch the scrollbars being moved, although that didn't work, so I'm assuming the problem lies in the code section for if(e.ColumnIndex > 0)

Thanks in advance ~ Jamie

P.S. - the image. The scrollbar should be in the "newcol" column.
http://img.photobucket.com/albums/v635/slugonamission/Problem.jpg
AnswerRe: Embedded Progressbar Problem Pin
Judah Gabriel Himango4-Jan-07 11:32
sponsorJudah Gabriel Himango4-Jan-07 11:32 
QuestionASCII Code Pin
CodeItWell4-Jan-07 10:10
CodeItWell4-Jan-07 10:10 
AnswerRe: ASCII Code [modified] Pin
Nader Elshehabi4-Jan-07 10:33
Nader Elshehabi4-Jan-07 10:33 
AnswerRe: ASCII Code Pin
slugonamission4-Jan-07 10:38
slugonamission4-Jan-07 10:38 
GeneralRe: ASCII Code Pin
CodeItWell4-Jan-07 11:04
CodeItWell4-Jan-07 11:04 
GeneralRe: ASCII Code Pin
Christian Graus4-Jan-07 14:27
protectorChristian Graus4-Jan-07 14:27 
Questionhow to sent the cursor from one textbox to another textbox by pressing enter key(in vb we may use keypress event) Pin
zelane4-Jan-07 8:15
zelane4-Jan-07 8:15 
AnswerRe: how to sent the cursor from one textbox to another textbox by pressing enter key(in vb we may use keypress event) Pin
Nader Elshehabi4-Jan-07 8:20
Nader Elshehabi4-Jan-07 8:20 
GeneralRe: how to sent the cursor from one textbox to another textbox by pressing enter key(in vb we may use keypress event) Pin
zelane4-Jan-07 8:40
zelane4-Jan-07 8:40 
GeneralRe: how to sent the cursor from one textbox to another textbox by pressing enter key(in vb we may use keypress event) Pin
Nader Elshehabi4-Jan-07 8:44
Nader Elshehabi4-Jan-07 8:44 
GeneralRe: how to sent the cursor from one textbox to another textbox by pressing enter key(in vb we may use keypress event) Pin
gnadeem4-Jan-07 8:52
gnadeem4-Jan-07 8:52 
Questionproblem with progressbar Pin
suck1234-Jan-07 8:07
suck1234-Jan-07 8:07 
AnswerRe: problem with progressbar Pin
Nader Elshehabi4-Jan-07 8:18
Nader Elshehabi4-Jan-07 8:18 
QuestionADO.NET help, editing data in a database Pin
Blekk4-Jan-07 7:59
Blekk4-Jan-07 7:59 
AnswerRe: ADO.NET help, editing data in a database Pin
Nader Elshehabi4-Jan-07 8:25
Nader Elshehabi4-Jan-07 8:25 
AnswerRe: ADO.NET help, editing data in a database Pin
led mike4-Jan-07 8:26
led mike4-Jan-07 8:26 
QuestionMagnify function Pin
Gywox4-Jan-07 7:26
Gywox4-Jan-07 7:26 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.