Windows Forms Controls disappearing during design time - controls

I have created a Windows Forms application using C# two join the functionalities of two other Windows Forms applications, in Visual Studio 2019. These two applications have references to some external dlls.
Now I have copy pasted the contents of the two old applications and added the dlls and other references, to the new application. But now, the UI controls are not being displayed during the design time. UI controls are perfectly displayed while running the application.
In Visual Studio 2012 the design file is showing an error, whose image is attached here. This application is for acquiring data from a Raman Spectrometer and do signal processing after that.

Related

DevExpress WinForms / GridControl - Can't open Grid Designer for inherited forms

I've been maintaining a suite of code for my employer for several years, and a new programmer started here recently that I've been training. As described in the subject, the Run Designer feature/button (as seen in screenshot below) isn't available to him for forms that I've overridden and customized. The Grid Designer is essential for modifying the data displayed by the grid. We've spent many days trying to figure this out, so I'm posting it here in case anyone else encounters this issue.
We're using DevExpress 14.1.6 with Visual Studio 2019 [16.11.11] (this pairing isn't officially supported). Both of us are on Windows 10.
Navigate to "DevExpress 14.1\Components\Tools\Components" in your program files. Open the file DXDesignKeys.exe and check both checkboxes (Enable design-time form skinning, and Enable visual inheritance for Developer Express controls used in Visual Studio) in the user interface, then click Apply and Close.

Embedded WPF form not showing within Outlook form region

I have built an VSTO Outlook Add-in which creates customs emails based on some input events. The form region of these emails consist of an embedded WPF form which contains TextBoxes, ListBoxes, ListViews, buttons and things like that.
What happens is that sometimes the embedded WPF form is not displayed within the form region. I say "sometimes" because from my development machine under Visual Studio 2019 and .NET 4.5, it is always correctly rendered and displayed however if I create a new clean virtual machine (no Visual Studio 2019 installed on it), with only Outlook 2019 or 365 installed plus my add-in and .NET Framework, then WPF form is not shown (the form region appears empty/blank).
I have tried to compare differences between the development machine and the clean virtual machine to see if i need to install some type of complement in order to Outlook be able to render the WPF form but I am not be able to discover what is missed. I tried to install Visual Studio 2010 for Office runtime but even with that installed the form region containing the WPF form is not shown.
I don't know if maybe there is some Office key in the registry I must enable in order to make it work. Also I have taken a look at Outlook options to see if there are something to adjust but I haven't seen anything regarding to Outlook render engine.
I have not posted any piece of code here because I think it is not a code related issue since it is working perfectly in my development machine. I think it is something related to Outlook itself.
Any ideas on what can be happening?
It seems you need to modify the add-in installer to include all prerequisites and do the required windows registry modifications. See Deploy an Office solution by using Windows Installer for basics.
As for the form regions, you may find all the required information in the Specifying Form Regions in the Windows Registry article.
Finally I have solved, the problem was that in the deployed machine a key was missing under below path:
HKEY_CURRENT_USER/Software/Microsoft/Office/Outlook/FormRegions

Need to port complex GUI interface projects from RAD Studio to Visual Studio

