Click here to Skip to main content
15,889,034 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
hey guys,

please don't reply to me saying that this is a very big job and i won't be able to do it, because i know exactly what i'm getting in to. I want to be able to type in some code to a window, like a programming language(don't worry, i know how to make programming langauges) and the code will run when you execute the code, like java. The problem is, i don't know how to make windows forms out of console applications. if i want to type in something like:

new form


then i want it to make a new windows form, just a blank one and i will decide the default values like size. how will i be able to do this. I am making this programming language out of a C# Console Application. Can you please help me out?

thanks in advance :)
Posted
Comments
Legor 14-Sep-12 4:33am    
How is the Question title related to this?
Member 8378691 14-Sep-12 4:36am    
didn't i say? soz, i want to make this programming language like Java where you just type in the code and it runs the program. but i am also going to make it so that you are able to make games out of this language.
Richard MacCutchan 14-Sep-12 4:48am    
Given the fact that you do not know how to create a basic Windows Forms program I think this task is way beyond your capabilities.
Member 8378691 14-Sep-12 4:55am    
i know how to make a basic windows forms program, i just need to know this: if i execute the code 'new form' using a console application, how can i run a windows form?
Richard MacCutchan 14-Sep-12 5:08am    
The same way you run any program. You either type the name of the program in a command window, double click it in Windows Explorer or use the Process class.

Try:
C#
MyForm mf =  new MyForm();
if (mf.ShowDialog() == DialogResult.OK)
   {
   ...
   }


But to be brutally honest, as Richard says, if you can't do that, you have an enormous amount to learn before you can even begin to start on this project.

You would be much, much better off getting a book on C# for Windows, and reading it first, doing each an every exercise as you go. I fear that you will end up missing far too much and the final product will be a horrible mess as a result.
 
Share this answer
 
Comments
Member 8378691 14-Sep-12 5:05am    
first, i look at this code and it looks like that you type this code into a windows form application. i want some code that you type into a windows console application and it makes a windows form. and secondly, i make very complex programming languages, i know what i am getting into.
OriginalGriff 14-Sep-12 5:10am    
No you don't!

Not if you think you can mix and match Console and forms like that...
Oh dear, oh dear, oh dear...
Member 8378691 14-Sep-12 5:12am    
it can be done, there is a guy on youtube called 'gruntlover2', search him up. There is a video that he posted where he shows you that he has made a programming language in a console application and with it, he makes a web browser, and he is turning 15 this year! if anyone could do it, i thought that you would know how.
OriginalGriff 14-Sep-12 5:16am    
I know it can be done, but trust me, if you can't do it, then you really need to learn before you go ahead.
Member 8378691 14-Sep-12 5:22am    
well if i could do it, then why would i be here? if i could do it, then i would be programming right now making the programming language and test games. The reason that i am here is because i don't know how to do it.
If you know (as you state) how to make programming languages, then you have the solution in your hands. Make a parser to recognize the 'new form' statement (and other statements you aim to support) and translate it to commands for a (possibly hidden) Windows Form application.
 
Share this answer
 
Comments
Member 8378691 14-Sep-12 5:15am    
the thing is, i can make visual programs, i can make console programs, but i have trouble to mix them. Do you know how to make a windows forms using a console application?
CPallini 14-Sep-12 5:22am    
You could use just one Windows Forms application (e.g. using an Edit Box as 'console').
On the other hand, if you really need the console application then use a IPC mechanism to make it communicate with the Windows Forms one (see, for instance http://www.codeproject.com/Articles/34073/Inter-Process-Communication-IPC-Introduction-and-S )

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900