SIGN UP MEMBER LOGIN:    
ARTICLE

Examples with Message Boxes and a Loop

Posted by brandon Articles | Windows Forms C# March 10, 2009
An example of how to use simple message boxes and a simple loop. Its good for beginers learning how to program realy simple applications
Reader Level:
Download Files:
 

 

This is a simple  example for Windows Form Application. I programmed it to display a small form in the center of the screen like this.

Which makes it look like a updater of sorts for a corporation which if you click on the install button it uses a loop to redisplay a message box like this. 

I used the simple infinite loop: 

private void button1_Click(object sender, EventArgs e)

{

while (true) { MessageBox.Show(" Sorry the file: Application Archiving and Error Help is invalid!\n\n We suggest that you contact Microsoft and report this serious error!"); }

}

 

A warning to you that is an infinite loop meaning if you run that in any thing but the C# debugger you'll have to close it by Pressing and holding Ctrl. + Alt. + Delete, and when the Task Manager shows up, you select the process called NPDR Corp.exe and end it.

I recommend reading Head First C# 

 

Login to add your contents and source code to this article
share this article :
post comment
 
6 Months Free & No Setup Fees ASP.NET Hosting!
Become a Sponsor
PREMIUM SPONSORS
  • Finally – a virtual platform that delivers next-generation Windows Server 2008 Hyper-V virtualization technology from a managed hosting partner you can truly depend on. Visit www.maximumasp.com/max for a FREE 30 day trial. Hurry offer ends soon. Climb aboard the MaxV platform and take advantage of High Availability, Intelligent Monitoring, Recurrent Backups, and Scalability – with no hassle or hidden fees. As a managed hosting partner focused solely on Microsoft technologies since 2000, MaximumASP is uniquely qualified to provide the superior support that our business is built on. Unparalleled expertise with Microsoft technologies lead to working directly with Microsoft as first to offer IIS 7 and SQL 2008 betas in a hosted environment; partnering in the Go Live Program for Hyper-V; and product co-launches built on WS 2008 with Hyper-V technology.
    ceTE software specializes in components for dynamic PDF generation and manipulation. The DynamicPDF™ product line allows you to dynamically generate PDF documents, merge PDF documents and new content to existing PDF documents from within your applications.
Nevron Gauge for SharePoint
Become a Sponsor