Click here to Skip to main content
15,921,454 members
Home / Discussions / C#
   

C#

 
QuestionStatistics on C# (.net) usage Pin
asm1233-Mar-07 4:02
asm1233-Mar-07 4:02 
QuestionPorting C++ to C#: Types Pin
Ri Qen-Sin3-Mar-07 3:24
Ri Qen-Sin3-Mar-07 3:24 
AnswerRe: Porting C++ to C#: Types Pin
Parwej Ahamad3-Mar-07 3:45
professionalParwej Ahamad3-Mar-07 3:45 
GeneralRe: Porting C++ to C#: Types Pin
Ri Qen-Sin3-Mar-07 3:57
Ri Qen-Sin3-Mar-07 3:57 
GeneralRe: Porting C++ to C#: Types Pin
Parwej Ahamad3-Mar-07 7:58
professionalParwej Ahamad3-Mar-07 7:58 
AnswerRe: Porting C++ to C#: Types Pin
Guffa3-Mar-07 4:50
Guffa3-Mar-07 4:50 
GeneralRe: Porting C++ to C#: Types Pin
Luc Pattyn3-Mar-07 12:18
sitebuilderLuc Pattyn3-Mar-07 12:18 
QuestionCircular Control Reference -- A control cannot be parented to iteself. Pin
new_phoenix3-Mar-07 2:37
new_phoenix3-Mar-07 2:37 
I have been having trouble with a circular control reference. I have two controls. The first one is parented to the other in a DragDrop environment. When the parent control is dragged onto the child control a circular reference is created because a parent control cannot be a child to its child control. How could this situation be resolved?

private static void _ctrlParent_DragOver(object sender, DragEventArgs e)
    {
        try
        {
            // If this is a valid control for this parent, allow it to move
            // freely over, otherwise disallow DragDrop operations
            if ( DragDropHandler.CanDropHere((Control)sender, e.Data) )
            {
                // cthis... this as a Control
                Control cthis = (Control)sender;

                // Set the DragDropEffect and get the control we are dragging
                e.Effect = DragDropEffects.Move;
                Control ctrl = DragDropHandler.GetControl(e.Data, true, true);

                // If this isn't an IDragDropEnabled control don't worry about
                // showing it's position
                if (!(ctrl is IDragDropEnabled))
                {
                    return;
                }

                // If this control is not part of the current "parent"
                // remove it from it's original parent and place it in
                // the current parent control collection
                if (cthis.Name != ctrl.Name)  // attempts to check for same control name
                {
                    ctrl.Parent.Controls.Remove(ctrl);
                    ctrl.Parent = cthis;   // ERROR occurs here...
                    cthis.Controls.Add(ctrl);
                    ctrl.BringToFront();

                    Point NewLocation = cthis.PointToClient(new Point(e.X, e.Y));
                    ctrl.Left = NewLocation.X - dragPoint.X;
                    ctrl.Top = NewLocation.Y - dragPoint.Y;
                }
                else
                {
                    return;
                }
            }
            else
            {
                e.Effect = DragDropEffects.None;
            }
        }
        catch (System.Exception ex)
        {
            MessageBox.Show("Error is " + ex.GetBaseException());
        }
    }

QuestionAsynchronous Vs Multithreaded Client-Server ? [modified] Pin
zinc_z3-Mar-07 2:31
zinc_z3-Mar-07 2:31 
AnswerRe: Asynchronous Vs Multithreaded Client-Server ? Pin
Parwej Ahamad3-Mar-07 3:49
professionalParwej Ahamad3-Mar-07 3:49 
GeneralRe: Asynchronous Vs Multithreaded Client-Server ? Pin
zinc_z3-Mar-07 5:59
zinc_z3-Mar-07 5:59 
GeneralRe: Asynchronous Vs Multithreaded Client-Server ? Pin
Parwej Ahamad3-Mar-07 7:34
professionalParwej Ahamad3-Mar-07 7:34 
AnswerRe: Asynchronous Vs Multithreaded Client-Server ? Pin
pbraun3-Mar-07 13:09
pbraun3-Mar-07 13:09 
QuestionDataGrid Pin
md_refay3-Mar-07 2:30
md_refay3-Mar-07 2:30 
QuestionDatabase connection... Pin
kalyan_24163-Mar-07 1:32
kalyan_24163-Mar-07 1:32 
QuestionHow to call VC++ dll in C# windows application? Pin
salon2-Mar-07 23:31
salon2-Mar-07 23:31 
AnswerRe: How to call VC++ dll in C# windows application? Pin
Shy Agam3-Mar-07 5:20
Shy Agam3-Mar-07 5:20 
AnswerRe: How to call VC++ dll in C# windows application? Pin
Vasudevan Deepak Kumar4-Mar-07 5:14
Vasudevan Deepak Kumar4-Mar-07 5:14 
QuestionHow to add, delete records form the datagrid at run time Pin
Pankaj Saha2-Mar-07 22:04
Pankaj Saha2-Mar-07 22:04 
AnswerRe: How to add, delete records form the datagrid at run time Pin
kalyan_24163-Mar-07 1:58
kalyan_24163-Mar-07 1:58 
AnswerRe: How to add, delete records form the datagrid at run time Pin
Vasudevan Deepak Kumar4-Mar-07 5:14
Vasudevan Deepak Kumar4-Mar-07 5:14 
QuestionAttatching .HLP File Pin
Ian Uy2-Mar-07 21:20
Ian Uy2-Mar-07 21:20 
AnswerRe: Attatching .HLP File Pin
Dawid Mazuruk2-Mar-07 23:45
Dawid Mazuruk2-Mar-07 23:45 
GeneralRe: Attatching .HLP File Pin
Ian Uy3-Mar-07 1:24
Ian Uy3-Mar-07 1:24 
AnswerRe: Attatching .HLP File Pin
Vasudevan Deepak Kumar4-Mar-07 5:13
Vasudevan Deepak Kumar4-Mar-07 5:13 

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.