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

C#

 
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 
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 
Use the Capture property of the control. That makes the control capture all mouse movement, even if you manage move the mouse fast enough to slip outside of the control:

private Point start;

private void movable_MouseDown(object sender, MouseEventArgs e) {
	Control c = (Control)sender;
	start = c.PointToScreen(e.Location);
	c.Capture = true;
}

private void movable_MouseUp(object sender, MouseEventArgs e) {
	Control c = (Control)sender;
	c.Capture = false;
}

private void movable_MouseMove(object sender, MouseEventArgs e) {
	Control c = (Control)sender;
	if (c.Capture) {
		Point mouse = c.PointToScreen(e.Location);
		c.Left += mouse.X - start.X;
		c.Top += mouse.Y - start.Y;
		start = mouse;
	}
}


Note: As this code uses the sender argument to reference the control, the code can be reused for the events of several controls that you want to be able to move.

sinosoidal wrote:
Other thing i dont understand is how does suspend/resume layout works as they weren't doing a thing.


It's used for more complex controls, for example when you want to add a lot of items to a list without having the list redraw itself for every item.


---
single minded; short sighted; long gone;

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 
QuestionCollection serialization problem... Pin
Shy Agam13-Jun-07 2:31
Shy Agam13-Jun-07 2:31 
AnswerRe: Collection serialization problem... Pin
Dave Herren13-Jun-07 2:37
Dave Herren13-Jun-07 2:37 

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.