Search results for query: *

  1. A

    Resolved Remove Click Event Handler

    It's ok to remove if Addhandler was used? EDIT: Added I just found the RemoveHandler statment - So it's OK to remove. Thanks
  2. A

    Resolved Remove Click Event Handler

    Sometimes with AddHandler but this one by adding Handles to a method. Your question makes me wonder if the two methods have different effects.
  3. A

    Resolved Remove Click Event Handler

    I want to be able to remove an event handler from a component. I tried a couple of things includeing the code below but can't get it to work. Or maybe it is working but my checking is faulty. Private mDelegateSaveBitmap As New System.EventHandler(AddressOf...
  4. A

    Resolved Shared Methods

    Thanks, I needed that to be sure of myself. There is the word Static in BindingFlags.Static which I assume does what BindingFlags.Shared would be expected do if that existed
  5. A

    Resolved Shared Methods

    Imports System.Reflection Imports System.ComponentModel Partial Public Class Form1 Inherits Form Public Sub New() InitializeComponent() AddHandler button1.Click, AddressOf button1_Click AddHandler button1.Click, AddressOf button1_Click2...
  6. A

    Resolved Obtain the event handlers of a given ToolStripMenuItem

    Before I posted I saw much code on the internet to do what you did . They all used ClickEvent or EventClick or somethig like that and when I ran the code the GetField always returned Nothing. I wish I knew how you found s_clickEvent. Suppose I'm interested in a SelectionChange event. Is it...
  7. A

    Resolved Obtain the event handlers of a given ToolStripMenuItem

    To use with a ToolstripMenuItem I had to change GetType(Control) to declaringType where Dim declaringType As Type = eventInfo.DeclaringType I couldn't make much sense out of the SourceBrowser which is disapoining since that seems a good thing to be able to use. I tried to see how you found...
  8. A

    Resolved Obtain the event handlers of a given ToolStripMenuItem

    Not supring t all :) How can I extract a Delegate for the Click event from the source variable?
  9. A

    Resolved Obtain the event handlers of a given ToolStripMenuItem

    net8.0-windows I have much code. Some very old. When I found the code for controls I found it does not work. I had also tried this which does not work: Public Sub ExtractAndAddEventHandlers(menuItemOut As ToolStripMenuItem, menuItemIn As ToolStripMenuItem) 'Might also use...
  10. A

    Resolved Obtain the event handlers of a given ToolStripMenuItem

    I can't get it to work. For example I tried the following but eventField is always nothing. Even if I change the parameter type to Control and pass a Button. ' A function that takes a ToolStripMenuItem and uses Debug.WriteLine to list the text ' property of all the event handlers in it...
  11. A

    Resolved Obtain the event handlers of a given ToolStripMenuItem

    I'm probably not using the correct terminology. I thought a Control had an Events property that it got from Component. It would take me a little while to find the code but I'm quite sure some time ago I got the event handlers from a Control and then tried using the code on a ToolStripMenuItem...
  12. A

    Resolved Obtain the event handlers of a given ToolStripMenuItem

    The Component class has a property called Events that returns an EventHandlerList which provides the list of event handlers which can be used to get the event handlers for a control. However, the ToolStripMenuItem does not inherit Component Control so I can't use that. I been looking for a...
  13. A

    Question Is a GobalSuppression.vb file usefull

    I searchedfor information on Source Control in VS2022 and it looks like I've got a some reading to do. Looks like a good thing to know about. I would appreciate one bit of info from you now: Is using .editorconfig a good way to go? It ssems to work for me, it's just that I have to edit it...
  14. A

    Question Is a GobalSuppression.vb file usefull

    I have an .editorconfig as a solution items level file, which seems to do all I need. I also have a GobalSuppression.vb file at that level. It's empty. Do I need it? I've been suppressing unwanted error messages by editing .editorconfig, is that a correct way to suppress? Is one of theses...
  15. A

    Question Can a Forms ContextMenu reference a UserControl's MenuItem

    I knew that. I was hoping someone found a way around it. I thought maybe, if no one had already found a way, I'd try usung reflection to get the event handler from the menuitem and pass that up to the form to be added to a form's menuitem.
  16. A

    Question Can a Forms ContextMenu reference a UserControl's MenuItem

    I shortened the names for this post. 'In the UserControl: Public ReadOnly Property GetQ() As ToolStripMenuItem Get Return Me.ToolStripMenuItem_General_CollapseAll End Get End Property 'In a Usercontrol that contained the first mentioned UserControl: Public...
  17. A

    Question Can a Forms ContextMenu reference a UserControl's MenuItem

    I have a ToolStripMenuItem in ContextMenuStrip Items on a UserControl that I'd like to reference in the Forms ContextMenuStrip items. Is that possible? P.S. Presently the Form has its own MenuItem that calls it a UserControl Public Sub that performs the task the UserControl's...
  18. A

    Resolved TreeView Node Expands

    Private Sub TreeView_1_AfterSelect(sender As Object, e As TreeViewEventArgs) Handles TreeView_1.AfterSelect Try Debug.WriteLine(e.Node.IsExpanded) Me.TextBox_LastSelected.Text = CStr(e.Node.Tag) Debug.WriteLine(e.Node.IsExpanded) Catch ex As Exception...
  19. A

    Question What is the easiest way to determine the string type of the DLL

    If I use Declare Auto and the OS is UNICODE and the DLL is ANSI the runtime will not convert the UNICODE to ANSI. Is that correct? If so, why the word AUTO? If I must tell the runtime what conversion to use what is the easiest way to determine the string type of the DLL?
Back
Top