Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Error on WinForms Designer view when attempting to use custom layout (Read 1788 times)
Dan the Coder
YaBB Newbies
*
Offline


.NET and JS Dev

Posts: 6
Joined: Dec 18th, 2019
Error on WinForms Designer view when attempting to use custom layout
Feb 12th, 2020 at 3:03pm
Print Post  
I am looking to extend some additional functionality to the Winforms virtual keyboard, so I am creating a custom UserControl which contains the VirtualKeyboard. In this UserControl I am setting a LayoutsFolder and custom layout with the code below:

Code
Select All
public CulturedKeyboard()
        {
            InitializeComponent();
            virtualKeyboard.LayoutsFolder = "\\Keyboard\\Layouts";
            virtualKeyboard.TemplateLayout = KeyboardLayout.Create("englishLayout.xml");
        }
 



When I place this new UserControl onto a Form for use, the Designer View shows an error message "Could not find a part of the path 'C:\Keyboard\Layouts\englishLayout.xml'. "  How can I call this layout correctly? It is not showing the VirtualKeyboard control with the custom layout in the UserControl or on the Form and even when loading the application I receive an error. Thanks!
  
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3248
Joined: Oct 19th, 2005
Re: Error on WinForms Designer view when attempting to use custom layout
Reply #1 - Feb 12th, 2020 at 3:43pm
Print Post  
Files from LayoutsFolder are loaded automatically when Mode is set to Custom and file name from the folder matches current language id (based on the number in file name added by keyboard creator). Other than that, the LayoutsFolder path is not prepended automatically to names you pass to KeyboardLayout.Create method, so the error message you cite should happen only if that's also your process' current directory I guess. If you will be loading only that specific englishLayout file, forget about LayoutsFolder and just call KeyboardLayout.Create passing full path to the file.

Regards,
Slavcho
Mindfusion
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint