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

C#

 
GeneralRe: How do i create a public variable? Pin
Dave Kreskowiak7-Apr-07 5:51
mveDave Kreskowiak7-Apr-07 5:51 
QuestionComments Workbench Pin
imran_5176-Apr-07 8:06
imran_5176-Apr-07 8:06 
AnswerRe: Comments Workbench Pin
Sathesh Sakthivel6-Apr-07 8:26
Sathesh Sakthivel6-Apr-07 8:26 
AnswerRe: Comments Workbench Pin
BoneSoft6-Apr-07 9:41
BoneSoft6-Apr-07 9:41 
AnswerRe: Comments Workbench Pin
BoneSoft6-Apr-07 9:45
BoneSoft6-Apr-07 9:45 
GeneralRe: Comments Workbench Pin
imran_5179-Apr-07 3:35
imran_5179-Apr-07 3:35 
GeneralRe: Comments Workbench Pin
BoneSoft9-Apr-07 5:37
BoneSoft9-Apr-07 5:37 
QuestionDragging a control issue... Pin
new_phoenix6-Apr-07 7:25
new_phoenix6-Apr-07 7:25 
Here is my situation. I have several controls on a form that I would like the end user to be able to drag around the form. However, the DragOver Event in the DragDrop Event handler does not appear to resample the points on the screen adequately while the control is being dragged around the form. As a result, the dragging needs to occur until the cursor reaches the edge of the control and the cursor has just touched the form before it is again dragged. This creates a jerky type of movement where the control is readjusted only when the cursor touches the form.

Please, somebody kindly provide some hints as to how I could get the dragPosition coordinates to be resampled so that the cursor does not need to touch the form before it is again moved on the form.

The code for the DragOver Event handler is as follows:

private static void _ctrlParent_DragOver(object sender, DragEventArgs e)
{
	if (DragDropHandler.CanDropHere((Control)sender, e.Data))
	{
		Control cthis = (Control)sender;
		e.Effect = DragDropEffects.Move;
		Control ctrl = DragDropHandler.GetControl(e.Data, true, true);

		try
		{
			if (!(ctrl is IDragDropEnabled))
			{
				return;
			}
			if (cthis.Name != ctrl.Name)  // attempt to prevent a circular control reference in which a control may potentially refer to itself as a parent.
			{
				ctrl.Parent.Controls.Remove(ctrl);
				ctrl.Parent = cthis;
				cthis.Controls.Add(ctrl);
				ctrl.BringToFront();

				// this is the place where the dragPoint needs to be resampled more often because the cursor needs to touch the form before dragging occurs.	
				Point NewLocation = cthis.PointToClient(new Point(e.X, e.Y));
				ctrl.Left = NewLocation.X - dragPoint.X;
				ctrl.Top = NewLocation.Y - dragPoint.Y;
			}

					
		}
		catch (System.Exception ex)
		{
			MessageBox.Show("Here is the DragOver Error: " + ex.Message + " The ctrl.Name is " + ctrl.Name + " and cthis is " + cthis.Name);
		}
	}
	else
	{
		e.Effect = DragDropEffects.None;
	}
}

QuestionPogo Auto player Pin
aerosmith2k16-Apr-07 7:21
aerosmith2k16-Apr-07 7:21 
QuestionConnect to oracle using ODBC Oracle Pin
SABhatti6-Apr-07 5:43
SABhatti6-Apr-07 5:43 
AnswerRe: Connect to oracle using ODBC Oracle Pin
Paul Groetzner8-May-07 6:21
Paul Groetzner8-May-07 6:21 
GeneralRe: Connect to oracle using ODBC Oracle Pin
SABhatti8-May-07 11:24
SABhatti8-May-07 11:24 
Questionhow can i crack MICROSOFT windows ? [modified] Pin
pouyan_piano6-Apr-07 5:03
pouyan_piano6-Apr-07 5:03 
JokeRe: how can i crack windows ? Pin
Sathesh Sakthivel6-Apr-07 5:09
Sathesh Sakthivel6-Apr-07 5:09 
AnswerRe: how can i crack windows ? Pin
Not Active6-Apr-07 5:12
mentorNot Active6-Apr-07 5:12 
AnswerRe: how can i crack windows ? Pin
Dan Neely6-Apr-07 5:21
Dan Neely6-Apr-07 5:21 
AnswerRe: how can i crack windows ? Pin
led mike6-Apr-07 5:55
led mike6-Apr-07 5:55 
GeneralRe: how can i crack windows ? Pin
Mark Salsbery6-Apr-07 8:26
Mark Salsbery6-Apr-07 8:26 
AnswerRe: how can i crack windows ? Pin
SABhatti6-Apr-07 6:31
SABhatti6-Apr-07 6:31 
AnswerRe: how can i crack windows ? Pin
Dave Kreskowiak6-Apr-07 8:18
mveDave Kreskowiak6-Apr-07 8:18 
AnswerRe: how can i crack windows ? Pin
Shog96-Apr-07 8:49
sitebuilderShog96-Apr-07 8:49 
GeneralRe: how can i crack windows ? Pin
netJP12L6-Apr-07 9:10
netJP12L6-Apr-07 9:10 
AnswerRe: how can i crack windows ? Pin
BoneSoft6-Apr-07 9:27
BoneSoft6-Apr-07 9:27 
AnswerRe: how can i crack windows ? Pin
DavidNohejl6-Apr-07 10:07
DavidNohejl6-Apr-07 10:07 
GeneralRe: how can i crack windows ? Pin
Sathesh Sakthivel6-Apr-07 10:11
Sathesh Sakthivel6-Apr-07 10:11 

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.