Telerik Forums
UI for WinForms Forum
2 answers
1.2K+ views

Hi, 

I'm trying to limit the size of image inside a RadButtonElement, but after build it returns to original image file size.

 

I set the Image size in RadButtonElement (in RadRibbonBar) by using the ImagePrimitive properties:
- Click on the smart tag of your RadButton and choose "Edit UI elements"
- In the Control element structure navigate to ImagePrimitive.
- Change MinSize and MaxSize's Height and Width properties to 48 (image size is 225x225 in PNG file type)
- Change ImageLayout to Strech

Theme is "Fluent".

Here is what is generated in the designer file:

this.radButtonElementExecute.AutoSize = false;
            this.radButtonElementExecute.AutoSizeMode = Telerik.WinControls.RadAutoSizeMode.Auto;
            this.radButtonElementExecute.AutoToolTip = true;
            this.radButtonElementExecute.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(229)))), ((int)(((byte)(239)))), ((int)(((byte)(255)))));
            this.radButtonElementExecute.Bounds = new System.Drawing.Rectangle(0, 0, 57, 69);
            this.radButtonElementExecute.DefaultSize = new System.Drawing.Size(0, 0);
            this.radButtonElementExecute.Font = new System.Drawing.Font("Segoe UI", 8.25F);
            this.radButtonElementExecute.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(21)))), ((int)(((byte)(66)))), ((int)(((byte)(139)))));
            this.radButtonElementExecute.Image = ((System.Drawing.Image)(resources.GetObject("radButtonElementExecute.Image")));
            this.radButtonElementExecute.ImageAlignment = System.Drawing.ContentAlignment.TopCenter;
            this.radButtonElementExecute.ImageIndex = -1;
            this.radButtonElementExecute.MaxSize = new System.Drawing.Size(57, 69);
            this.radButtonElementExecute.MinSize = new System.Drawing.Size(0, 0);
            this.radButtonElementExecute.Name = "radButtonElementExecute";
            this.radButtonElementExecute.StretchHorizontally = false;
            this.radButtonElementExecute.StretchVertically = false;
            this.radButtonElementExecute.Text = "Execute";
            this.radButtonElementExecute.TextAlignment = System.Drawing.ContentAlignment.MiddleCenter;
            this.radButtonElementExecute.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText;
            this.radButtonElementExecute.TextOrientation = System.Windows.Forms.Orientation.Horizontal;
            this.radButtonElementExecute.ToolTipText = "Execute";
            this.radButtonElementExecute.Click += new System.EventHandler(this.radButtonRunExecution_Click);
            ((Telerik.WinControls.Primitives.ImagePrimitive)(this.radButtonElementExecute.GetChildAt(1).GetChildAt(0))).ImageLayout = System.Windows.Forms.ImageLayout.Stretch;
            ((Telerik.WinControls.Primitives.ImagePrimitive)(this.radButtonElementExecute.GetChildAt(1).GetChildAt(0))).AutoSize = false;
            ((Telerik.WinControls.Primitives.ImagePrimitive)(this.radButtonElementExecute.GetChildAt(1).GetChildAt(0))).MinSize = new System.Drawing.Size(48, 48);
            ((Telerik.WinControls.Primitives.ImagePrimitive)(this.radButtonElementExecute.GetChildAt(1).GetChildAt(0))).MaxSize = new System.Drawing.Size(48, 48);

 

thanks

sebastien
Top achievements
Rank 1
 answered on 28 Jan 2019
1 answer
233 views

Greetings,

How can I get index of checked items , put in lines of a string  ?

Imagine I have checked the first , forth and sixth items , so I will have :

1

4

6

 

 

 

Dess | Tech Support Engineer, Principal
Telerik team
 answered on 28 Jan 2019
3 answers
152 views

This has to be the stupidest question I have ever asked...

..but how to set the value of a RadRadialGauge?

It works OK for me on most of the RadRadialGauge styles available, but on this one, I can't set the value.

( don't know how to describe the option, so I included a screen shot.)

I'm just using the same code as with the other options:

  Private Sub redrawGauge()
...
        With RadRadialGauge1

         .RangeStart = 0
        .RangeEnd = 3
         .Value = 1
        End With

    End Sub

What could possibly go wrong?

I can even query he .value property, and it reads-back correctly. What it doesn't do is show visually. It just stays at the maximum value.

What am I doing wrong please?

 

 

 

Dess | Tech Support Engineer, Principal
Telerik team
 answered on 28 Jan 2019
4 answers
157 views

Hello,

My form is RadRibbonBarForm. Me.HelpButtonClicked cannot be fired when I click the help button in RadRibbonBar.

I found out RadRibbonBar.HelpButton.Click can handle the help button click event.

Does Me.HelpButtonClicked event not work any more in RadRibbonBarForm ?

One more question, why VS doesn't accept the definition of the event:

Private Sub RibbonBtn_Help_Click(sender As Object, e As EventArgs) Handles RadRibbonBar1.HelpButton.Click
'---Bla bla
End Sub

 

But it accepts only wire the event like this :

Private Sub FrmMain_Load(sender As Object, e As EventArgs)
    AddHandler RadRibbonBar1.HelpButton.Click, AddressOf RibbonBtn_Help_Click
End Sub
 
Private Sub RibbonBtn_Help_Click(sender As Object, e As EventArgs)
'----Bla bla
End Sub

 

What's the different ?

Thank you by advance.

 

 

 

 

Kun
Top achievements
Rank 2
 answered on 28 Jan 2019
2 answers
65 views

Hi,

I have created a custom RadDiagramShape. I would like to be able to add a drop down list to my shapes so that the user would be able to select a certain value from a list in order to identify each shape. Or some alternative solution which will allow a user to select a value from a drop down list to be able to identify shape objects that are used on the diagram. I've attached an image to try and describe what i would like to achieve.

Thanks.

Jacques
Top achievements
Rank 1
 answered on 28 Jan 2019
5 answers
480 views
I need to save and then restore listview columns settings (mainly column width and column order) when the user changes these settings:
1. How do I save and restore the columns width and order
2. Which event can I use to trap a user's column width and/or order change

I have not found a method like the save and restore layout of the radgridview ..

Thanks in advance
Pierre-Jean
Dess | Tech Support Engineer, Principal
Telerik team
 answered on 28 Jan 2019
1 answer
50 views
After chasing my tail for longer than I will admit I found the very important note in the RadBindingNaviagator Getting Started page not to change the design time name of the control or the control will not function. By convention and policy all controls are changed to meaningful names in my programming environment. I would like to say that this non-standard behavior is very unwelcome I strongly request that behavior gets corrected going forward. It makes me wonder what other traps are in the controls. Thanks 
Dimitar
Telerik team
 answered on 28 Jan 2019
1 answer
172 views

Is there any easy way to convert RadDataFilter.Expression to FilterDescriptorCollection, so ill be able add it do CompositeFilterDescriptor of the RadGridView.FilterDescriptors.

RadGridView.FilterDescriptors.Add(new CompositeFilterDescriptor() { FilterDescriptors = RadDataFilter.Expression? });

Dimitar
Telerik team
 answered on 28 Jan 2019
3 answers
367 views

Hello,

So I've come across this weird (possible) bug whereupon if you bing a datatable as datasource in a multicolumn combobox and then try to change the SelectedIndex before the combobox has been drawn to the UI, you get an Index out of range exception even though the index is perfectly fine.

If you wait for it to be drawn, then it works fine.

 

I've created a reproducible example where I have a form with a PageView control; there's an "Employee" class whose "NewPage(AvoidBug As Boolean)" function returns a PageViewPage which has a MultiColumn cb inside with a datatable as its DataSource.

The 1st button on the main form will add the PageViewPage control that the NewPage(False) function returned to the PageView and the mccb.SelectedIndex will be changed inside the NewPage() function (so before it's drawn to the UI)

The 2nd button will do the same, only calling the NewPage(True) will result in a Public Variable inside the Class being set to the Index we want the mccb.SelectedIndex to be changed to, but the mccb.SelectedIndex will NOT change. After the control is added on the main form, the mccb.SelectedIndex now changes, and no exception is produced.

 

*So does that mean the the DataSource indexing on a mbcb occurs only after the control is drawn/visible to the user?

*Another thing I noticed, even when the second button is pushed, the bug avoidance only works once. If you push it again (to add a second PageViewPage) then exception occurs again

*However, if you delete the first PageViewPage before pushing the second button a second time, essentially adding a first PageViewPage again, then the exception doesn't occur

 

Things will become much clearer by using the reproducible code: https://www.dropbox.com/s/4ccjr37n60mavt4/TelerikWinFormsApp1%20%282%29.rar?dl=1

 

Best regards,

Ioannis Mamalikidis

Dess | Tech Support Engineer, Principal
Telerik team
 answered on 28 Jan 2019
1 answer
577 views

Hi.

I have a problem.

How can print a picture from a picturebox?

How can put correct object in Associateobjet to print it?

Hristo
Telerik team
 answered on 28 Jan 2019
Narrow your results
Selected tags
Tags
GridView
General Discussions
Scheduler and Reminder
Treeview
Dock
RibbonBar
Themes and Visual Style Builder
ChartView
Calendar, DateTimePicker, TimePicker and Clock
DropDownList
Buttons, RadioButton, CheckBox, etc
ComboBox and ListBox (obsolete as of Q2 2010)
ListView
Chart (obsolete as of Q1 2013)
Form
PageView
MultiColumn ComboBox
TextBox
RichTextEditor
Menu
PropertyGrid
RichTextBox (obsolete as of Q3 2014 SP1)
Panelbar (obsolete as of Q2 2010)
PivotGrid and PivotFieldList
Tabstrip (obsolete as of Q2 2010)
MaskedEditBox
CommandBar
PdfViewer and PdfViewerNavigator
ListControl
Carousel
Diagram, DiagramRibbonBar, DiagramToolBox
GanttView
Panorama
New Product Suggestions
Toolstrip (obsolete as of Q3 2010)
VirtualGrid
AutoCompleteBox
Label
Spreadsheet
ContextMenu
Panel
Visual Studio Extensions
TitleBar
Documentation
SplitContainer
Map
DesktopAlert
ProgressBar
CheckedDropDownList
Rotator
TrackBar
MessageBox
SpinEditor
StatusStrip
CheckedListBox
Wizard
ShapedForm
SyntaxEditor
TextBoxControl
LayoutControl
CollapsiblePanel
Conversational UI, Chat
DateTimePicker
TabbedForm
CAB Enabling Kit
DataEntry
GroupBox
ScrollablePanel
WaitingBar
ScrollBar
ImageEditor
Tools - VSB, Control Spy, Shape Editor
BrowseEditor
DataFilter
ColorDialog
FileDialogs
Gauges (RadialGauge, LinearGauge, BulletGraph)
ApplicationMenu
RangeSelector
CardView
WebCam
BindingNavigator
PopupEditor
RibbonForm
Styling
TaskBoard
Barcode
ColorBox
Callout
FilterView
PictureBox
VirtualKeyboard
NavigationView
Accessibility
DataLayout
ToastNotificationManager
ValidationProvider
CalculatorDropDown
Localization
TimePicker
ButtonTextBox
FontDropDownList
Licensing
BreadCrumb
Security
LocalizationProvider
Dictionary
Overlay
Separator
SparkLine
TreeMap
StepProgressBar
SplashScreen
Flyout
ToolbarForm
NotifyIcon
Rating
TimeSpanPicker
BarcodeView
Calculator
OfficeNavigationBar
TaskbarButton
HeatMap
SlideView
PipsPager
AIPrompt
TaskDialog
DateOnlyPicker
TimeOnlyPicker
+? more
Top users last month
Henri
Top achievements
Rank 2
Iron
Iron
Iron
SUNIL
Top achievements
Rank 2
Iron
Iron
Iron
David
Top achievements
Rank 1
Jackson
Top achievements
Rank 1
Iron
Iron
Tim
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Henri
Top achievements
Rank 2
Iron
Iron
Iron
SUNIL
Top achievements
Rank 2
Iron
Iron
Iron
David
Top achievements
Rank 1
Jackson
Top achievements
Rank 1
Iron
Iron
Tim
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?