J'ai DragDrop
et DragEnter
événements sur mon SplitContainer.Panel
:blocs RichTextBox événement DragDrop
splitContainer.Panel.DragDrop += new System.Windows.Forms.DragEventHandler(this.splitContainerPanelDragDrop);
splitContainer.Panel.DragEnter += new System.Windows.Forms.DragEventHandler(this.splitContainerPanelDragEnter);
Il fonctionne parfaitement avec tous les contrôles à l'intérieur SplitContainer.Panel
sauf RichTextBox
contrôles.
Alors DragDrop/DragEnter fonctionne parfaitement dans tous les contrôles à l'intérieur SplitContainer sauf les contrôles qui ont marqué la couleur jaune.
Ce que j'ai essayé:
1) Définir
RichTextBox.AllowDrop = false;
Je même DragEnter est indisponible avec "l'action n'est pas autorisé" curseur.
2) Set
RichTextBox.AllowDrop = true;
Après ce curseur est ok, mais cela ne fonctionne pas parce DragEventHandler
attend plus dans d'autres cas, cela ne fonctionne pas.
3) Définir variante
RichTextBox.EnableAutoDragDrop=false;
RichTextBox.AllowDrop=true;
Même résultat que 2).
Je ne veux pas mettre événement DragDrop
/DragEnter
pour chaqueRichTextBox
à l'intérieur SplitContainer car à l'intérieur FlowLayoutPanel
ils sont créés dynamiquement.
La question est: existe-t-il une méthode comme e.PreventDefault
analogique en C#? Ou que puis-je faire, sauf la définition d'événements pour chaque RichTextBox
pour le faire fonctionner?
Avez-vous essayé [ce] (http: // stackoverflow .com/questions/1465988/capture-dragdrop-event-de-richtextbox-c-sharp? rq = 1): 'EnableAutoDragDrop = false; AllowDrop = true; ' – TaW
Je ne comprends pas très bien ce que vous voulez –
Je veux que les événements DragDrop/DragEnter fonctionnent sur TOUT contrôle à l'intérieur de SplitContaner.Panel, mais cela ne fonctionne pas sur RichTextBox. – DEADMC