System.Windows.Forms Issue
-
Hello, sometimes in programming it without a console application is assembly the compile top it up all the over off the hello world first written sorry for one time the two sentences over top but the problem was encapsulation the "hello world" as is in very standard and common prototype first one to have it: Using Microsoft.VisualBasic; //very unnatural, not natural english using System.Windows.Forms; void MAIN() { Console.WriteLine("Hello World"); //works System.Windows.Forms.WriteLine("Hello World"); //doesn't work }; Explain in your own words how encapsulation would solve this problem.
-
Hello, sometimes in programming it without a console application is assembly the compile top it up all the over off the hello world first written sorry for one time the two sentences over top but the problem was encapsulation the "hello world" as is in very standard and common prototype first one to have it: Using Microsoft.VisualBasic; //very unnatural, not natural english using System.Windows.Forms; void MAIN() { Console.WriteLine("Hello World"); //works System.Windows.Forms.WriteLine("Hello World"); //doesn't work }; Explain in your own words how encapsulation would solve this problem.
Um...the question itself doesn't make a lot of sense - or indeed any - but the code you show also makes no sense either. There is no Forms.WriteLine method, because you can't write directly on a form, and particularly there is no static WriteLine method because unlike a console there can be many Forms in an application. And encapsulation won't solve that. A console app is a special type of application which has a very limited user interface: character input and output only. There is one input stream (the keyboard) and one output stream (the console). And there is some clever software behind the scenes which ensures that the output stream is displayed as readable text. Forms applications aren't like that - they have a much richer user interface made of of Controls like buttons, labels, textboxes, and so on, and there are a number of input methods: keyboard and mouse for starters, but each Control handles it's own input and output. Some may display text (Label and TextBox for example) others may show images without text (a PictureBox perhaps). You can't just "write a line" to a form, you have to decide which control to show it on, and tell it what to display. So I think you need to go back to your course notes, or your book, and read that chapter again - you don't seem to have grasped that the two application types are very, very different and you can't treat them in the same way!
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
-
Hello, sometimes in programming it without a console application is assembly the compile top it up all the over off the hello world first written sorry for one time the two sentences over top but the problem was encapsulation the "hello world" as is in very standard and common prototype first one to have it: Using Microsoft.VisualBasic; //very unnatural, not natural english using System.Windows.Forms; void MAIN() { Console.WriteLine("Hello World"); //works System.Windows.Forms.WriteLine("Hello World"); //doesn't work }; Explain in your own words how encapsulation would solve this problem.
Now, take a deep breath: what you are about to hear is not an insult. Everyone here was a beginner ... once. Your question suggests, to me, that you are very new to programming, and pretty confused about what a Windows Form Application is. A Console Application and a Windows Forms Application are totally different. Yes, a Console is a "window," and it's the only run-time surface/canvas/window the user can interact with. It has a built-in processing loop read-evaluate-print triggered by your hitting the Enter key. A Windows Form Application has (typically, by default) a Main Window, and the programmer can create as many other Windows (Forms) as they wish. Closing the Main Window will close all the other open Forms. Each Form, when it has focus, gets connected to the Windows message-pump that sends it keystrokes, mouse-actions, etc. Which Control on a given Form "receives" these messages will vary depending on the Control, and the context. Sometimes people get confused because in a Windows Forms Application, you can cause text output to be written to the 'Output window in Visual Studio by using code like this: Console.WriteLine("current value: {0}", currentValue); There's a good free book, "DotNet Zero" by Charles Petzold you can download here: [^]. Once you have gotten an initial mastery of the Console Application, I suggest you get a book on Windows Forms; I think the (older, but still good) books by Jesse Liberty and Matthew McDonald are excellent. cheers, Bill
«There is a spectrum, from "clearly desirable behaviour," to "possibly dodgy behavior that still makes some sense," to "clearly undesirable behavior." We try to make the latter into warnings or, better, errors. But stuff that is in the middle category you don’t want to restrict unless there is a clear way to work around it.» Eric Lippert, May 14, 2008
-
Now, take a deep breath: what you are about to hear is not an insult. Everyone here was a beginner ... once. Your question suggests, to me, that you are very new to programming, and pretty confused about what a Windows Form Application is. A Console Application and a Windows Forms Application are totally different. Yes, a Console is a "window," and it's the only run-time surface/canvas/window the user can interact with. It has a built-in processing loop read-evaluate-print triggered by your hitting the Enter key. A Windows Form Application has (typically, by default) a Main Window, and the programmer can create as many other Windows (Forms) as they wish. Closing the Main Window will close all the other open Forms. Each Form, when it has focus, gets connected to the Windows message-pump that sends it keystrokes, mouse-actions, etc. Which Control on a given Form "receives" these messages will vary depending on the Control, and the context. Sometimes people get confused because in a Windows Forms Application, you can cause text output to be written to the 'Output window in Visual Studio by using code like this: Console.WriteLine("current value: {0}", currentValue); There's a good free book, "DotNet Zero" by Charles Petzold you can download here: [^]. Once you have gotten an initial mastery of the Console Application, I suggest you get a book on Windows Forms; I think the (older, but still good) books by Jesse Liberty and Matthew McDonald are excellent. cheers, Bill
«There is a spectrum, from "clearly desirable behaviour," to "possibly dodgy behavior that still makes some sense," to "clearly undesirable behavior." We try to make the latter into warnings or, better, errors. But stuff that is in the middle category you don’t want to restrict unless there is a clear way to work around it.» Eric Lippert, May 14, 2008
So you cannot use the same "words" to write both a console and forms app.. Not only are you forced into the new language C#, but sub languages as well
-
Now, take a deep breath: what you are about to hear is not an insult. Everyone here was a beginner ... once. Your question suggests, to me, that you are very new to programming, and pretty confused about what a Windows Form Application is. A Console Application and a Windows Forms Application are totally different. Yes, a Console is a "window," and it's the only run-time surface/canvas/window the user can interact with. It has a built-in processing loop read-evaluate-print triggered by your hitting the Enter key. A Windows Form Application has (typically, by default) a Main Window, and the programmer can create as many other Windows (Forms) as they wish. Closing the Main Window will close all the other open Forms. Each Form, when it has focus, gets connected to the Windows message-pump that sends it keystrokes, mouse-actions, etc. Which Control on a given Form "receives" these messages will vary depending on the Control, and the context. Sometimes people get confused because in a Windows Forms Application, you can cause text output to be written to the 'Output window in Visual Studio by using code like this: Console.WriteLine("current value: {0}", currentValue); There's a good free book, "DotNet Zero" by Charles Petzold you can download here: [^]. Once you have gotten an initial mastery of the Console Application, I suggest you get a book on Windows Forms; I think the (older, but still good) books by Jesse Liberty and Matthew McDonald are excellent. cheers, Bill
«There is a spectrum, from "clearly desirable behaviour," to "possibly dodgy behavior that still makes some sense," to "clearly undesirable behavior." We try to make the latter into warnings or, better, errors. But stuff that is in the middle category you don’t want to restrict unless there is a clear way to work around it.» Eric Lippert, May 14, 2008
-
So you cannot use the same "words" to write both a console and forms app.. Not only are you forced into the new language C#, but sub languages as well
-
The use of English in the later posts would point at ORT...he has a certain "style". Hopefully, this time he will refrain from the shrooms or whatever (or not post when using them) :sigh:
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
-
So you cannot use the same "words" to write both a console and forms app.. Not only are you forced into the new language C#, but sub languages as well