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
George Loveless
NA
13
0
Can't draw line on win form.
Mar 20 2009 10:45 PM
For some reason my line wont draw on my windows form. If I place the code in a button event routine it works fine but it won't work when the window loads. I'm really confused! thanks:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace testForm
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
public void Form1_Load(object sender, EventArgs e)
{
Pen myPen = new Pen(Color.Red);
Graphics g = this.CreateGraphics();
g.DrawLine(myPen, 20, 30, 10, 50);
//this.Refresh(); //doesn't work if I add this.
}
}
}
Reply
Answers (
3
)
VB Express using SQLite DataBase or Text Files
How do I make an C# executable work on another computer?