Click here to Skip to main content
15,879,613 members
Home / Discussions / C#
   

C#

 
QuestionDo special processing for a type in a generic class Pin
Dan Neely14-Jul-09 8:15
Dan Neely14-Jul-09 8:15 
QuestionHow can i save an Image in a database in a C# application Pin
CoderForEver14-Jul-09 8:15
CoderForEver14-Jul-09 8:15 
AnswerRe: How can i save an Image in a database in a C# application Pin
Henry Minute14-Jul-09 8:38
Henry Minute14-Jul-09 8:38 
QuestionReading multiple items from a single line of data Pin
ReynaW122314-Jul-09 8:12
ReynaW122314-Jul-09 8:12 
AnswerRe: Reading multiple items from a single line of data Pin
Henry Minute14-Jul-09 8:51
Henry Minute14-Jul-09 8:51 
GeneralRe: Reading multiple items from a single line of data Pin
ReynaW122314-Jul-09 9:41
ReynaW122314-Jul-09 9:41 
QuestionHelp - FormClosing event and FormClosed event fires to often Pin
fracalifa14-Jul-09 7:58
fracalifa14-Jul-09 7:58 
QuestionMouseUp Event Not Firing After DoDragDrop Pin
Kevin Marois14-Jul-09 7:19
professionalKevin Marois14-Jul-09 7:19 
After I call DoDragDrop, the MouseUp event does not fire. I spent some time Googling this and I see that other people have noticed this behavior.

Here's my code. Anyone know what to do about this?

Thanks


public delegate void SpliiterMovedEventHandler(object sender, SplitterMovedEventArgs e);

public partial class _Splitter : UserControl
{
    private bool _bDragging = false;
    private int _OldPosition = 0;

    public _Splitter()
    {
        InitializeComponent();
        _OldPosition = this.Top;
    }


    public event SpliiterMovedEventHandler SplitterMoved;
    protected void OnSpliiterMoved()
    {
        if (SplitterMoved != null)
        {
            SplitterMovedEventArgs args = new SplitterMovedEventArgs(_OldPosition, this.Top);
            SplitterMoved(this, args);
        }
    }


    private void _Splitter_MouseDown(object sender, MouseEventArgs e)
    {
        // If the user has the left button down...
        if (e.Button == MouseButtons.Left)
        {
            // Turn on the dragging flag
            _bDragging = true;

            // Store the old position
            _OldPosition = this.Top;

            // Change the cursor
            this.Cursor = Cursors.SizeNS;
            
            // Start the drag operation
            this.DoDragDrop(sender, DragDropEffects.Copy);
        }
    }
    private void _Splitter_MouseMove(object sender, MouseEventArgs e)
    {
        // If dragging...
        if (_bDragging)
        {
            // Set the cursor to display while moving
            this.Cursor = Cursors.SizeNS;

            // Keep the splitter aligned to the left
            this.Left = 0;
        }
    }
    private void _Splitter_MouseUp(object sender, MouseEventArgs e)
    {
        if (_bDragging)
        {
            // Turn off the dragging flag
            _bDragging = false;

            // Reset the cursor
            this.Cursor = Cursors.Default;

            // Raise the event
            OnSpliiterMoved();

            // Store the new position
            _OldPosition = this.Top;
        }
    }
    private void _Splitter_MouseLeave(object sender, EventArgs e)
    {
        // Reset the cursor
        this.Cursor = Cursors.Default;
    }
    private void _Splitter_GiveFeedback(object sender, GiveFeedbackEventArgs e)
    {
        // Tell the control not to use the default move curosr
        e.UseDefaultCursors = false;

        // Set the cursor
        this.Cursor = Cursors.SizeNS;
    }
    private void _Splitter_MouseEnter(object sender, EventArgs e)
    {
        // Set the cursor
        this.Cursor = Cursors.SizeNS;
    }
}


Everything makes sense in someone's mind

AnswerRe: MouseUp Event Not Firing After DoDragDrop Pin
Henry Minute14-Jul-09 7:48
Henry Minute14-Jul-09 7:48 
AnswerRe: MouseUp Event Not Firing After DoDragDrop Pin
Kevin Marois14-Jul-09 7:54
professionalKevin Marois14-Jul-09 7:54 
GeneralRe: MouseUp Event Not Firing After DoDragDrop Pin
Henry Minute14-Jul-09 9:03
Henry Minute14-Jul-09 9:03 
GeneralRe: MouseUp Event Not Firing After DoDragDrop Pin
Kevin Marois14-Jul-09 9:10
professionalKevin Marois14-Jul-09 9:10 
GeneralRe: MouseUp Event Not Firing After DoDragDrop Pin
Henry Minute14-Jul-09 10:10
Henry Minute14-Jul-09 10:10 
GeneralRe: MouseUp Event Not Firing After DoDragDrop [modified] Pin
Kevin Marois14-Jul-09 10:46
professionalKevin Marois14-Jul-09 10:46 
GeneralRe: MouseUp Event Not Firing After DoDragDrop Pin
Henry Minute14-Jul-09 12:06
Henry Minute14-Jul-09 12:06 
GeneralRe: MouseUp Event Not Firing After DoDragDrop Pin
Kevin Marois14-Jul-09 12:38
professionalKevin Marois14-Jul-09 12:38 
QuestionSetting an origin for BinaryReader Pin
SimpleData14-Jul-09 7:16
SimpleData14-Jul-09 7:16 
QuestionC# struct and NuSOAP(php) Pin
OptiPlex14-Jul-09 6:58
OptiPlex14-Jul-09 6:58 
AnswerRe: C# struct and NuSOAP(php) Pin
dataminers14-Jul-09 9:23
dataminers14-Jul-09 9:23 
GeneralRe: C# struct and NuSOAP(php) Pin
OptiPlex14-Jul-09 9:26
OptiPlex14-Jul-09 9:26 
GeneralRe: C# struct and NuSOAP(php) Pin
dataminers14-Jul-09 9:30
dataminers14-Jul-09 9:30 
GeneralRe: C# struct and NuSOAP(php) Pin
Almighty Bob21-Jul-09 2:11
Almighty Bob21-Jul-09 2:11 
AnswerRe: C# struct and NuSOAP(php) Pin
Almighty Bob21-Jul-09 2:06
Almighty Bob21-Jul-09 2:06 
QuestionImage (Bitmap) Brightness/Contrast Pin
lexx_zone14-Jul-09 6:55
lexx_zone14-Jul-09 6:55 
AnswerRe: Image (Bitmap) Brightness/Contrast Pin
vineas14-Jul-09 7:06
vineas14-Jul-09 7:06 

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.