Click here to Skip to main content
15,887,746 members
Home / Discussions / C#
   

C#

 
AnswerRe: Character encoding when reading a text file of unknown encoding, to create an XML file Pin
Luc Pattyn24-Aug-10 9:52
sitebuilderLuc Pattyn24-Aug-10 9:52 
GeneralRe: Character encoding when reading a text file of unknown encoding, to create an XML file Pin
JohnLBevan24-Aug-10 22:33
professionalJohnLBevan24-Aug-10 22:33 
QuestionStrange order of events in ListView with MultiSelect set to false Pin
crypto_rsa24-Aug-10 6:28
crypto_rsa24-Aug-10 6:28 
AnswerRe: Strange order of events in ListView with MultiSelect set to false Pin
Ravi Bhavnani24-Aug-10 8:17
professionalRavi Bhavnani24-Aug-10 8:17 
AnswerRe: Strange order of events in ListView with MultiSelect set to false Pin
DaveyM6924-Aug-10 10:16
professionalDaveyM6924-Aug-10 10:16 
GeneralRe: Strange order of events in ListView with MultiSelect set to false Pin
crypto_rsa24-Aug-10 21:37
crypto_rsa24-Aug-10 21:37 
GeneralRe: Strange order of events in ListView with MultiSelect set to false Pin
johannesnestler24-Aug-10 23:05
johannesnestler24-Aug-10 23:05 
AnswerRe: Strange order of events in ListView with MultiSelect set to false Pin
DaveyM6924-Aug-10 10:41
professionalDaveyM6924-Aug-10 10:41 
This is a semi-solution.

Subclassing the ListView and overriding WndProc, listen for the left mouse button up message and raise the MouseUp event passing the correct parameters.

With a bit more work you may be able to use a flag to allow/disallow MouseUp messages to supress the erroneous one that you are getting.

C#
public class FixedListView : ListView
{
    private const int WM_LBUTTONUP = 0x0202;

    protected override void WndProc(ref Message m)
    {
        if (m.Msg == WM_LBUTTONUP)
        {
            // adjusting as X and Y are 16 bits each of LParam
            Point point = new Point(((int)m.LParam) & 0x0000FFFF, (int)m.LParam >> 16);
            OnMouseUp(new MouseEventArgs(MouseButtons.Left, 1, point.X, point.Y, 0));
            return;
        }
        base.WndProc(ref m);
    }
}


WM_LBUTTONUP Message[^]
Dave

If this helped, please vote & accept answer!


Binging is like googling, it just feels dirtier.
Please take your VB.NET out of our nice case sensitive forum.(Pete O'Hanlon)

BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)

GeneralRe: Strange order of events in ListView with MultiSelect set to false Pin
crypto_rsa25-Aug-10 1:12
crypto_rsa25-Aug-10 1:12 
QuestionEditable datagridview Pin
saqib8224-Aug-10 5:37
saqib8224-Aug-10 5:37 
AnswerRe: Editable datagridview Pin
dan!sh 24-Aug-10 6:00
professional dan!sh 24-Aug-10 6:00 
GeneralRe: Editable datagridview Pin
saqib8224-Aug-10 6:07
saqib8224-Aug-10 6:07 
GeneralRe: Editable datagridview Pin
dan!sh 24-Aug-10 6:24
professional dan!sh 24-Aug-10 6:24 
GeneralRe: Editable datagridview Pin
saqib8224-Aug-10 6:39
saqib8224-Aug-10 6:39 
AnswerRe: Editable datagridview Pin
Mada Naga Sankar25-Aug-10 19:38
Mada Naga Sankar25-Aug-10 19:38 
Questionproblem with invoke method. it says cannot call invoke on a control until the window handle has been created Pin
prasadbuddhika24-Aug-10 4:59
prasadbuddhika24-Aug-10 4:59 
AnswerRe: problem with invoke method. it says cannot call invoke on a control until the window handle has been created Pin
Luc Pattyn24-Aug-10 5:32
sitebuilderLuc Pattyn24-Aug-10 5:32 
AnswerRe: problem with invoke method. it says cannot call invoke on a control until the window handle has been created Pin
Chris Trelawny-Ross24-Aug-10 5:34
Chris Trelawny-Ross24-Aug-10 5:34 
AnswerRe: problem with invoke method. it says cannot call invoke on a control until the window handle has been created [modified] Pin
DaveyM6924-Aug-10 9:14
professionalDaveyM6924-Aug-10 9:14 
QuestionCollection of stuct object - does the GC will run ? Pin
Yanshof24-Aug-10 2:20
Yanshof24-Aug-10 2:20 
AnswerRe: Collection of stuct object - does the GC will run ? Pin
Ian Shlasko24-Aug-10 2:43
Ian Shlasko24-Aug-10 2:43 
GeneralRe: Collection of stuct object - does the GC will run ? Pin
Łukasz Nowakowski24-Aug-10 2:57
Łukasz Nowakowski24-Aug-10 2:57 
GeneralRe: Collection of stuct object - does the GC will run ? Pin
Paul Michalik24-Aug-10 23:01
Paul Michalik24-Aug-10 23:01 
AnswerRe: Collection of stuct object - does the GC will run ? Pin
Luc Pattyn24-Aug-10 2:56
sitebuilderLuc Pattyn24-Aug-10 2:56 
AnswerRe: Collection of stuct object - does the GC will run ? Pin
johannesnestler24-Aug-10 4:29
johannesnestler24-Aug-10 4:29 

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.