Click here to Skip to main content
16,004,828 members
Home / Discussions / C#
   

C#

 
AnswerRe: Combination console/form app Pin
eosisms14-Jun-07 8:56
eosisms14-Jun-07 8:56 
Questionhow can ... Pin
B.A13-Jun-07 6:51
B.A13-Jun-07 6:51 
AnswerRe: how can ... Pin
Ed.Poore13-Jun-07 7:54
Ed.Poore13-Jun-07 7:54 
Questioncontroling status of a call made by a hanset using tapi 3 Pin
georgishelpmegodtoo13-Jun-07 6:10
georgishelpmegodtoo13-Jun-07 6:10 
QuestionNeed a DataGridView With Footer. Pin
hdv21213-Jun-07 5:39
hdv21213-Jun-07 5:39 
AnswerRe: Need a DataGridView With Footer. Pin
Not Active13-Jun-07 6:08
mentorNot Active13-Jun-07 6:08 
QuestionMoving a control in runtime with c#, without using c++ api Pin
sinosoidal13-Jun-07 4:15
sinosoidal13-Jun-07 4:15 
AnswerRe: Moving a control in runtime with c#, without using c++ api [modified] Pin
Martin#13-Jun-07 4:30
Martin#13-Jun-07 4:30 
Hello,

At the MouseDown you have to store the starting point:
_startDragPoint = new Point(e.X, e.Y);

At the MouseMove I suggest you to use a timer which only changes the Location every 100ms.
And add this logic:
if(TimerMovePad == null)
{
    this.TimerMovePad = new System.Timers.Timer();
    this.TimerMovePad.Interval = 100;
    this.TimerMovePad.Elapsed +=new System.Timers.ElapsedEventHandler(TimerMovePad_Elapsed);
}

if (TimerMovePad.Enabled == false)
{
    TimerMovePad.Enabled = true;
}

if(_movementok == true)
{
    _movementok = false;

    int delta_x = e.X - _startDragPoint.X;
    int delta_y = e.Y - _startDragPoint.Y;

    region.Location = new Point((region.Location.X + delta_x), (region.Location.Y + delta_y));
}

At the timer Elapsed, you then set the flag.
private void TimerMovePad_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
{
    TimerMovePad.Enabled = false;
    _movementok = true;
}


Hope it helps!

All the best,

Martin
GeneralRe: Moving a control in runtime with c#, without using c++ api Pin
sinosoidal13-Jun-07 4:51
sinosoidal13-Jun-07 4:51 
AnswerRe: Moving a control in runtime with c#, without using c++ api Pin
Guffa13-Jun-07 7:21
Guffa13-Jun-07 7:21 
QuestionMODI - Microsoft office document imaging 11.0? Pin
$uresh $hanmugam13-Jun-07 3:59
$uresh $hanmugam13-Jun-07 3:59 
Question.net 2.0 - loop through the second collection Pin
arkiboys13-Jun-07 3:28
arkiboys13-Jun-07 3:28 
AnswerRe: .net 2.0 - loop through the second collection Pin
Russell Jones13-Jun-07 3:33
Russell Jones13-Jun-07 3:33 
GeneralRe: .net 2.0 - loop through the second collection Pin
arkiboys13-Jun-07 3:36
arkiboys13-Jun-07 3:36 
Questionproblem in writing a file Pin
saqib8213-Jun-07 3:20
saqib8213-Jun-07 3:20 
AnswerRe: problem in writing a file Pin
Pete O'Hanlon13-Jun-07 4:00
mvePete O'Hanlon13-Jun-07 4:00 
AnswerRe: problem in writing a file Pin
lmoelleb13-Jun-07 4:15
lmoelleb13-Jun-07 4:15 
QuestionScrolling FlowLayoutPanel Pin
zaboboa13-Jun-07 3:08
zaboboa13-Jun-07 3:08 
Questionprint document with it's format Pin
merwa13-Jun-07 2:45
merwa13-Jun-07 2:45 
AnswerRe: print document with it's format Pin
Ed.Poore13-Jun-07 7:55
Ed.Poore13-Jun-07 7:55 
QuestionCrystal Reports Database login prompt [modified] Pin
Seishin#13-Jun-07 2:44
Seishin#13-Jun-07 2:44 
QuestionDisable Delete Key in Keyboard. Pin
Rahul8313-Jun-07 2:37
Rahul8313-Jun-07 2:37 
AnswerRe: Disable Delete Key in Keyboard. Pin
Pete O'Hanlon13-Jun-07 2:42
mvePete O'Hanlon13-Jun-07 2:42 
AnswerRe: Disable Delete Key in Keyboard. Pin
Hesham Yassin14-Jun-07 8:39
Hesham Yassin14-Jun-07 8:39 
QuestionDisable Keyboard Delete button Pin
Rahul8313-Jun-07 2:35
Rahul8313-Jun-07 2:35 

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.