Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7796511
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T23:23:39+00:00 2026-06-01T23:23:39+00:00

I have created a Datagridview class for processdialogkey(). But Iam getting following errors…Any body

  • 0

I have created a Datagridview class for processdialogkey(). But Iam getting following errors…Any body can help me please…

This code:

//Header File MyDGV.h

    public ref class MyDGV : public DataGridView
    {
    protected:
        virtual bool ProcessDialogKey(System::Windows::Forms::Keys^ keyData) override;
    };

//MyDGV.CPP File
#include "StdAfx.h"
#include "MyDGV.h"

bool MyDGV::ProcessDialogKey(System::Windows::Forms::Keys^ keyData)
{
    Keys^ key = keyData & (System::Windows::Forms::Keys::KeyCode);
    if (key == System::Windows::Forms::Keys::Enter)
    {
        DataGridView::OnKeyDown(gcnew KeyEventArgs(System::Windows::Forms::Keys^ keyData));
        return true;
    }
    else
    {
        return DataGridView::ProcessDialogKey(System::Windows::Forms::Keys^ keyData);
    }
}

Leads to the following error:

Errors:
01. warning C4490: 'override' : incorrect use of override specifier; 'MyDGV::ProcessDialogKey' does not match a base ref class method
02.error C3063: operator '&': all operands must have the same enumeration type
03.error C2275: 'System::Windows::Forms::Keys' : illegal use of this type as an expression
04.error C2275: 'System::Windows::Forms::Keys' : illegal use of this type as an expression
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T23:23:42+00:00Added an answer on June 1, 2026 at 11:23 pm

    System::Windows::Forms::Keys is an enum, and thus a value type (not a reference type). So, to match the signature of the base class method you want to remove the hat (^). In general you shouldn’t be using the hat with a value type except where you truly do want boxing behavior.

    http://msdn.microsoft.com/en-us/library/system.windows.forms.keys.aspx

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created the following C library for reading an image: typedef struct {
I have created a file with XmlDocument xmldoc = new XmlDocument(); Can I make
i have created a simple public ref class in the vc++ project, which is
I have created a class that returns a datatable, when I use the class
I am struggling with the WinForms DataGridView. I have a class, that I use
So I have a datagridview. Normally I can create a bindinglist of my object
I have the following business object: public class MyObject { // Some public properties
I'm having some trouble with VisualStudio 2010 C# Winforms. I have created a DataGridView
I have DataGridView and when I display export to excel sheet button following error
I have created two classes: public class Params : List<Param> { } public class

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.