troubleshooting Question

How do I cancel a deselection or reselect the row deselected after I press the NO button?

Avatar of vcharles
vcharles asked on
.NET ProgrammingVisual Basic.NET
8 Comments1 Solution408 ViewsLast Modified:
Hi,

I'm using the code below to disable controls if user clicks Yes after deselecting a row, problem is if they select NO, the row deselected remains deselected, ist here a way to automatically reselect the row deselected when the user presses No?

The code is in the lostfocus event of my C1TrueDBGrid control or should the code be placed in another section?

If countrepeatedchar("0,1,2,3,4", "4") >= 1 And C1MunitionType.SelectedRows.Count = 1 Then
            va = 1
            C1OMT.Enabled = True
            LO.BackColor = Color.Yellow
            C1ImageA.Text = ""
        Else
            If C1OMT.Text <> "" Then
                Dim anadd As String = Nothing
                anadd = MsgBox("Related information (OMT) on screen 4 for will also be deleted are you sure you want to deselect?", MsgBoxStyle.YesNo, "Warning before Attempting deselect Item")
                If anadd = MsgBoxResult.Yes Then
                    C1OMT.Enabled = False
                    LO.BackColor = Color.LightGray
                    C1OMT.Text = ""
                End If
            End If
        End If

Thanks,

Victor
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 8 Comments.
Join the Community
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 1 Answer and 8 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