Visual Studio 2013中C#下的Windows Form Application结构问题

MSB4011 2014-09-30 11:48:43
今天刚注册的CSDN号,来冒个泡先~
言归正传,我是属于刚学习Windows Forms Application,老师教来教去只是在说event handler应该怎么写,有哪些控件可以用,但是具体由VS2013自动生成的代码却一直没有涉及,我自己尝试去理解整个程序的结构,也因为知识水平有限遇到了很多问题, 所以想在这里找大侠们请教下,问得比较基础还请见谅。。。

我自己建立了一个名叫WindowsAppStartLearning的Form App, 里面除了加了一个Name为button1的button控件,其余什么都没干,应用具体包含的文件如下图:


第一个问题:
从目录看,这个App主入口程勋应该是在文件Program.cs下,以下是该文件内的代码:

可是从代码里面看,其只是在namespace WindowsAppStartLearning下定义了一个Program的类,而这个入口函数只是这个类中的一个成员,代码中并没有用这个类定义一个对象,而我之前接触的类的操作都是要定义一个实体对象才可以调用该类中定义的其他成员,因此这个入口函数到底是怎么调用的呢?

【因为要赶飞机,先问这一个问题。。。】
...全文
494 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
MSB4011 2014-10-04
  • 打赏
  • 举报
回复
引用 2 楼 liuxiaoyi666 的回复:
系统接口,static不需要声明实例 这个跟之前的c语言 c++的main是一致的
找到了个帖子,貌似就是在说这个问题 http://blog.csdn.net/yueruu/article/details/6309181
MSB4011 2014-10-04
  • 打赏
  • 举报
回复
引用 1 楼 u011836122 的回复:
应用程序入口点,看到static了吗,static不用创建对象。 Application.Run进入事件循环,也就是保持你的主窗口处于运行状态。
我对static class不是很了解,只是在之前学过static的一些用法,比如static int定义的局部变量在function运行结束后不会被清空。。。
  • 打赏
  • 举报
回复
系统接口,static不需要声明实例 这个跟之前的c语言 c++的main是一致的
程序员鼓励师 2014-10-03
  • 打赏
  • 举报
回复
漫舞云中影 2014-09-30
  • 打赏
  • 举报
回复
应用程序入口点,看到static了吗,static不用创建对象。 Application.Run进入事件循环,也就是保持你的主窗口处于运行状态。
800+ pages of top-notch coverage; perfect for learning the fundamentals of C#! C# is a complex programming language for building .NET-connected software for Microsoft Windows, cloud computing, the Web, and a wide range of devices. Today’s developers use it to develop Azure and Windows Phone apps, and Android applications using Mono. Novice programmers can get up and running quickly on C# using this practical guide. Crammed with 800+ pages of information, this all-in-one book helps you quickly create a C# program while learning C# and object-oriented programming fundamentals, Windows and Windows phone programming, and more. Helps novice programmers learn C# programming and create their first C# program Explains how to create Windows applications with C# and Visual Studio Delves into Windows Phone programming, as well as object-oriented programming basics Covers debugging, errors, comparisons with C++ and Java, classes and arrays, variables, and more Includes access to a companion website with sample code and bonus materials Everything you need to make the move to C# programming is right here, in C# 2012 All-in-One For Dummies. From the Back Cover 7 books in 1 C# Programming Basics Object-Oriented C# Programming Designing for C# A Tour of Visual Studio® Windows Development with WPF Web Development with ASP.NET Service-Oriented Development C# developers, here’s your one-stop guide to using this powerful programming language! C# has grown up. It’s a powerful language and fun to use, and this book takes you beyond the basics with discussions of Visual Studio, Windows Presentation Foundation, service-oriented development, web development, and a lot more. You’ll go beyond just learning the language to discover all the things you can do with C#. Ready? Let’s get started! For the newcomer — if you’ve never programmed in C#, learn all the essentials in the first two minibooks Delve into design — discover the key elements of databases, files, and graphics and how to design for security Valuable Visual Studio — explore the use, optimization, and customization of this popular tool for building graphical user interfaces Look ahead — learn about Windows Presentation Foundation, widely expected to be the Windows development tool of tomorrow A range of services — gain information on various web services such as ASP.NET, WCF, and REST Open the book and find: Steps for creating a C# program New capabilities of C# 5.0 An introduction to object-oriented programming Important advice on writing secure code Alternatives to using Visual Studio Why Windows Presentation Foundation is the wave of the future ASP.NET application creation and form control Different tools for web services Book Details Paperback: 840 pages Publisher: For Dummies; 1 edition (January 29, 2013) Language: English ISBN-10: 1118385365 ISBN-13: 978-1118385364

18,124

社区成员

发帖
与我相关
我的任务
社区描述
Windows客户端使用相关问题交流社区
社区管理员
  • Windows客户端使用社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