我正在使用 Microsoft Visual Studio Windows 窗体,我想知道我可以添加按钮或获取图片吗
我正在制作我需要帮助的项目,首先我想知道如何在头文件、主文件和 winform 应用程序之间进行管理,我必须在哪里添加我的 oop 代码。 其次,在我的项目中,我需要根据我提供给它的信息在运行时更改按钮的显示图像(如果我说 int n=1,那么它应该显示第一张图片,但如果我说 n=2应显示第二张图像)。请注意,我已经找到了如何添加多个图像,但在运行时更改它并不是我解决的问题。 我将非常感谢您的回答。
提前致谢。
I am making my project in which I need help that, first I want to know that how I can manage between the files that is the header one, main and winform application, where do I have to add my oop code.
Secondly in my project I need to change the display image of my buttons at run time according to information I am providing to it, (if I say int n=1, then it should display the first picture but if I say n=2 it should display the second image). Note that I have found how to add multiple images, but changing it at the run time is not solving by me.
I would be highly grateful for the answers.
Thanks in Advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
你问了很多问题。你需要确保你了解 C#,你可以在 SO 上找到很多书籍推荐等。然后学习Windows窗体开发。
我建议您阅读 Charles Petzold 的《Programming Windows Forms》。有关语言的一些内容可能会发生变化,但 Windows 窗体框架自 2005 年以来并没有太大变化。您还可以获得 Visual C# 2010 分步,为初学者提供有关 .NET 4 中所有功能/选项的概述。
以下是一些链接:
MSDN:Windows 窗体入门
请参阅此演练以创建简单的计算器应用程序
其中有一些稍微高级的内容您稍后可以观看此处的视频:
http://windowsclient.net/learn/videos.aspx
希望有帮助。
You are asking a number of questions. You need to make sure you know C#, there are lots of book recommendations etc you will find on SO. Then learn about windows forms development.
I would recommend getting Programming Windows Forms by Charles Petzold.. A few things about the language may have changes but the windows forms framework hasn't changed much since 2005. You could also get Visual C# 2010 Step by Step for a more beginners overview on all features/options in .NET 4.
Here are some links:
MSDN : Getting Started with Windows Forms
See this walkthrough for creating a simple calculator application
There are some slightly advanced videos here you can watch later:
http://windowsclient.net/learn/videos.aspx
Hope it helps.