18426ab481
- aggiornamenti per selezione con mouse.
56 lines
1.9 KiB
VB.net
56 lines
1.9 KiB
VB.net
Imports System.Windows.Forms
|
|
Imports TestEIn.EgtInterface
|
|
|
|
Public Class SelectMulti
|
|
|
|
Dim m_nGseContext As Integer
|
|
Dim m_nCurrEnt As Integer
|
|
|
|
Private Sub SelectMulti_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
|
|
ListBox1.BeginUpdate()
|
|
Dim nId = EgtGetFirstSelectedObj(m_nGseContext)
|
|
While nId <> GDB_ID_NULL
|
|
Dim sTitle As String = String.Empty
|
|
EgtGetTitle(m_nGseContext, nId, sTitle)
|
|
If EgtIsSelectedObj(m_nGseContext, nId) Then
|
|
sTitle += "*"
|
|
End If
|
|
sTitle += " (" & nId & ")"
|
|
ListBox1.Items.Add(sTitle)
|
|
nId = EgtGetNextSelectedObj(m_nGseContext)
|
|
End While
|
|
ListBox1.EndUpdate()
|
|
m_nCurrEnt = GDB_ID_NULL
|
|
ListBox1.SelectedIndex = 0
|
|
End Sub
|
|
|
|
Private Sub SelectMulti_FormClosed(sender As Object, e As FormClosedEventArgs) Handles MyBase.FormClosed
|
|
EgtResetMark(m_nGseContext, m_nCurrEnt)
|
|
EgtDraw(m_nGseContext)
|
|
End Sub
|
|
|
|
Public Sub SetContext(ByVal nGseContext As Integer)
|
|
m_nGseContext = nGseContext
|
|
End Sub
|
|
|
|
Public Function GetId() As Integer
|
|
Return m_nCurrEnt
|
|
End Function
|
|
|
|
Private Sub OK_Button_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OK_Button.Click
|
|
Me.DialogResult = System.Windows.Forms.DialogResult.OK
|
|
Me.Close()
|
|
End Sub
|
|
|
|
Private Sub ListBox1_SelectedIndexChanged(sender As System.Object, e As System.EventArgs) Handles ListBox1.SelectedIndexChanged
|
|
Dim curItem As String = ListBox1.SelectedItem.ToString()
|
|
Dim nIni As Integer = curItem.LastIndexOf("(")
|
|
Dim nFin As Integer = curItem.LastIndexOf(")")
|
|
Dim sNbr As String = curItem.Substring(nIni + 1, nFin - nIni - 1)
|
|
EgtResetMark(m_nGseContext, m_nCurrEnt)
|
|
m_nCurrEnt = CInt(sNbr)
|
|
EgtSetMark(m_nGseContext, m_nCurrEnt)
|
|
EgtDraw(m_nGseContext)
|
|
End Sub
|
|
End Class
|