Hack Forums
[C#] Converting a theme from VB To C# - Printable Version

+- Hack Forums (https://hackforums.net)
+-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444)
+--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151)
+---- Forum: Software Development (https://hackforums.net/forumdisplay.php?fid=118)
+---- Thread: [C#] Converting a theme from VB To C# (/showthread.php?tid=5622566)

Pages: Pages 1 2


Converting a theme from VB To C# - passwords - May 14, 2017

So I used teleriks converter and fixed a few errors that happend after that but now im down to the last 24 error and I really cant seem to fix them.
Anyone with some free time who wants to help me?
Much appriciated! 🤝




* - passwords - May 14, 2017

Never done it before so not sure how I would do it.


* - w4zt3d - May 14, 2017

^haha true
but w/o dll:
Search up a good decompiler and use their generated code
[Image: a56ab293be.png]
(this is ILSpy)
then you just have to modifly sum stuff (much but ez in my case)
then you have the code w/o the dll in your project
online converters are shit


* - Owl - May 14, 2017

(May 14, 2017 02:07 AM)VEN0M+ Wrote:  Never done it before so not sure how I would do it.

Create a class lib project, make all control classes public (if not already) and build as release. To use, right click the toolbox in your form view then select "choose items" and select the dll you compiled.


* - passwords - May 14, 2017

(May 14, 2017 02:07 AM)w4zt3d Wrote:  ^haha true
but w/o dll:
Search up a good decompiler and use their generated code
[Image: a56ab293be.png]
(this is ILSpy)
then you just have to modifly sum stuff (much but ez in my case)
then you have the code w/o the dll in your project
online converters are shit

But I only have the source code to the theme.


(May 14, 2017 02:15 AM)Orka Wrote:  Create a class lib project, make all control classes public (if not already) and build as release. To use, right click the toolbox in your form view then select "choose items" and select the dll you compiled.

A VB class lib? I tried that and I get like 500 errors haha


* - passwords - May 14, 2017

(May 14, 2017 03:21 AM)Orka Wrote:  He means build a VB app using it and open it in a decompiler where you can select the language (IL, C#, VB).

Yeah I opened it with ILSpy and It's pretty much like a bunch of files, really confused haha


* - Ninja - May 14, 2017

Just compile the VB classes to a library. Create a new Class Library Project in VB.net and add all the control class files to the project, then build it, and you are done.


* - passwords - May 14, 2017

(May 14, 2017 05:22 AM)Ninja Wrote:  Just compile the VB classes to a library. Create a new Class Library Project in VB.net and add all the control class files to the project, then build it, and you are done.

I tried that but when I create a VB library I get like 500 errors again haha


* - Ninja - May 14, 2017

(May 14, 2017 05:50 AM)VEN0M+ Wrote:  I tried that but when I create a VB library I get like 500 errors again haha

Which errors do you get? Can you post a screenshot or your code?
If the theme you have is indeed written in VB.net then you did something wrong. Did you add the files as is or did you open the files and copy the content?


* - passwords - May 14, 2017

(May 14, 2017 06:33 AM)Ninja Wrote:  Which errors do you get? Can you post a screenshot or your code?
If the theme you have is indeed written in VB.net then you did something wrong. Did you add the files as is or did you open the files and copy the content?

https://i.imgur.com/pD3OyWv.png


* - Ninja - May 14, 2017

(May 14, 2017 06:36 AM)VEN0M+ Wrote:  https://i.imgur.com/pD3OyWv.png

Did you copy all the code or just the class? It seems you dont have the correct references. Why didn't you notice that it doesn't recognize things like Graphics and try to hover your mouse over it to see what it says? If you just hover your mouse over the error, the light bulb will appear, and if you click that it will tell you how to fix it...


* - passwords - May 14, 2017

(May 14, 2017 06:39 AM)Ninja Wrote:  Did you copy all the code or just the class? It seems you dont have the correct references. Why didn't you notice that it doesn't recognize things like Graphics and try to hover your mouse over it to see what it says? If you just hover your mouse over the error, the light bulb will appear, and if you click that it will tell you how to fix it...

I tried doing the lighbulb fix already, It just says "Generate property " and what ever I hover over.


* - Ninja - May 14, 2017

(May 14, 2017 06:40 AM)VEN0M+ Wrote:  I tried doing the lighbulb fix already, It just says "Generate property " and what ever I hover over.

So it says Graphics is not found. Graphics comes from System.Drawing as a very simple 2 word Google search tells us. So just add a reference to System.Drawing and then do the light bulb fix.


* - passwords - May 14, 2017

(May 14, 2017 06:43 AM)Ninja Wrote:  So it says Graphics is not found. Graphics comes from System.Drawing as a very simple 2 word Google search tells us. So just add a reference to System.Drawing and then do the light bulb fix.

https://i.imgur.com/3qIimVl.png


* - DevNet - May 14, 2017

(May 14, 2017 06:45 AM)VEN0M+ Wrote:  https://i.imgur.com/3qIimVl.png

You are obviously in way over your head with something this simple. How about you learn (.NET) programming first?