0

I have a WinForm project that I used DevExpress buttons and labels to create. It turns out that not all devs have a license for DevExpress, so I need to change all references to it to the standard WinForm buttons and labels. The problem is that this is a complex form with over fifty elements on numerous (DevExpress) tabs.

It would be nice an easy to go in and change the DevExpress to the correct Windows buttons, labels and tabs except editing auto generated code just gives VS something to change back to what it wants. However, it sounded like changing Form.Designer.cs may be possible from one of the answers here.

My question is, can I make permanent changes to Form.Designer.cs, or will they be overwritten at some point by VS. If they will be overwritten, is there a simple way to swap out buttons and labels, if I want everything to stay the same except using the WinForm button rather than DevExpress button. Replacing them could work, but I have the tab controls to worry about.

Is my best bet to start a new WinForm, copy the code I wrote, and recreate the design?

Thanks for any suggestions.

Community
  • 1
  • 1
Tim
  • 2,731
  • 9
  • 35
  • 72
  • Visual Studio generates the form based on the contents of the designer.cs file (hence the warning in InitializeComponent). If you replace all of this code (i.e. XtraLabel with Label) then it wont get put back in as Visual Studio will no longer "know" about the underlying controls being DevExpress controls. You'll also have to clean up the Form.cs file as well, removing any references to properties not supported on System.Windows.Forms.Controls.Label for example, and remove the DevExpress references from the project itself. – dash Oct 11 '12 at 20:48
  • Thank you dash. It turns out that it was easier to just copy the code behind, and then recreate the UIs. I found this out after trying to use Find / Replace several times and kept getting errors that were impossible to resolve. Thank you for your assistance. – Tim Oct 19 '12 at 15:51

0 Answers0