This is a migrated thread and some comments may be shown as answers.

RadButtonElements containing links to URLs

2 Answers 31 Views
RibbonBar
This is a migrated thread and some comments may be shown as answers.
keith robideau
Top achievements
Rank 1
keith robideau asked on 15 Oct 2009, 01:15 PM
Is there an example of this (VB or C#) found anywhere on this site? I seem to be coming up short. I've been learning .net / vb for the past year, but have not had the privilege of coding such an object to date.

We're looking to deploy an organizational-wide (internal) radRibbonForm that would basically be deployed as a floating toolbar for users to gain quick access to internal resources.

The RibbonTab is a great high level way for user to navigate topic, and then within each tab, the RibbonBarGroup contains relavent DropDownButtons, which of course contain ButtonElements...

When I click the buttonElement, I get a 'Win32Exception was unhandled' error.

Here's an example of a particular Button Element's code:

 

Imports System.Web  
Imports Telerik.WinControls.UI  
 
Partial Public Class RadRibbonForm1  
 
    Private Sub rbeD1CPT_Click(ByVal sender As ObjectByVal e As EventArgs) Handles rbeD1CPT.Click  
        System.Diagnostics.Process.Start("iexplorer.exe""http://www.google.com")  
    End Sub 
 
    Public Sub buttonClickEvent(ByVal sender As ObjectByVal e As EventArgs) Handles rbeD1CPT.Click  
        Dim rbeD1CPT As RadButtonElement = TryCast(sender, RadButtonElement)  
        System.Diagnostics.Process.Start("iexplorer.exe"DirectCast(rbeD1CPT.Tag, String))  
    End Sub 
End Class 


Any assistance would be greatly appreciated (I can post the *.designer.vb if it will help..)

Keith

2 Answers, 1 is accepted

Sort by
0
keith robideau
Top achievements
Rank 1
answered on 15 Oct 2009, 02:33 PM
i cleaned up the code and got this to work.

now i'm wondering how to re-size the button elements. i am doing it in design-time, but the button dropdowns seem to default back to original size when viewed in debugging.

0
Nikolay
Telerik team
answered on 20 Oct 2009, 08:58 AM
Hi keith robideau,

This first issue that you had was not related to RadControls for WinForms. The exception that you got is because of the way you are using the Process.Start() method. The fileName parameter should contain the full path to a file plus the filename itself. In your case the Process.Start will look like this:
System.Diagnostics.Process.Start("C:\Program Files\Internet Explorer\iexplore.exe", "http://www.google.com")

As to your second question, in order to resize RadButtonElements at design-time you should set their MinSize/MaxSize properties

I hope this helps. If you have additional questions, feel free to contact me.

Regards,

Nikolay
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
RibbonBar
Asked by
keith robideau
Top achievements
Rank 1
Answers by
keith robideau
Top achievements
Rank 1
Nikolay
Telerik team
Share this question
or