Wrox Programmer Forums
Go Back   Wrox Programmer Forums > C# and C > C# 2005 > C# 2005
|
C# 2005 For discussion of Visual C# 2005.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C# 2005 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 4th, 2006, 12:45 PM
Registered User
 
Join Date: Apr 2006
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default How to draw a point to the form in visual c# 2005?

Im using visual c# 2005
I want to be able to draw a one pixel big point at an (x, y) location (in pixels) onto the form and also be able to choose the colour of the point.
I used to use visual basic and in this it was

Code:
pset(x, y), rgb(r, g, b)
r meaning red
g meaning green
b meaning blue
 
Old April 4th, 2006, 02:52 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 440
Thanks: 0
Thanked 0 Times in 0 Posts
Default

One way is to override the OnPaint method of the Form like this...
Code:
protected override void OnPaint(PaintEventArgs e)
{
    e.Graphics.DrawEllipse(Pens.Blue, 5, 5, 1, 1);
    base.OnPaint (e);
}
Hope it helps, Jacob.





Similar Threads
Thread Thread Starter Forum Replies Last Post
draw line at form tyh Word VBA 0 December 7th, 2007 03:14 AM
Hiding of TitleBar of child form in Visual C# 2005 suneet.pant Visual Studio 2005 0 July 27th, 2007 12:49 AM
FTP in Visual Studio 2005 Pro (Visual Basic) shoopes VB How-To 1 June 29th, 2006 02:08 PM
How do I paint a point onto th form alan2here Visual C++ 2005 0 April 4th, 2006 01:42 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.