Jump to content


Photo

[AHKL]C# GUI Converter - Create GUIs with VS GUI Designer!


  • Please log in to reply
10 replies to this topic

#1 fragman

fragman
  • Members
  • 1591 posts

Posted 27 July 2011 - 11:07 PM

As a side result of the OOP GUI library I'm writing I created a converter to create the code generated by the Visual Studio C# window designer into AHK code that is usable with the OOP GUI library. This makes it very comfortable to create windows using said designer. No more guessing positions and sizes and aligning controls manually on a pixel scale :)

It won't convert every possible value but most are covered. Things like list items aren't parsed. If anyone wants to parse those, feel free to change the script and post it here.

The converter makes use of the OOP GUI library itself and the Regex class posted by Frankie. I included the Regex class for convenience, the OOP GUI library is not included because I expect it will change much in the future. You'll need to download it from the other thread.

Download

And two images as visualization:
Posted Image
Posted Image

2011_07_31:Updated to fix an issue with window title.
2011_09_28:Updated the converter to adjust to recent CGUI changes and add new features.


#2 fragman

fragman
  • Members
  • 1591 posts

Posted 28 September 2011 - 09:21 PM

Updated the converter to fit the latest changes in CGUI and added some new features, like supporting controls inside of tabs and groupboxes.

#3 nimda

nimda
  • Members
  • 4307 posts

Posted 28 September 2011 - 09:48 PM

The screenshots are impressive. The one thing I noticed (from the screenshots) is that one button lost its 'default' status.

I will be using this in the future, thanks! :)

#4 fragman

fragman
  • Members
  • 1591 posts

Posted 28 September 2011 - 09:54 PM

Here's another comparison (from an older project I wrote in C#):

Posted Image
Posted Image

#5 zzzooo10

zzzooo10
  • Members
  • 236 posts

Posted 28 September 2011 - 10:42 PM

The download link isn't working for me.

#6 nimda

nimda
  • Members
  • 4307 posts

Posted 29 September 2011 - 12:44 AM

Nor me

#7 fragman mobile

fragman mobile
  • Guests

Posted 29 September 2011 - 06:42 AM

sorry ill fix it later

#8 fragman

fragman
  • Members
  • 1591 posts

Posted 29 September 2011 - 09:46 AM

Fixed.

#9 Scripter

Scripter
  • Members
  • 8 posts

Posted 07 April 2012 - 03:48 PM

Thank you. I will try and play with this sometime today :D

#10 AutoJohn2

AutoJohn2
  • Guests

Posted 10 April 2012 - 05:34 PM

---------------------------
CSharpGuiConverter.ahk
---------------------------
Error at line 6 in #include file "C:\Users\Username\Desktop\Lib\Regex.ahk".

Line Text: var Needle := "."
Error: Expected assignment or class/method definition.

The program will exit.
---------------------------
OK
---------------------------

Why am I getting this error when trying to run your script?

#11 fragman

fragman
  • Members
  • 1591 posts

Posted 10 April 2012 - 06:21 PM

It looks like the Regex.ahk file was written for an outdated version of AHK_L. Simply remove the "var" at the specific (and other) line(s).
I'll fix it ASAP.