Similar Threads:
1.VS2005 Macro - Event Handles
I'm trying to access Handles from VS2005 Macros.
For now i'm able to access sub definition (EnvDTE80.CodeElement2 cast
to EnvDTE80.CodeFunction2)
but I need to access the "Handles Me.Click" part of the code to remove
it.
Any idea?
VB Code :
Private Sub frmMain_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Me.Click
End Sub
2.Want to raise event from Word macro and handle in C#
I'm working on a Word document which uses MacroButtons. These call VB macros
when the user double-clicks (see the checkboxes in MS's FAX templates for
examples). This is fine, but the rest of my code is in C#, so I'd like to
hand off to a C# handler from the VB Macro (or somehow get the MacroButton to
call the C# code directly). Is there some way to do this?
3.TableNewRow event handling issue
Greetings,
Using VS 2005 SP1; I created a simple form by dragging and dropping a data
table. I changed it to a details view, so I have a mixture of text boxes,
combo boxes and a check box (no dgv). I want to programatically populate the
controls when the user clicks on the Add New button, so I added the following
event handler:
void MyDataTable_TableNewRow(object sender, DataTableNewRowEventArgs e)
{
int nIndex = int.Parse(this.bindingNavigatorPositionItem.Text);
e.Row.BeginEdit();
e.Row["Col0"] =
this.myDataSet.MyDataTable.Rows[nIndex].ItemArray[0].ToString();
e.Row["Col1"] =
this.myDataSet.MyDataTable.Rows[nIndex].ItemArray[1].ToString();
e.Row["Col2"] =
this.myDataSet.MyDataTable.Rows[nIndex].ItemArray[2].ToString();
...etc...
e.Row.EndEdit();
}
This works surprisingly well; the user can select any row and use it as a
template for the new row. I tried to take this a step further; instead of
setting the columns individually, I tried to use the CopyTo function as
follows:
void MyDataTable_TableNewRow(object sender, DataTableNewRowEventArgs e)
{
int nIndex = int.Parse(this.bindingNavigatorPositionItem.Text);
e.Row.BeginEdit();
this.myDataSet.MyDataTable.Rows[nIndex].ItemArray.CopyTo(e.Row.ItemArray,
0);
e.Row.EndEdit();
}
The code seems to execute, but all my controls are blank, like the CopyTo
did nothing; what am I missing here? Shouldn't this work?
--
Regards, Bob
4.multiple event handling issue
when I did this :
Private Sub mydatagrid_MouseDown(ByVal sender As Object, ByVal mouseEvent As
System.Windows.Forms.MouseEventArgs, ByVal keyPressEvent As
System.Windows.Forms.KeyEventArgs) Handles mydatagrid.MouseDown
....
end sub
I got error because it wouldn't allow pass into 2 delegrates? here? But I
wanted to be able pick up both mouse click and key press event in this
subroutine. Could you someone please tell me how do I do going about to get
it to work?
Thanks.
5.Custom Event handling + thread handling.
I've written an event that tells me that I've connected properly to a
remote telnet location. When I know that I'm connected I fire the event
which is being listened for in a bit of code that then goes on and does
some work based on this event.
My problem is that once I fire that event, the thread that fired it
waits until the thread that received it finishes. I fixed the problem
by making the bit of code that is listening for the event continue on
with what it is doing in the background, but I'm wondering if there is a
different way.
Specifically, the code is going through a csv file and then doing a few
things on a remote system to get information based on something in the
csv, and then processing that information once we get it.
Everything works fine, but I'd like to know what I'm doing wrong, in
that I don't think that the thread should be tied up waiting for
whatever was listening for the event to finish.
Any help, or pointing in the right direction is as usual, very much
appreciated.
regards,
M.
6. issue: calling a C# library function (COMInterop) from an excel macro (VBA)
7. issue: calling a C# library function (COMInterop) from an excel macro (VBA)
8. Macro issue. Waiting for Build to be completed