57c2eb2a2f
- Miglioramenti e correzioni varie.
66 lines
2.3 KiB
VB.net
66 lines
2.3 KiB
VB.net
Imports EgtUILib
|
|
|
|
Public Class MainComponentPageUC
|
|
|
|
'Riferimento alla MainWindow
|
|
Private m_MainWindow As MainWindow = Application.Current.MainWindow
|
|
|
|
'Dichiarazione delle Page UserControl
|
|
Friend m_SecondaryComponentPage As SecondaryComponentPageUC
|
|
|
|
Friend CurrentBtn As Button = Nothing
|
|
|
|
Private Sub MainComponentPage_Initialized(sender As Object, e As EventArgs)
|
|
|
|
'Creazione delle Page UserControl
|
|
m_SecondaryComponentPage = New SecondaryComponentPageUC
|
|
|
|
Dim nCompoNumber As Integer = GetPrivateProfileInt("Compo", "Count", 0, m_MainWindow.GetIniFile())
|
|
For index As Integer = 1 To nCompoNumber
|
|
Dim nCompoName As Integer = GetPrivateProfileInt("Compo" & index, "Name", 0, m_MainWindow.GetIniFile())
|
|
GetButton(index).Content = EgtMsg(MSG_COMPONENTPAGEUC + nCompoName)
|
|
Next
|
|
|
|
End Sub
|
|
|
|
Private Sub UserControl_Loaded(sender As Object, e As RoutedEventArgs)
|
|
CurrentBtn = Nothing
|
|
End Sub
|
|
|
|
Private Function GetButton(ByVal nInd As Integer) As Button
|
|
Select Case nInd
|
|
Case 1
|
|
Return Compo1
|
|
Case 2
|
|
Return Compo2
|
|
Case 3
|
|
Return Compo3
|
|
Case 4
|
|
Return Compo4
|
|
Case 5
|
|
Return Compo5
|
|
Case 6
|
|
Return Compo6
|
|
Case 7
|
|
Return Compo7
|
|
Case 8
|
|
Return Compo8
|
|
Case Else
|
|
Return Compo9
|
|
End Select
|
|
End Function
|
|
|
|
Private Sub Compo_Click(sender As Object, e As RoutedEventArgs) Handles Compo1.Click, Compo2.Click, Compo3.Click, Compo4.Click, Compo5.Click, Compo6.Click, Compo7.Click, Compo8.Click, Compo9.Click
|
|
CurrentBtn = e.Source
|
|
Dim nCount As Integer = GetPrivateProfileInt(CurrentBtn.Name, "Count", 0, m_MainWindow.GetIniFile())
|
|
If nCount > 1 Then
|
|
m_MainWindow.m_DrawPageUC.DrawPageGrid.Children.Remove(Me)
|
|
m_MainWindow.m_DrawPageUC.m_ActiveComponentPage = DrawPageUC.Pages.SecondaryComponent
|
|
m_MainWindow.m_DrawPageUC.DrawPageGrid.Children.Add(m_SecondaryComponentPage)
|
|
Else
|
|
GetPrivateProfileInt(CurrentBtn.Name, "Count", 0, m_MainWindow.GetIniFile())
|
|
End If
|
|
End Sub
|
|
|
|
End Class
|