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.
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.
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
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
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.
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
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.
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.
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
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.