W
Wingot
Hey,
I am using Visual Studio 2008 Beta 2 for some application development in
C#, but I presume that the following question applies equally well to
any environment.
I have created some data entry forms for customer details, transactions,
etc. What I would like to do is make it so that the buttons across the
top right of the BindingNavigator (New, Delete, Save, respectively) were
mapped to the function keys F2-F4. I have tried searching on the web for
how to use function keys in C# (or Visual C#), but couldn't find much
that made any sense.
Another flow on from this problem is that when I take a look at the
source code, the method that saves the details is expecting various
arguments from the click event I believe, but if I call this method from
a function key or another button on the form, these arguments would not
be available. What would be the best way to call the saving method
(which has not been changed from the default) from within another
method. I would prefer not to replicate the code within the function so
as to avoid redundancy and potential later errors. The code for the save
method looks like this (bear in mind that this case uses the
NorthwindDataSet, not my real dataset, as this is a replication of the
issue due to NDA problems):
private void productsBindingNavigatorSaveItem_Click(object
sender, EventArgs e)
{
this.Validate();
this.productsBindingSource.EndEdit();
this.tableAdapterManager.UpdateAll(this.northwindDataSet);
}
Regards,
Adrian Pavone
Applications & Technical Engineer
CVW Group
I am using Visual Studio 2008 Beta 2 for some application development in
C#, but I presume that the following question applies equally well to
any environment.
I have created some data entry forms for customer details, transactions,
etc. What I would like to do is make it so that the buttons across the
top right of the BindingNavigator (New, Delete, Save, respectively) were
mapped to the function keys F2-F4. I have tried searching on the web for
how to use function keys in C# (or Visual C#), but couldn't find much
that made any sense.
Another flow on from this problem is that when I take a look at the
source code, the method that saves the details is expecting various
arguments from the click event I believe, but if I call this method from
a function key or another button on the form, these arguments would not
be available. What would be the best way to call the saving method
(which has not been changed from the default) from within another
method. I would prefer not to replicate the code within the function so
as to avoid redundancy and potential later errors. The code for the save
method looks like this (bear in mind that this case uses the
NorthwindDataSet, not my real dataset, as this is a replication of the
issue due to NDA problems):
private void productsBindingNavigatorSaveItem_Click(object
sender, EventArgs e)
{
this.Validate();
this.productsBindingSource.EndEdit();
this.tableAdapterManager.UpdateAll(this.northwindDataSet);
}
Regards,
Adrian Pavone
Applications & Technical Engineer
CVW Group