Extending the Button Class

I'm trying to write a program in Visual C++ .net 2005 beta 2 and it does not have the funtions I need to implement a button to change the rows that are being displayed in a dataset.  The code that should work is
this->BindingContext->Item[JazzPep_MembersDataSet, "Pep Members"]->Position = this->BindingContext->Item[JazzPep_MembersDataSet, "Pep Members"]->Position + 1; but when i use this I get compile errors that say that Item is not a valid class/struc.  It was suggested to me in the Visual C++ section of this forum that I extend the button class ins Visual Basic and then import the assembly throught the CLI.  What im asking here is how would I go about in Visual Basic .Net extending the button class.  I can find no tutorials or information about this topic on google, msdn, or else where any help you can give me would be appreciated.  Also please let me know if this is not the place to ask this I can repost this in the Visual Basic Section if necessary.  Thank you.


Answer this question

Extending the Button Class

  • Leif Olofsson

    How would I go about passing the Dataset name and the table name so i can use the VB functions.  Should I pass them as strings or System properties.
  • Jcking

    I know about the binding navigator I just 1. dont like the way it looks and 2. would like the experience of creating my own extention


  • zenguitar

    Robert,

    The easiest way to accompish your task is to create a custom control (data navigation control - which may use several buttons - next/previous etc...)and add a button(s) to the control.  Once the button is added you can code the events accordingly and then compile the project to be used elsewhere!
    Hope that helps.

  • Andy Green

    I think i figured it out i put the pass in the .click event but when i did i said i couldnt use click so if i name it .clic or something would it fire the event if i keep the click params too

  • polocar

    Pubilc MyFunction (Byval ds as dataset, Byval tb as DataTable) as DataRow
       DoSomething
    ....

    End Function

  • Don Breazeal

    If you want a control to let you navigate a dataset, take a look at the BindingNavigator. It's a new component in .NET 2.0 that behaves like a record selector in Access.

    Here's a little article about BindingNavigator: http://www.computer-consulting.com/bindcollections.htm

  • Nemanja

    So how would I pass the Dataset name and the Table Name as Strings

  • Extending the Button Class