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
Suman Raj
NA
287
13.5k
Add image to button using code in mdi form.
Sep 21 2018 1:17 AM
public void AddMenu()
{
Menus.Add("Database");
Menus.Add("Setting");
Menus.Add("Measure");
Menus.Add("Help");
Menus.Add("About");
int width, height;
width = 60;
height = 60;
int top = 10;
int left = 10;
for (int i = 1; i < Menus.Count; i++)
{
Button button = new Button();
button.Left = left;
button.Top = top;
button.Text = Menus[i];
this.Controls.Add(button);
button.BackColor = Color.RosyBrown;
button.BringToFront();
button.Size = new Size(width, height);
left += button.Height + 25;
button.ImageAlign = ContentAlignment.MiddleCenter;
}
}
//i need to add image for each list item.
example if i add list[1] item then i need to add png image for the button having same list[1] item name which i already added to project by created a resource folder that having images.
Thanks.
Reply
Answers (
1
)
How to use Bundling and minification in MVC?
how to read the application every minute