dcsimg
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4

Thread: [RESOLVED] Datagridview Class VS 2010 working but not working in VS2015

  1. #1
    Join Date
    Dec 2011
    Posts
    64

    [RESOLVED] Datagridview Class VS 2010 working but not working in VS2015

    Hi, Iam using VS2015. Before I used VS2010. For Dynamic DataGridView to ProcessDialogKey , I write the following code works well in VC++ 2010 Windows forms. Now I wish to use that class, but not working.
    Receiving the error message 'Failed to load toolbox item MyDataGrid. It will be removed from the toolbox'.
    Thanks for the helps.

    My codes:
    Code:
    MyDataGrid.h
    using namespace System;
    using namespace System::Windows::Forms;
    #pragma once
    public ref class MyDataGrid : DataGridView
    {
    protected:
     virtual bool ProcessDialogKey(Keys keyData) override;
    };
    
    
    MyDataGrid.cpp
    
    #include "StdAfx.h"
    #include "MyDataGrid.h"
    using namespace System;
    using namespace System::Windows::Forms;
    bool MyDataGrid::ProcessDialogKey(Keys keyData) {
     Keys key = keyData & (System::Windows::Forms::Keys::KeyCode);
     if (key == System::Windows::Forms::Keys::Enter) {
      DataGridView::OnKeyDown(gcnew KeyEventArgs(keyData));
      return true;
     }
     else {
      return DataGridView::ProcessDialogKey(keyData);
     }
    }
    
    stdafx.h
    
    #pragma once
    
    stdafx.cpp
    
    #include "stdafx.h"
    Thank for the kind helps

  2. #2
    VictorN's Avatar
    VictorN is online now Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    19,229

    Re: Datagridview Class VS 2010 working but not working in VS2015

    Did you try some of the ways suggested in https://stackoverflow.com/questions/...om-the-toolbox
    Victor Nijegorodov

  3. #3
    Join Date
    Dec 2011
    Posts
    64

    Re: [RESOLVED] Datagridview Class VS 2010 working but not working in VS2015

    Really Thank to god, while we get this Victor & Eric to help the persons like me. My heartiest thanks

  4. #4
    VictorN's Avatar
    VictorN is online now Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    19,229

    Re: [RESOLVED] Datagridview Class VS 2010 working but not working in VS2015

    You are welcome!
    Victor Nijegorodov

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width




On-Demand Webinars (sponsored)