473,797 Members | 3,212 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

C# Override Error

12 New Member
Hi........

My problem is i wrote a program for drawing a line in Csharp.

My code is
using System;
using System.Collecti ons.Generic;
using System.Componen tModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows. Forms;
using System.Drawing. Imaging;
using System.Drawing. Drawing2D;
using System.Collecti ons;


public class TestGDI5 : System.Windows. Forms.Form
{

protected void DrawLineGraph(G raphics g)
{
//base.OnPaint(pe );
//void DrawLineGraph(G raphics g)
{
Pen p = new Pen(graphColor) ;
Point start = (Point)Points[0];
FloatPoint prev, current;
prev = FindLocationOnG raph(start);
for (int i = 1; i < Points.Count; i++)
{
Point pt = (Point)Points[i];
current = FindLocationOnG raph(pt);
g.DrawLine(p, prev.X, prev.Y, current.X, current.Y);
if (bShowPoints)
{
Brush b = new SolidBrush(text Color);
Font f = new Font(Font.FontF amily, Font.Size);
string title = "(" + pt.X + "," + pt.Y + ")";
if (prev.Y > current.Y)
g.DrawString(ti tle, f, b, current.X - 25,
current.Y - 15);
else
g.DrawString(ti tle, f, b,
current.X - 25, current.Y + 5);
if (i == 1)
{
title = "(" + start.X + "," + start.Y + ")";
g.DrawString(ti tle, f, b, prev.X - 10, prev.Y - 15);
}
f.Dispose();
b.Dispose();
}
prev = current;
}
p.Dispose();


}
}
public static void Main()
{
System.Windows. Forms.Applicati on.Run(new TestGDI5());//display form
}

private void InitializeCompo nent()
{
this.SuspendLay out();
// TestGDI5
this.ClientSize = new System.Drawing. Size(292, 266);
this.Name = "TestGDI5";
this.Load += new System.EventHan dler(this.TestG DI5_Load);
this.ResumeLayo ut(false);

}

private void TestGDI5_Load(o bject sender, EventArgs e)
{

}
}

While running this, its giving error orveride problem

The error is

'WindowsApplica tion1.Form1.Dis pose(bool)': no suitable method found to override

What can i do now.


Please help me.


If i run the same program in Console Application it is giving that
graphRegion, graptype,drawax is, drawpoints etc does not exist in the Current.

Thanks.
Sep 8 '07 #1
1 2126
JosAH
11,448 Recognized Expert MVP
You posted your C# question in the C/C++ forum. I'll move your question to the
.NET forum for you.

kind regards,

Jos
Sep 8 '07 #2

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

Similar topics

22
2963
by: Ruben Van Havermaet | last post by:
Hi, I have a problem using member functions in derived classes that override virtual member functions of base classes. The following pieces of (simplified) code don't work. Can anybody give me some hints on what might be wrong? // BEGIN OF SAMPLE CODE class Strategy
1
4742
by: Urs Wigger | last post by:
Hi, In a mangaed C++ wrapper class, I have some pure virtual function declarations: public __gc __abstract class CESCSAPICommand { ...... // Test only virtual bool Test(int i1, int i2) = 0;
5
5919
by: Eric Johannsen | last post by:
I have a simple object that inherits from CollectionBase and overrides the Count property: namespace MyTest { public class CollTest : System.Collections.CollectionBase { public override int Count { get { return 0; }
14
12150
by: JPRoot | last post by:
Hi I use the following syntax to have events inherited from base to child classes which works nicely (virtual and override keyword on events). But I am wondering if it is a "supported" way of using events since I never saw it used anywhere in MSDN documentation/samples?! Or it will just break when I upgrade to .NET Framework 2.x in the coming years namespace MyNamespac public delegate void MyDel() public class MyBase public virtual...
5
2615
by: Mark Broadbent | last post by:
Oh yes its that chestnut again! Ive gone over the following (http://www.yoda.arachsys.com/csharp/faq/ -thanks Jon!) again regarding this subject and performed a few of my own tests. I have two classes yClass which inherits xClass. xClass has a virtual method which simply writes a line of text stating its origin, yClass implements the same method which writes a line of text stating its origin also (i.e. "From yClass"). I ran the...
2
3876
by: Josef Meile | last post by:
Hi, I have this constructor: public CExcelDatabase(string host, string user, string password, string database, bool promptCredentials, int findExcelInstance, bool readOnly) { //Some code comes here
2
4060
by: Adriano Coser | last post by:
Hello. After I converted my .net code to the new VC2005 syntax I started to get C4490 on my ExpandableObjectConverter subclass overrides. The GetProperties method is no longer called by the PropertyGrid when I use my subclass as a type converter. Can anyone tell me what has changed? What's the correct way to override GetProperties method? Here's the code for my class:
52
3500
by: Jim Langston | last post by:
I wanted to do an operator override for but couldnt' figure out the syntax. I tried this (code that doesn't compile commented out with //: class CMyBitmap { public: CMyBitmap( int Rows, int Columns ): Rows_( Rows ), Columns_( Columns ) { Data_ = new SPixel; }
13
3506
by: Ben Voigt | last post by:
Is there any way to have an overridden method which is not callable from the assembly overridding it? A contrived example (though I want this feature, my program has nothing to do with food service): Specifically, how can the DemonstrateConditions method be implemented by GoodEats, so that it can be called by HealthBureau and not by GoodEatsWaiter? Assembly A {
9
1797
by: Ben Voigt | last post by:
Found another variation on my previous bug (https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=100917) I would welcome validation and votes. class ISkewEstimator {
0
9685
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9537
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10469
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10246
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10023
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9066
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5459
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5582
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4135
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.