Facebook Sharer
选择您要替换的背景颜色:
【农历新年】背景图片:
个性化设定
 注册  找回密码
查看: 4277|回复: 21
打印 上一主题 下一主题

(分享) Visual c# 教學

[复制链接]

23

主题

0

好友

122

积分

高级会员

Rank: 3Rank: 3Rank: 3

跳转到指定楼层
1#
发表于 2011-6-2 11:30 AM |只看该作者 |倒序浏览
本帖最后由 狂天使 于 2011-6-2 11:36 AM 编辑

最近本人在學C#, 也希望這份文章能幫到想學C#的朋友。

也希望各位大大給些指教哦!

Lesson 1 : Create a windows form and  First Program
Go to http://www.microsoft.com/express/Downloads/ download the visual C# 2010 Express

1)  Click the new project


2) Choose Windows Form Application and Click Ok at the bottom

3) Introduce some basic tools



A) Toolbox: Use to design the Windows Form (Ctrl+W+X)
B) Solution Explorer: Can see the Project u create (Ctrl+W+S)
C) Properties:  Windows form properties (Ex: change font size, Name, size, etc) (Ctrl+W+P)
D) Start Debugging: Use to debug the project you create. (F5)

4) Now start our first program

A) Go to the toolbox -> Common Controls -> Button drag to the form. You can use your mouse  
           resize the button directly or go to Properties->Size to resize your button. The 1st value is width
          2nd value is height.



B) Double Click the button1 on Windows Form. Type this [MessageBox.Show(“Hello World”);] in the
     button_Click. If you want to know more detail of [MessageBox.Show] can surf this link
     http://msdn.microsoft.com/library/default.aspx . [MessageBox.Show] Display a message  
     box .(Simple Explain)



C) Click the Start Debugging(F5), and click the button1 it will appear the MessageBox Hello World. The result will same to above picture.

5) The Project will Store in Document-> Visual Studio 2010 -> Project. You can change your location also, go to File->Save All or CTRL+SHIFT+S.

Name: The Project Name
Location: The location that you store the project.

6) So how to let the project be .exe file (.exe file can directly run the program on the Windows).
1) After saving the project you can go to the Menu Bar Debug->Build Solution (F6) then will  
     generate the .exe file.
2) The .exe file will store in the “Your Project folder”->bin->Debug after generate. Double Click
     the .exe file, it will directly run the program.



END

英文也不是很好,如果Grammar 有錯的話也可以指針我。謝謝各位!




收藏收藏0

33

主题

0

好友

362

积分

超级会员

Rank: 5Rank: 5Rank: 5Rank: 5Rank: 5

2#
发表于 2011-6-2 02:52 PM |只看该作者
加油=]


回复

使用道具 举报

23

主题

0

好友

122

积分

高级会员

Rank: 3Rank: 3Rank: 3

3#
发表于 2011-6-2 07:17 PM |只看该作者
Lesson 2: GUI Design

1) Start the new project Windows Forms Application


2) Design the GUI of the Windows of Application, can use the toolbox to design.


   A) Design the button (Toolbox->Common Control-> button) Click and drag on the windows form
   B)  Design the check box (Toolbox->Common Control-> check box ) Click and drag on the windows form


C) Design the Menu Bar (Toolbox-> Menu & Toolbars -> MenuStrip) Click and drag on the windows form you can type the name you want in the column.


D) Design the Status strip at bottom (Toolbox-> Menu & Toolbars -> Status_Strip) Click and drag on the windows form , have the drop down list after click the status strip button.



END


回复

使用道具 举报

46

主题

6

好友

6456

积分

百变名嘴

Rank: 13Rank: 13Rank: 13Rank: 13

4#
发表于 2011-6-2 07:37 PM |只看该作者
不喜欢 winform, 喜欢 WPF 多一点。 比较接近网页的写法。
用起来比较舒服。


回复

使用道具 举报

7

主题

1

好友

860

积分

青铜长老

Rank: 7Rank: 7Rank: 7Rank: 7Rank: 7Rank: 7Rank: 7

5#
发表于 2011-6-3 05:16 AM |只看该作者
想请问下这个和vb的分别在哪里啊?也是window form的~感觉很相似哦


回复

使用道具 举报

31

主题

0

好友

1228

积分

黄金长老

Rank: 8Rank: 8Rank: 8Rank: 8Rank: 8Rank: 8Rank: 8Rank: 8

6#
发表于 2011-6-3 10:33 AM |只看该作者
不喜欢 winform, 喜欢 WPF 多一点。 比较接近网页的写法。
用起来比较舒服。
宅男-兜着走 发表于 2011-6-2 07:37 PM

给初学者的话,还是 winform 比较适合做教学。


回复

使用道具 举报

31

主题

0

好友

1228

积分

黄金长老

Rank: 8Rank: 8Rank: 8Rank: 8Rank: 8Rank: 8Rank: 8Rank: 8

7#
发表于 2011-6-3 10:35 AM |只看该作者
想请问下这个和vb的分别在哪里啊?也是window form的~感觉很相似哦
Johnlai 发表于 2011-6-3 05:16 AM

其实大同小异的。coding syntax 和一些 built-in library 不同而已。


回复

使用道具 举报

46

主题

6

好友

6456

积分

百变名嘴

Rank: 13Rank: 13Rank: 13Rank: 13

8#
发表于 2011-6-4 12:14 AM |只看该作者
回复 6# ~Zero


    当考虑使用一个技术来做production 的时候, 就要想这些控件, language 适不适合用在你的IDEA 上。
然而我觉得winform 很难下。 不花些时间, 不投点钱买component, 很难作出好的东西。

虽然 drag and drop 是很好

不过他会那么快遗忘一定是有某些原因的。==


回复

使用道具 举报

1

主题

0

好友

10

积分

初级会员

Rank: 1

9#
发表于 2011-6-4 05:03 PM |只看该作者
多谢分享。


回复

使用道具 举报

62

主题

5

好友

3715

积分

本站名嘴

Rank: 11Rank: 11

10#
发表于 2011-6-4 11:11 PM |只看该作者
我用WPF的时候,想要用一些class library,就没有...


回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

JBTALKS.CC |联系我们 |隐私政策 |Share

GMT+8, 2024-10-25 07:34 PM , Processed in 0.112106 second(s), 27 queries .

Powered by Discuz! X2.5

© 2001-2012 Comsenz Inc.

Ultra High-performance Dedicated Server powered by iCore Technology Sdn. Bhd.
Domain Registration | Web Hosting | Email Hosting | Forum Hosting | ECShop Hosting | Dedicated Server | Colocation Services
本论坛言论纯属发表者个人意见,与本论坛立场无关
Copyright © 2003-2012 JBTALKS.CC All Rights Reserved
合作联盟网站:
JBTALKS 马来西亚中文论坛 | JBTALKS我的空间 | ICORE TECHNOLOGY SDN. BHD.
回顶部