Skip to content

Commit 43ba972

Browse files
committed
TabIndex is not reliable...
1 parent e738e8a commit 43ba972

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

BasicPawn/Classes/FormMain/ClassTabControl.vb

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -681,7 +681,13 @@ Public Class ClassTabControl
681681

682682
Public ReadOnly Property m_Index As Integer
683683
Get
684-
Return Me.TabIndex - 1
684+
For i = 0 To g_mFormMain.g_ClassTabControl.m_TabsCount - 1
685+
If (g_mFormMain.g_ClassTabControl.m_Tab(i) Is Me) Then
686+
Return i
687+
End If
688+
Next
689+
690+
Return -1
685691
End Get
686692
End Property
687693

BasicPawn/Controls and Forms/FormSearch.vb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ Public Class FormSearch
273273
Continue For
274274
End If
275275

276-
SetTextEditorSelection(mTab, mResults(mResults.Length - 1).iLocation, mResults(mResults.Length - 1).iLenght, False)
276+
SetTextEditorSelection(mTab, mItem.iLocation, mItem.iLenght, False)
277277

278278
If (mItem.iLocation + mItem.iLenght > mTab.m_TextEditor.Document.TextLength) Then
279279
Continue For
@@ -321,7 +321,7 @@ Public Class FormSearch
321321
Continue For
322322
End If
323323

324-
SetTextEditorSelection(mTab, mResults(mResults.Length - 1).iLocation, mResults(mResults.Length - 1).iLenght, False)
324+
SetTextEditorSelection(mTab, mItem.iLocation, mItem.iLenght, False)
325325

326326
If (mItem.iLocation + mItem.iLenght > mTab.m_TextEditor.Document.TextLength) Then
327327
Continue For
@@ -378,7 +378,7 @@ Public Class FormSearch
378378

379379
SetTextEditorSelection(mTab, iLocation, iLenght, False)
380380

381-
If (mTab.m_Index <> g_mFormMain.g_ClassTabControl.m_ActiveTab.m_Index) Then
381+
If (mTab.m_Index <> g_mFormMain.g_ClassTabControl.m_ActiveTabIndex) Then
382382
g_mFormMain.g_ClassTabControl.SelectTab(mTab.m_Index)
383383
End If
384384
Catch ex As Exception
35 KB
Binary file not shown.

0 commit comments

Comments
 (0)