TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Maha
NA
0
325.9k
Creating a Button
Sep 21 2014 10:49 PM
Following program is in a book. It is executing. But I couldn't understand the logic because
Text
on the Button should come after creating a Button. Problem is highlighted.
using System;
using System.Windows.Forms;
using System.Drawing;
public class WindowWithButton : Form
{
Button button1 = new Button();
public WindowWithButton()
{
this.Size = new Size(300, 300);
this.Text = "Window Object With Button";
button1.Text = "Press";
this.Controls.AddRange(new System.Windows.Forms.Control[] { this.button1 });
// Creating a Button
this.button1.Location = new Point(100, 50);
}
public static void Main()
{
Application.Run(new WindowWithButton());
}
}
Reply
Answers (
2
)
Spire.Barcode plugin use in ASP.NET
Abstraction