I'm working for a company which maintain several Desktop application projects written in C++. All of these apps have complex GUI interfaces. What I mean by "complex" is, among others, interfaces with many components, deep component hierarchy, usage of frames, third party and/or custom component packages which support features like transparency and animation.
Until now we always used the Embarcadero RAD Studio suite to write and maintain our apps. However the many recurring bugs of each new version has tired my superiors, and now they are considering the possibility to migrate to Visual Studio.
I think that migrate the application core functions written in c++ will not be a real issue.
However for the GUI it's an other story. I had a previous experience with complex interfaces under the Visual Studio 2003 compiler, and I remember that this was a painful work to create and maintain them. There was no real designer, components were limited, and a huge part of the job was to be done manually. From that I took a look on the designing tools provided with Visual Studio 2017, and my first impression is that not much has changed since. The designer for c++ projects is still so rudimentary, especially in comparison to the RAD Studio VCL, with its well-supplied component library. The C# API is closer than what I need, but I cannot envisage to rewrite all my code in C# as a serious option.
I tried to search tutorials about the good practices to apply in a such situation, but until now I found no helpful info.
My questions are:
Can I recover my current GUI interface, at least a part of it, while I migrate to Visual Studio, or do I have to plan to rewrite everything from scratch?
Does Visual Studio provide a mechanism similar to VCL for composing GUI interfaces, installing third parties packages and writing custom components? And if yes, where can I find relevant info about that?
Is a such port possible without a high dose of headache and tears? Where can I found relevant info about a such process?
I am also currently working on a product which is developed using Embarcadero RAD Studio and some 3rd party UI controls. Development was done many years back, so its UI is quite older style. I tried to migrate it in Visual Studio, by developing application logic in C++ and UI in C#(WPF). But it is as good as writing new application, cost is more. So we discontinued that exercise. However what I learned during this is –
Migrating VCL application from RAD Studio to Visual Studio is like writing new application. There is no one-to-one mapping(data types, stuctures, UI controls etc), you have start from scratch. Also there are no tools available which can help this migration.
Some data types, data structures, UI controls are easily available in RAD Studio, which are not available in Visual C++ (MFC), and vice versa. So you have to review every code line while migrating the application logic.
There are no 3rd party UI controls available for Visual C++(MFC) which can make your life easy. For RAD Studio you have LMD tools, businessSkinForms etc.
After working on RAD Studio over 5+ years, Developing UI is quite easy in RAD Studio (UI in C++). However in Visual Studio you can develop your UI in C#(WPF) which will be rich and can communicate with application logic written in C++.
As you said, you have several desktop applications developed with RAD Studio, while migrating to Visual Studio start with smaller and standalone application. So you will get some confidence during migration of this application and then you can put such migrated small application in production one by one without impact.
~Nilesh

How do I make my ActiveX controls show up on the Toolbox in Visual Studio (and others)

I've written a series of ActiveX controls in Delphi to be used in other development environments (like Visual Studio or dBASE for Windows, as two examples)
I used the ActiveX wizards provided as part of the RAD Studio IDE to generate the ActiveX "bindings" (for want of a better word) for my VCL-based controls, however it appears not to produce the source necessary to make them appear on IDE component pallets.
Ordinarily on those IDEs (Visual Studio and dBASE Plus), I can simply import an ActiveX control and it will show up on their toolbox (their version of a component pallet) complete with their defined icon.
Well, my own ActiveX controls produced in Delphi do not (they import just fine, but don't show up on the pallet/toolbox), and I've been scouring Google trying to find a solution for the last two weeks.
Having failed miserably, I've decided to ask here:
How do I make my ActiveX controls show up on the Toolbox in Visual Studio (and others)?
Thanks for any advice/suggestions.
EDIT: Some extra info...
I've been trying to do this with both XE2 and XE3, and it has failed every time... however, when I do the same thing (using the Wizards) with Delphi 2007, the component's icon does show up in the Pallet/Toolbox of other IDEs as desired.
This means the issue was introduced sometime after Delphi 2007, and is likely the result of some RTL/VCL modification.
My research has concluded that Unicode versions of Delphi (2009 to XE3) do not generate the correct markup for ActiveX Controls using the provided wizards.
Further-more, changes to the RTL and VCL since Delphi 2007 mean that, even if you produce the necessary source markup manually, your controls will not behave properly when embedded in non-Delphi applications (such as Visual Studio and dBASE Plus). Much of this relates to the VCL's presumption of a VCL-compliant Parent property value, where the update of properties such as ParentFont will result in an Access Violation error.
The solution in my case has been to produce the exported ActiveX Controls in Delphi 2007 (with it being the latest version to "play fair" with other ActiveX Control consumers)
Hopefully this information will save you the long and annoying fact-finding process I had to go through in order to come to this conclusion.

Upgrading Compact Framework 1 app from VS 2003 to VS 2005 breaks form designer?

I am trying to move a C# Compact Framework 1 application from Visual Studio 2003 to Visual Studio 2005 (no comments please on how outdated all this is :-)). I am now able to compile and run the app in VS 2005 just fine, however when I open one of the forms, the form designer does not show the actual form layout but just some rows of icons, one for each control on the form. I have no idea why, or how to get back the standard form designer view. Does anybody have any experience with that and any hints or tips?
Well some things changed while going from VS2003 to VS2005 one of those things is the way the form designer adds code to your Form class. It creates a separate .designer.cs class and creates a partial class with the same name as you main form class. All the designer generated code now goes in this background class. This is done so that the form designer generated code stays out of your hair.
Now its plausible that the VS2005 designer no longer recognizes the in-file designer code generated by the previous version. You can try to create a new WinForms project and see how it differs from your current project then make appropriate amends to your current project.

Resources