troubleshooting Question

DirectCast DataGridViewTextBoxCell to TextBox

Avatar of koossa
koossa asked on
Visual Basic.NET
13 Comments2 Solutions1693 ViewsLast Modified:
The following code is working
  Private Sub DataGridView1_EditingControlShowing(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewEditingControlShowingEventArgs) Handles DataGridView1.EditingControlShowing
    Dim MyTextBox As TextBox
    If TypeOf e.Control Is TextBox Then
      MyTextBox = DirectCast(e.Control, TextBox)
    End If
  End Sub

But I want to cast the e.control to my own class that Inherits TextBox, is that possible?
ASKER CERTIFIED SOLUTION
Join our community to see this answer!
Unlock 2 Answers and 13 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 2 Answers and 13 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros