Telerik Forums
UI for WinForms Forum
1 answer
11 views

I'm trying to use the Windows11Compact theme as default for an entire application, using the config below. 


This is a WinForms project in C#, I have the Windows11 theme dll added to the project, and I'm trying to automaticaly apply the Windows11Compact theme for all controls and all forms that will be added in the project. I don't want to set the theme in runtime because I need to see the theme during the design of the application.

With the config shown above the theme is not applied. It only uses the default Telerik theme.

However, if I change to the Windows11 theme the form updates automaticaly as well as any control I add. It also work's with the Fluent Theme for exemple.

The version of telerik I'm using is Telerik for WinForms 2024.1.312.40.

 

Thank you in advance for any answer.

 

Nadya | Tech Support Engineer
Telerik team
 answered on 12 Apr 2024
1 answer
15 views

How can I tell if a CHECKBOX contains focus.  We have a specific set of keyboard requirements that if the user clicks the "ENTER" key, the next control should bet set focused, but not change the state of the checkbox.  Clicking the "ENTER" key does change the state.   When you are on a CheckBox, ContainsFocus doesn't seem to work.   So, what we would like to do, is if the CHECKBOX has focus, when the use clicks the "ENTER" key, it just moves to the next control in a tab order and not check the checkbox.  (We are trying to get the DateTimePicker to do the same thing)...

 


protected virtual void HandleKeyDownForForm(object sender, KeyEventArgs e)
{
   if (e.KeyData == Keys.Enter)
   {
      if (ntsRadDateTimePickerDob.ContainsFocus)
      {
         _dobHasNullValue = !ntsRadDateTimePickerDob.NullableValue.HasValue;
      }

      if (radCheckBoxActiveAbsentee.ContainsFocus)
      {
         _activeAbsenteeValue = radCheckBoxActiveAbsentee.IsChecked;
      }

      Control ctl = (Control)sender;
      ctl.SelectNextControl(ActiveControl, true, true, true, true);
   }
}

 

Any help would be greatly appreciated.

 

Thank You.

Nadya | Tech Support Engineer
Telerik team
 answered on 01 Apr 2024
1 answer
12 views

For some reason, I can't reduce the width of this RadForm in the designer or programaticaly.  The controls are an autosized RadButton on an autosized FlowLayoutPanel on an autosized RadForm.

Margins and Padding are set to 0 for everything.  What am I doing wrong?

 

What

Dinko | Tech Support Engineer
Telerik team
 answered on 26 Mar 2024
9 answers
451 views

I doubt that this is an issue with the WinForms controls but I'll ask anyway in case anyone has experienced this problem (and I haven't found any solution searching the web).  My project is MDI with seven child forms so far.  After a few months of development I finally experienced a problem when I select several of my menu options (launch several child forms).  It doesn't matter what the order I select the menu options; the third menu option, whichever option that happens to be, gets a System.NullReferenceException.

The code for each menu option is this pattern:

private void miDULAudit_Click(object sender, EventArgs e)
{
    if (objDULAudit == null)
    {
        objDULAudit = new frmDULAudit();
        objDULAudit.MdiParent = this;
        objDULAudit.FormHiding += new EventHandler(ChildFormHiding);
    }
    objDULAudit.Show();
    objDULAudit.BringToFront();
    objDULAudit.Activate();
    objDULAudit.WindowState = FormWindowState.Maximized;
}

 

The error happens at objDULAudit.Show(); (in this code example).  

System.NullReferenceException was unhandled
  HResult=-2147467261
  Message=Object reference not set to an instance of an object.
  Source=System.Windows.Forms
  StackTrace:
       at System.Windows.Forms.NativeWindow.WindowClass.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
  InnerException: 

 

I stepped through every line of code (as the child form instantiates) trying to run into the problem but I have not been successful.

Any ideas?

Thank you,

Gary

 

 

Nadya | Tech Support Engineer
Telerik team
 answered on 21 Mar 2024
1 answer
53 views

