473,396 Members | 1,738 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Growing line from a point in C#

Hi every one

I have really got stuck in writting a piece of code.I suppose to create a form with a button on it. when ever button is clicked, a line which is stated from a certain point of the form(200,200) should grow upward.
its the code i have written
namespace ConsoleApplication1
{
class Program :Form
{
int x=202;
int y=202;
public Program()
{
this.Size = new Size(400, 400);
this.BackColor = Color.Wheat;
this.StartPosition = FormStartPosition.CenterScreen;
Button b1 = new Button();
this.Controls.Add(b1);
b1.Click+=new EventHandler(b1_Click);


}
protected override void OnPaint(PaintEventArgs e)
{
Graphics g = e.Graphics;
Brush brush = new SolidBrush(Color.Black);
Pen pen = new Pen(brush, 4);
g.DrawLine(pen, 200, 200, 200, 201);


}
protected void b1_Click(object sender, EventArgs e)
{

x = 200;
y = 20;

}


button doesn't work! any suggestions??
Oct 25 '07 #1
1 707
Plater
7,872 Expert 4TB
Please watch the double psoting, your question will be worked on here:
http://www.thescripts.com/forum/thread728274.html
Oct 25 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

41
by: Nitin Bhardwaj | last post by:
Hi all, I wanted to know whether the stack in a C program is growing upwards or downwards.So I wrote a little code to see that.Please guide me as to whether this code is correct in telling this...
1
by: sasachi sachi sachi | last post by:
Hi there, I have a data manipulation process written in a Nested Stored procedure that have four levels deeper. When I run these individual procedures individually they all seems to be fine....
1
by: Ivan Vinogradov | last post by:
Hello All, this seems like a trivial problem, but I just can't find an elegant solution neither by myself, nor with google's help. I'd like to be able to keep an array representing coordinates...
2
by: Suman | last post by:
Happy Friday everyone!!! I am working on a windows service and a C# application and needed some help with certain functionality. Please read through my issue below. Thanks! I have a windows...
4
by: mankolele | last post by:
Hi all I am working on a new project where it has to have a dynanically growing table I guess I am going to have to use loops or two array function . Every time a project is added it must appear in...
1
by: Steve Richter | last post by:
I have a form. In the Form is a MenuStrip and a FlowLayoutPanel. In the FlowLayoutPanel is a ListBox. The FlowLayoutPanel is set to DockStyle.Fill. The ListBox is set to AnchorStyles.Left |...
18
by: shimajavar | last post by:
Hi every one I have really got stuck in writting a piece of code.I suppose to create a form with a button on it. when ever button is clicked, a line which is stated from a certain point of the...
6
by: Burkhard Schultheis | last post by:
I've installed a fresh DB2 V9.1 server (Express-C). Now I see, that the number of applications (db2 list applications) is growing all the times when a script is run which makes some database...
34
by: raylopez99 | last post by:
What is the state of C#? Somebody in a Linux advocacy newsgroup implied it has saturated (leveled off in growth). Note the 'hard code' pre-Wizards coding wizard Charles Petzold does C# only now....
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.