Windows Develop Bookmark and Share   
 index > Windows Forms General > Develop web-like application using Windows Forms?
 

Develop web-like application using Windows Forms?

I have read a number of blogs, posts, etc. on whether or not to do this as a Windows Forms application or as a WPF application. It seems that the consensus is for WPF.

It seems that people agree that to develop web-like windows forms applications are difficult at best.

Having said that, I develop unmanaged C++ console apps and C# web services, with no experience (or very little) in any GUI development. So either way the learning curve will be steep for me. Any psots I found on here related to this are over my head.

I have VS 2005 installed so I am leaning against WPF asit would require that Iinstall VS2008 in another dev environment.

My question is does someone know of clear examples, downloadable code samples,or tutorials (pref. C#) on how to do develop a windows form app that behaves like a web app?

Additional info: The application I want to develop is fairly simple in concept. Depending on thefile layout/format (like a NACHA file) that they wish to process, it will require them to fill in a number of parameters (varies by file format). The app will then read the source file(s) that they've selected and with the parameters they entered, will create a specific format flat file. Also, I do not want to develop this as a web app for a number of reasons.

Thanks.
can_thing_beat_hulk  Friday, September 11, 2009 6:26 PM
It makes zero sense to make a WF app look like a web app. Without the slow HTTP server, you can implement an interactive UI that's far richer than a web app. And a lot easier to get going too. If you want a web app then use ASP.NET.

Hans Passant.
nobugz  Friday, September 11, 2009 7:12 PM
Also, given the description of what you want to do, I don't see why you have the "requirement" that this behave/look like a web app? Can you tell us what's the point of that "requirement"?
~~Bonnie Berent [C# MVP]
BonnieB  Saturday, September 12, 2009 12:34 AM
Hi can_thing_beat_hulk,

I have the same doubt about your post. Does your user require that kind of application? If you have any special reason, please feel free to tell me.

The advantage of Winform application is it offers richer user experience than Web app. But the disadvantage of it is not easy to deployment compare to web app. Once people deploy Web app, it doesn't need to be installed onto users desktop. It can be launched via web browser easily.

If you want to have that easy deployment feature for your winform app, you can consider ClickOnce as an option. Here is the MSDN document.
http://msdn.microsoft.com/en-us/library/142dbbz4%28VS.80%29.aspx
You can deploy your winform app via Internet with ClickOnce technology. Then your user can follow a link to the publish page to install your application easily.

>My question is does someone know of clear examples, downloadable code samples, or tutorials (pref. C#) on how to do develop a windows form app that behaves like a web app?

Winform app's UI appearance is quite different from Web app. So I don't think there is some sample show Web like winform app.

As for the WPF, if you really want to do the work in WPF, I recommend you to use VS2008. WPF feature has been added to the .NET since version 3.0. That mean VS2008 can give you full WPF experience.

If you have anything unclear, please feel free to tell me.

Sincerely,
Kira Qian
Send us any feedback you have about the help from MSFT at fbmsdn@microsoft.com.
Please remember to mark the replies as answers if they help and unmark them if they provide no help. Welcome to the All-In-One Code Framework!
Kira Qian  Monday, September 14, 2009 7:10 AM

Kira,

The 'requirement' is mine. Thiswould be a tool that will be used internally within our company and at least initially by developers. I had no plans to deploy/install it as though it were a 3rd party package. The EXE would be available where the other developers would just double-click it to use it. They would have the same program dependencies installed on their pcs as is on mine.

The main reason I was going down the web-like road was just a preference on my part for liking the "feel" of the way web forms function. Neither the SDI nor MDI model seem to make sense for what I want to do or at least from the samples I looked at. And some of this is just a lack of understanding how to make the forms flow/navigate.I have no company-owned code to look at as examples - we have no GUI apps. that we've developed here. That would obviously be helpful.

I've looked on my own (before posting this) at various sites/code samples for WinForms and haven't really seen anything that would be a good "template" to follow. If you can guide me to some links/code samples for a "standard" WinForm app, I would certainly take a closer look at it.

Otherwise, it seems I will need to go the WPF route.

Thanks. Jeff

can_thing_beat_hulk  Monday, September 14, 2009 1:14 PM
Jeff,

It sounds to me like you have very simple requirements ... one Form with a List of files displayed (probably in a ListView)and a few TextBoxes. I'm certain that a simple WinForm app will do quite nicely and WPF would be overkill ... unless you just want to learn WPF. ;0)

Take a look at CodeProject ... (http://www.codeproject.com) ... I did a quick search for stuff you might be interested in (http://www.codeproject.com/KB/dialog/index.aspx#Dialog%20&%20Windows%20-%20General), perhaps "Getting User Input With Dialogs" (http://www.codeproject.com/KB/dialog/UI_dialogs1.aspx) might be a good one to start with. But browse around yourself. You'll find interesting stuff.
~~Bonnie Berent [C# MVP]
BonnieB  Monday, September 14, 2009 3:32 PM
Bonnie,
I will take a look at the links you provided on CodeProject. But one of the questions in regards to WinForms programmingI have is how much data to put on one form (so its not too busy) andhow to create/navigate back and forth between forms if I have to put the questions on mult forms. I will be able to group a number of the questions/items in GroupBoxes, etc.but am certain I will not be able to have everything displayed on one form.

Conceptually, I'm thinking it's like filling out income tax forms on the web, they gather name, address, etc. on one form, then you navigate to an income form, etc., etc.

Thanks. Jeff
can_thing_beat_hulk  Monday, September 14, 2009 5:39 PM
Jeff,

Take a look at Tab Controls and Tab Pages. That may be an easy way to accomplish what you want (basically then, all your data would be controlled by one Form, but it would be displayed across several Tab Pages).

Also, take a look at this thread http://social.msdn.microsoft.com/Forums/en-US/winforms/thread/c290832f-3b84-4200-aa4a-7a5dc4b8b5bb... nobugz talks about an interesting way to use a Tab Control.
~~Bonnie Berent [C# MVP]
BonnieB  Tuesday, September 15, 2009 4:37 AM
Take a look at Tab Controls and Tab Pages. That may be an easy way to accomplish what you want (basically then, all your data would be controlled by one Form, but it would be displayed across several Tab Pages).

Also, take a look at this thread http://social.msdn.microsoft.com/Forums/en-US/winforms/thread/c290832f-3b84-4200-aa4a-7a5dc4b8b5bb ... nobugz talks about an interesting way to use a Tab Control.
~~Bonnie Berent [C# MVP]

Hi Jeff,

Bonnie Berent's suggestion is a good choice for your requirement.

Based on my understanding, the application will have a lot of controls for user information input purpose. You want users to input something then move to the next step. Put all these controls on just one form is impossible. So you think of making a "Back" and "Forth" function(Like IE) to navigate to different pages instead of multi-forms. That's the reason why you want a web like style. Am I understand right? If so, you can give TabControl a try.

Here is a sample for TabControl
http://www.c-sharpcorner.com/UploadFile/mahesh/TabControlTutorial11302005235835PM/TabControlTutorial.aspx

Hope that is what you are looking for. If you have any further need, please feel free to tell me.

Sincerely,
Kira Qian
Send us any feedback you have about the help from MSFT at fbmsdn@microsoft.com
Please remember to mark the replies as answers if they help and unmark them if they provide no help. Welcome to the All-In-One Code Framework!
Kira Qian  Tuesday, September 15, 2009 8:46 AM
Hi Jeff,

I am writing to check the status of the issue on your side. Could you please let me know if the suggestion works for you? If you have any questions or concerns, please feel free to let me know. I will be more than happy to be of assistance.

Sincerely,
Kira Qian
Send us any feedback you have about the help from MSFT at EMAIL REMOVED
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
Welcome to the All-In-One Code Framework!
Kira Qian  Tuesday, October 06, 2009 8:59 AM
Hi Kira,

I looked at the links, but ended up just using the TabControl in a standard use.  I tried getting it to behave the way I wanted and was too much hassle.  Others have stated the same issue I have with it, the show/hide is for the entire control, not the individual tabs.  The solution I am working on will have to do until I can get into WPF.

Thanks for following up.  Jeff
can_thing_beat_hulk  Wednesday, October 07, 2009 12:01 PM
Having read all that, its easy to conclude that the concept of WinForms just eludes you.

Try "looking" at other aplications more closely. Most people never do that, analyze how each application GUI is built.

For instance take a look at standard windows apps, like Internet Explorer, Notepad, Wordpad, Paint, on to more complex like Office, or Visual Studio, and any other, see how the Menus are organized, where the Main area is, how each application adresses the navigation. You have tons of examples on your computer alone.

Then look at WinForms controls that come with .NET analyze how each is presented visually and then construct your idea of a GUI.

Also there are 3rd party component developers, that extend the use of WinForms GUI tenfold.

Trying to make a winforms app like a web app is like trying to get a car to behave like a bicycle.

VB.NET to C# http://www.developerfusion.com/tools/convert/vb-to-csharp/
Se3ker385  Wednesday, October 07, 2009 12:49 PM

You can use google to search for other answers

Custom Search

More Threads

• Validation Problem
• Resize a selected item in a custom MultiLineListBox
• datagridview current cell
• setting textbox text onto a child Form
• I want to display duplicate rows in a list view control in C#.net when we are sending the data from excel to database
• how to create bitmap area for group box or like frame like controls ,
• How can i find the user?
• DrawString problem
• MDI Child Problem
• Issues with GDI+ and Citrix?