I have a completely new winforms project. The only thing I adjusted was to change the target framework from .NET6 to .NET7 in the projects properties.

Now, each time I minimize (or maximize) a RadForm and then "normalize" it again, it is getting larger (some pixels to the right and to the bottom). This does not happen on .NET6 but on .NET7 and .NET8.

There is also an issue within the VS designer: When I open the form again its size is also slightly different (e.g. set to "300; 300" changed to "318; 243"). It also does not matter if I change the forms AutoScale value to "None", "Font", "DPI" or "Inherit".  Furthermore, I have no strange scaling in MS Windows, it is set to 100 %.

What is the reason for this behaviour and what do I need to do to prevent it?

I would also like you to check if this occurs to other controls, as well.

 

Dinko | Tech Support Engineer
Telerik team
 answered on 18 Mar 2024
1 answer
22 views

I have a custom RadForm class that has inherited over a hundred forms. I have a custom RadTextBox class where I added some validation fired on the LostFocus event. To replace all RadTextBox controls with custom ones are a thousand controls to update, which are not an option.
I am looking for a way to maybe use events on my custom Radform which I can fire on Radtextbox control, it may be a way to update Radtextbox control to a custom one. Maybe other ideas on how I can use custom RadTextBox  control without updating one by one

Nadya | Tech Support Engineer
Telerik team
 answered on 11 Mar 2024
1 answer
43 views

Hi, I'm trying to adapt my program to all type of screens with different scale settings and I encounted some difficulties with the RadColorPicker Dialog.

As you can see in the image below I tested my RadForm in a screen with the scale setted to 200% and when I open the RadColorPicker I cant see some controls that are inside of the Dialog.

I tried different setting and the only one where I can see all the controls is with the DPI aware setted to false but the texts are pixelated.

This is one of the test I made to set the DPI aware on my app.manifest:

 <asmv3:application>
   <asmv3:windowsSettings xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">
     <dpiAwareness xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">PerMonitorV2</dpiAwareness>
   </asmv3:windowsSettings>
 </asmv3:application>

There's a way to set the DPI aware for the RadColorPicker dialog?

Thanks in advace.

Dinko | Tech Support Engineer
Telerik team
 answered on 03 Feb 2024
1 answer
28 views

Hi,

I am adding a custom icon into a floating docking window using this code:

    private void SetHeaderIcon(ToolWindow toolWindow, Icon icon)
    {
      toolWindow.FloatingParent.Icon = icon;
      toolWindow.FloatingParent.ShowIcon = icon != null;
      toolWindow.FloatingParent.FormElement.TitleBar.IconPrimitive.Visibility = icon != null ? ElementVisibility.Visible : ElementVisibility.Collapsed;
    }

The icon is added correctly, but it's not centered. I don't know if it's a problem of the theme, or it's just expected behaviour.

I added 2 screenshots of what I see with a custom icon, and with the default icon.

Is there a way to add margins or center it?

I'm using Telerik for WinForms 2018.3.911.40

Thank you.

Nadya | Tech Support Engineer
Telerik team
 answered on 22 Jan 2024
2 answers
43 views

Hi,

 

I use Windows Forms as MDI and open some child form.

In one of the forms, I use the RadOverlayManager for Grids to get an Loading Screen.

Before I start the loading of the RadGridView (or something other).

RadOverlayManager.Show(RadGridView1)

And after the loading of the Grid at the end of the sub.


RadOverlayManager.Close()

But after the loading, it selects another MDI Child form, that was opend "before" these form.

Any Ideas whats wrong and how to solve these problem?

(or maybe have another solution as a loading screen/symbol for loading things)

Thank you

 

Nadya | Tech Support Engineer
Telerik team
 answered on 17 Jan 2024
1 answer
80 views

Hi,

It seems after upgrading to the latest Nuget version of UI.for.WinForms.AllControls.Net70" (Version="2023.3.1114") I ran into the following issue when opening the designer :

