4 Answers, 1 is accepted
0
Hello Carsten,
Thank you for your questions.
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Thank you for your questions.
You can handle close, minimize and maximize events as the code below demonstrates:
(this.radRibbonBar1.RibbonBarElement.Children[0].Children[1] as RadRibbonBarCaption).Minimize += |
new TitleBarSystemEventHandler(minimizeEventHandler); |
As for the show below the ribbon/Show above the ribbon click events the code is a bit more complicated. You have to partition the task into two steps because items in the overflow button are created dynamically as you open it. First handle the click event of the overflow button and then handle the click event of the chosen item, in particular show below the ribbon/Show above the ribbon. Please note that the separator element is an item and is part of indexing.
private void Form1_Load(object sender, EventArgs e) |
{ |
(this.radRibbonBar1.RibbonBarElement.Children[0].Children[0].Children[1].Children[1] |
as RadToolStripOverFlowButtonElement).Click += new EventHandler(Form1_Click); |
} |
void Form1_Click(object sender, EventArgs e) |
{ |
RadToolStripOverFlowButtonElement button = (RadToolStripOverFlowButtonElement)sender; |
button.Items[2].Click += new EventHandler(button_Click); |
} |
void button_Click(object sender, EventArgs e) |
{ |
MessageBox.Show("hello"); |
} |
Feel free to contact me if you have any further questions.
Sincerely yours,
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Carsten
Top achievements
Rank 1
answered on 19 Sep 2008, 07:25 AM
Hello Nick,
thanks a lot for your answer. Unfortunately I had forgotten to tell you in my first post, that I program with VB.Net and I have some difficultys to "translate" your code-snippets into VB.Net. Probably you can give me an advice how to code it under VB.Net.
Regards
Carsten
thanks a lot for your answer. Unfortunately I had forgotten to tell you in my first post, that I program with VB.Net and I have some difficultys to "translate" your code-snippets into VB.Net. Probably you can give me an advice how to code it under VB.Net.
Regards
Carsten
0
Accepted
Hi Carsten,
The first code snippet in VB is:
And the second one is:
Best wishes,
Nick
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
The first code snippet in VB is:
AddHandler (TryCast(Me.radRibbonBar1.RibbonBarElement.Children(0).Children(1), RadRibbonBarCaption)).Minimize, AddressOf minimizeEventHandler |
And the second one is:
Private Sub Form1_Load(ByVal sender As Object, ByVal e As EventArgs) |
AddHandler (TryCast(Me.radRibbonBar1.RibbonBarElement.Children(0).Children(0).Children(1).Children(1), RadToolStripOverFlowButtonElement)).Click, AddressOf Form1_Click |
End Sub |
Sub Form1_Click(ByVal sender As Object, ByVal e As EventArgs) |
Dim button As RadToolStripOverFlowButtonElement = DirectCast(sender, RadToolStripOverFlowButtonElement) |
AddHandler button.Items(2).Click, AddressOf button_Click |
End Sub |
Sub button_Click(ByVal sender As Object, ByVal e As EventArgs) |
MessageBox.Show("hello") |
End Sub |
Best wishes,
Nick
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Carsten
Top achievements
Rank 1
answered on 22 Sep 2008, 11:11 AM
Hello Nick,
thanks a lot for your VB.Net codesnippets.
Regards
Carsten
thanks a lot for your VB.Net codesnippets.
Regards
Carsten