Click here to Skip to main content
15,900,378 members
Home / Discussions / C#
   

C#

 
Questionvisual studio 2013 community edition and uml modeling Pin
Tridip Bhattacharjee18-Aug-16 21:52
professionalTridip Bhattacharjee18-Aug-16 21:52 
AnswerRe: visual studio 2013 community edition and uml modeling Pin
Richard MacCutchan18-Aug-16 22:25
mveRichard MacCutchan18-Aug-16 22:25 
AnswerRe: visual studio 2013 community edition and uml modeling Pin
Nathan Minier19-Aug-16 1:00
professionalNathan Minier19-Aug-16 1:00 
AnswerRe: visual studio 2013 community edition and uml modeling Pin
Gerry Schmitz20-Aug-16 8:12
mveGerry Schmitz20-Aug-16 8:12 
QuestionHow to get the currently opened directory in Windows Explorer in .net Pin
srikrishnathanthri17-Aug-16 19:28
srikrishnathanthri17-Aug-16 19:28 
AnswerRe: How to get the currently opened directory in Windows Explorer in .net Pin
Richard MacCutchan17-Aug-16 21:35
mveRichard MacCutchan17-Aug-16 21:35 
Questionconcatenative approach to TTS Pin
Member 1266621417-Aug-16 4:28
Member 1266621417-Aug-16 4:28 
AnswerRe: concatenative approach to TTS Pin
OriginalGriff17-Aug-16 4:51
mveOriginalGriff17-Aug-16 4:51 
AnswerRe: concatenative approach to TTS Pin
Gerry Schmitz17-Aug-16 6:01
mveGerry Schmitz17-Aug-16 6:01 
AnswerRe: concatenative approach to TTS Pin
Bernhard Hiller17-Aug-16 21:51
Bernhard Hiller17-Aug-16 21:51 
QuestionHow to make a border less form draggable inside specified location in .net? Pin
srikrishnathanthri17-Aug-16 1:34
srikrishnathanthri17-Aug-16 1:34 
AnswerRe: How to make a border less form draggable inside specified location in .net? Pin
BillWoodruff17-Aug-16 3:03
professionalBillWoodruff17-Aug-16 3:03 
GeneralRe: How to make a border less form draggable inside specified location in .net? Pin
srikrishnathanthri17-Aug-16 19:09
srikrishnathanthri17-Aug-16 19:09 
GeneralRe: How to make a border less form draggable inside specified location in .net? Pin
BillWoodruff17-Aug-16 21:41
professionalBillWoodruff17-Aug-16 21:41 
Generalhow to create user rights for different forms c# Pin
Member 308047017-Aug-16 1:14
Member 308047017-Aug-16 1:14 
GeneralRe: how to create user rights for different forms c# Pin
Aless Alessio17-Aug-16 1:35
Aless Alessio17-Aug-16 1:35 
GeneralRe: how to create user rights for different forms c# Pin
Richard MacCutchan17-Aug-16 2:01
mveRichard MacCutchan17-Aug-16 2:01 
QuestionC# and MS SQL DeadLock Pin
Zeyad Jalil16-Aug-16 23:41
professionalZeyad Jalil16-Aug-16 23:41 
AnswerRe: C# and MS SQL DeadLock Pin
Pete O'Hanlon17-Aug-16 0:15
mvePete O'Hanlon17-Aug-16 0:15 
AnswerRe: C# and MS SQL DeadLock Pin
Gerry Schmitz17-Aug-16 6:09
mveGerry Schmitz17-Aug-16 6:09 
AnswerRe: C# and MS SQL DeadLock Pin
Andrea Simonassi16-Sep-16 3:46
Andrea Simonassi16-Sep-16 3:46 
Questionhow to copy controls of one flowlayoutpanel to other? Pin
Le@rner16-Aug-16 20:30
Le@rner16-Aug-16 20:30 
AnswerRe: how to copy controls of one flowlayoutpanel to other? Pin
Richard MacCutchan16-Aug-16 21:22
mveRichard MacCutchan16-Aug-16 21:22 
GeneralRe: how to copy controls of one flowlayoutpanel to other? Pin
Le@rner16-Aug-16 22:30
Le@rner16-Aug-16 22:30 
GeneralRe: how to copy controls of one flowlayoutpanel to other? Pin
OriginalGriff16-Aug-16 22:55
mveOriginalGriff16-Aug-16 22:55 
A Control can only ever have one Parent: when you add it to a different Controls collection it is automatically removed from the existing collection.
If you want a visually similar control in two different places, you have to Copy it - but that means that it's a different control, any changes to one will not be reflected in the other.
To clone it isn't difficult using reflection:
C#
public static class GeneralMethods
    {
    public static T Clone<T>(this T control) where T : Control
        {
        T result = Activator.CreateInstance<T>();
        PropertyInfo[] piCollection = typeof(T).GetProperties(BindingFlags.Public | BindingFlags.Instance);
        foreach (PropertyInfo pi in piCollection)
            {
            if (pi.CanWrite)
                {
                if (pi.Name != "WindowTarget")
                    {
                    pi.SetValue(result, pi.GetValue(control, null), null);
                    }
                }
            }
        return result;
        }
    }
I suspect that you don't really want to do this - why are you trying? What are you trying to achieve? There may be a better way.
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...

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.