System.IO.FileNotFoundException: Could not load file or assembly 'System.Runtime.Serialization.Schema, Version=0.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. Le fichier spécifié est introuvable.
                        File name: 'System.Runtime.Serialization.Schema, Version=0.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
                           at System.Reflection.RuntimeAssembly.InternalLoad(AssemblyName assemblyName, StackCrawlMark& stackMark, AssemblyLoadContext assemblyLoadContext, RuntimeAssembly requestingAssembly, Boolean throwOnFileNotFound)
                           at System.Reflection.Assembly.Load(AssemblyName assemblyRef)
                           at Microsoft.DotNet.DesignTools.Server.DesignToolsServer.LoadReferencedAssemblies(AssemblyName[] referencedAssemblyNames, HashSet`1 serverDependenciesNames, CancellationToken cancellationToken)

 

After the designer shows up, every custom user control I'm using on it (based on Telerik controls) completely disappear.

If I make a single change and save the file, I can confirm that all of them are gone, looking at the diff with Git.

I'm wondering if it's a Telerik or a Visual Studio issue, but either way, the result is that I can't work anymore on this project.


Jérôme
Top achievements
Rank 1
Iron
Iron
Iron
 answered on 11 Jan 2024
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
Buttons, RadioButton, CheckBox, etc
DropDownList
ComboBox and ListBox (obsolete as of Q2 2010)
ListView
Chart (obsolete as of Q1 2013)
PageView
MultiColumn ComboBox
TextBox
RichTextEditor
Menu
PropertyGrid
RichTextBox (obsolete as of Q3 2014 SP1)
Panelbar (obsolete as of Q2 2010)
Tabstrip (obsolete as of Q2 2010)
PivotGrid and PivotFieldList
MaskedEditBox
CommandBar
PdfViewer and PdfViewerNavigator
ListControl
Carousel
Diagram, DiagramRibbonBar, DiagramToolBox
Panorama
GanttView
New Product Suggestions
Toolstrip (obsolete as of Q3 2010)
AutoCompleteBox
Label
VirtualGrid
ContextMenu
Spreadsheet
Panel
Visual Studio Extensions
TitleBar
Documentation
SplitContainer
Map
DesktopAlert
ProgressBar
Rotator
TrackBar
MessageBox
CheckedDropDownList
SpinEditor
StatusStrip
CheckedListBox
Wizard
ShapedForm
SyntaxEditor
TextBoxControl
LayoutControl
CollapsiblePanel
Conversational UI, Chat
DateTimePicker
CAB Enabling Kit
TabbedForm
DataEntry
GroupBox
ScrollablePanel
WaitingBar
ImageEditor
ScrollBar
Tools - VSB, Control Spy, Shape Editor
BrowseEditor
DataFilter
ColorDialog
FileDialogs
Gauges (RadialGauge, LinearGauge, BulletGraph)
ApplicationMenu
RangeSelector
CardView
WebCam
BindingNavigator
PopupEditor
RibbonForm
Styling
TaskBoard
Barcode
Callout
ColorBox
PictureBox
VirtualKeyboard
FilterView
Accessibility
DataLayout
NavigationView
ToastNotificationManager
CalculatorDropDown
Localization
TimePicker
ValidationProvider
FontDropDownList
Licensing
BreadCrumb
ButtonTextBox
LocalizationProvider
Dictionary
Overlay
Security
Separator
SparkLine
TreeMap
StepProgressBar
SplashScreen
ToolbarForm
NotifyIcon
Rating
TimeSpanPicker
BarcodeView
Calculator
OfficeNavigationBar
Flyout
TaskbarButton
HeatMap
SlideView
PipsPager
+? more
Top users last month
Dominik
Top achievements
Rank 1
Giuliano
Top achievements
Rank 1
Dominic
Top achievements
Rank 1
Glendys
Top achievements
Rank 1
NoobMaster
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Dominik
Top achievements
Rank 1
Giuliano
Top achievements
Rank 1
Dominic
Top achievements
Rank 1
Glendys
Top achievements
Rank 1
NoobMaster
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?