EDN Admin
Well-known member
Hello,
<span>I need to make something like a toolbox. I have my custom controls on the left side and in the middle, there are richtextboxes created programmatically <span>in tabpages when clicked a "new window" button. (tabpages are added programmatically
as well).
<span>Here is the code that creates RichTextBox component into tabpages...
<span>
<div style="color:Black;background-color:White; <pre>
<span style="color:Blue; private <span style="color:Blue; void newToolStripButton_Click(<span style="color:Blue; object sender, EventArgs e)
{
globalTabCounter++;
<span style="color:Blue; this.tabControl1.TabPages.Add(<span style="color:#A31515; "jQuery Editor" + globalTabCounter);
<span style="color:Blue; this.tabControl1.SelectedIndex = <span style="color:Blue; this.tabControl1.TabPages.Count - 1;
rtb = <span style="color:Blue; new RichTextBox();
rtb.Dock = DockStyle.Fill;
rtb.Text = preSetText;
<span style="color:Blue; this.tabControl1.TabPages[tabControl1.SelectedIndex].Controls.Add(rtb);
ActivateForm();
}
[/code]
What I need to do is, when I drag and drop an item from the listview on the right (to the dynamically created RichTextBox which is only selected at that moment via tab page) to a specific location (line 14, between the words white dog for ex. - just by using
mouse drag and drop action) on the Richtextbox. The data is loaded to the listview from database so I cant really put static text there. Ill deal with which text will be inserted into richtextbox later by myself but im stuck with the drag&drop thing
Basically, it should be something like visual studio toolbar...
Any suggestions?
I tried listviews ItemDrag event but no result... <hr class="sig Blitzkrieg
View the full article
<span>I need to make something like a toolbox. I have my custom controls on the left side and in the middle, there are richtextboxes created programmatically <span>in tabpages when clicked a "new window" button. (tabpages are added programmatically
as well).
<span>Here is the code that creates RichTextBox component into tabpages...
<span>
<div style="color:Black;background-color:White; <pre>
<span style="color:Blue; private <span style="color:Blue; void newToolStripButton_Click(<span style="color:Blue; object sender, EventArgs e)
{
globalTabCounter++;
<span style="color:Blue; this.tabControl1.TabPages.Add(<span style="color:#A31515; "jQuery Editor" + globalTabCounter);
<span style="color:Blue; this.tabControl1.SelectedIndex = <span style="color:Blue; this.tabControl1.TabPages.Count - 1;
rtb = <span style="color:Blue; new RichTextBox();
rtb.Dock = DockStyle.Fill;
rtb.Text = preSetText;
<span style="color:Blue; this.tabControl1.TabPages[tabControl1.SelectedIndex].Controls.Add(rtb);
ActivateForm();
}
[/code]
What I need to do is, when I drag and drop an item from the listview on the right (to the dynamically created RichTextBox which is only selected at that moment via tab page) to a specific location (line 14, between the words white dog for ex. - just by using
mouse drag and drop action) on the Richtextbox. The data is loaded to the listview from database so I cant really put static text there. Ill deal with which text will be inserted into richtextbox later by myself but im stuck with the drag&drop thing

Basically, it should be something like visual studio toolbar...
Any suggestions?
I tried listviews ItemDrag event but no result... <hr class="sig Blitzkrieg
View the full article