Click here to Skip to main content
15,906,558 members
Home / Discussions / C#
   

C#

 
Questiongetting a latest value that was inserted into a database. Pin
steve_rm26-Oct-06 17:49
steve_rm26-Oct-06 17:49 
AnswerRe: getting a latest value that was inserted into a database. Pin
sam#26-Oct-06 18:58
sam#26-Oct-06 18:58 
AnswerRe: getting a latest value that was inserted into a database. Pin
Navi1526-Oct-06 19:06
Navi1526-Oct-06 19:06 
QuestionC# - Working with file Pin
leanhsang26-Oct-06 17:10
leanhsang26-Oct-06 17:10 
AnswerRe: C# - Working with file Pin
engsrini26-Oct-06 19:01
engsrini26-Oct-06 19:01 
AnswerRe: C# - Working with file Pin
sam#26-Oct-06 19:01
sam#26-Oct-06 19:01 
AnswerRe: C# - Working with file Pin
ednrgc27-Oct-06 2:42
ednrgc27-Oct-06 2:42 
QuestionDragDrop Article Dilemma...Please help... Pin
new_phoenix26-Oct-06 15:59
new_phoenix26-Oct-06 15:59 
I was looking at the article written by Ian Giffen that he had written about the DragDrop event handler at http://www.codeproject.com/cs/miscctrl/LANDragDrop.asp[^ and I have developed a quite interesting challenge regarding how the application functions.

I am requesting that a DragDrop expert to download the source code application and to make the following modifications to the source code in order to reach the dilemma that I have encountered.

Make the following changes to the source code in the Form1 form.
Add a second control to the application like so:

public Form1()

  InitializeComponent();

  TestControl NewCtrl = new TestControl();
  NewCtrl.Left = 50;
  NewCtrl.Top = 50;

  TestControl NewCtrl2 = new TestControl();
  NewCtrl2.Left = 150;
  NewCtrl2.Top = 50;

  this.Controls.Add(NewCtrl);
  this.Controls.Add(NewCtrl2);

  DragDropHandler.Initialize();
  DragDropHandler.RegisterControl(this, true, true);
  DragDropHandler.RegisterControl(panel1, true, true);
  DragDropHandler.RegisterControl(NewCtrl, false, false);
  DragDropHandler.RegisterControl(NewCtrl2, false, false);
  DragDropHandler.RegisterControl(button1, false, true);

}


Then in the TestControl.cs file make the following changes:

public TestControl()
{
   InitializeComponent();
 
   this.Width = 50;
   this.Height = 50;
}


to make each control bigger. Now here is the dilemma. I would like each of the two controls: NewCtrl and NewCtrl2 to be able to act as parents to each other. That is, I would like to be able to drop one of the controls onto the other.

I have attempted to change the following code:
   DragDropHandler.RegisterControl(NewCtrl, false, false);
   DragDropHandler.RegisterControl(NewCtrl2, false, false);

to...

   DragDropHandler.RegisterControl(NewCtrl, true, true);
   DragDropHandler.RegisterControl(NewCtrl2, true, true);


and I have tried to catch the control in the DragOver event, but to no avail. The DragDrop event handler needs to have access to the parent control if one of the controls has been dropped onto the other control. This is the challenge. I am requesting the assistance of a DragDrop guru to resolve this dilemma. Please help!!!
QuestionEliminating Write Protection Pin
hotnreddyfreddy26-Oct-06 13:19
hotnreddyfreddy26-Oct-06 13:19 
AnswerRe: Eliminating Write Protection Pin
ednrgc27-Oct-06 2:39
ednrgc27-Oct-06 2:39 
QuestionStop Button from taking focus during a keypress or keyup event. Pin
bradsnobar26-Oct-06 11:18
bradsnobar26-Oct-06 11:18 
AnswerRe: Stop Button from taking focus during a keypress or keyup event. Pin
bradsnobar26-Oct-06 11:35
bradsnobar26-Oct-06 11:35 
Questionhow AdjustTokenPrivileges in C# ? Pin
vincent3126-Oct-06 10:57
vincent3126-Oct-06 10:57 
AnswerRe: how AdjustTokenPrivileges in C# ? Pin
vincent3127-Oct-06 0:38
vincent3127-Oct-06 0:38 
GeneralRe: how AdjustTokenPrivileges in C# ? Pin
vincent3127-Oct-06 0:39
vincent3127-Oct-06 0:39 
GeneralCrystal Report Pin
Saleh Mahmoud26-Oct-06 9:35
Saleh Mahmoud26-Oct-06 9:35 
GeneralRe: Crystal Report Pin
ednrgc26-Oct-06 9:42
ednrgc26-Oct-06 9:42 
GeneralRe: Crystal Report Pin
Saleh Mahmoud30-Nov-06 8:26
Saleh Mahmoud30-Nov-06 8:26 
QuestionCrystal Report Proble Pin
Saleh Mahmoud26-Oct-06 9:34
Saleh Mahmoud26-Oct-06 9:34 
QuestionRead barcode Pin
kajkow26-Oct-06 9:32
kajkow26-Oct-06 9:32 
AnswerRe: Read barcode Pin
stancrm26-Oct-06 23:01
stancrm26-Oct-06 23:01 
QuestionCrystal Report Problem1 Pin
Saleh Mahmoud26-Oct-06 9:32
Saleh Mahmoud26-Oct-06 9:32 
QuestionCrystal Report Problem Pin
Saleh Mahmoud26-Oct-06 9:31
Saleh Mahmoud26-Oct-06 9:31 
QuestionConverting Characters in Numbers.....Encryption Pin
drew.perkins26-Oct-06 9:08
drew.perkins26-Oct-06 9:08 
AnswerRe: Converting Characters in Numbers.....Encryption Pin
Guffa26-Oct-06 9:19
Guffa26-Oct-06 9:19 

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.