Imports System.IO.Ports ਍ഀഀ Public Class DataDisplayForm ਍ഀഀ 'Dim strDGVBoxText(5, (&H3F - &H21 + 1)) As String ' "?" to "!" i.e. 63 - 33 + 1 = 31 ਍    ✀䐀椀洀 猀琀爀吀攀猀琀䌀漀渀琀攀渀琀⠀㔀Ⰰ ㌀㄀⤀ 䄀猀 匀琀爀椀渀最ഀഀ Dim intColumn As Integer ਍    䐀椀洀 椀渀琀刀漀眀 䄀猀 䤀渀琀攀最攀爀ഀഀ Dim str_FunctionReply As String = String.Empty ਍ഀഀ Dim MAXROWINDEX As Integer = 4 ' i.e. 5 rows ਍    䐀椀洀 䴀䄀堀䌀伀䰀唀䴀一䤀一䐀䔀堀 䄀猀 䤀渀琀攀最攀爀 㴀 㘀   ✀ 椀⸀攀⸀ 㜀 挀漀氀甀洀渀猀ഀഀ Dim strDGVBoxText(MAXCOLUMNINDEX, (&H3F - &H21 + 1)) As String ' "?" to "!" i.e. 63 - 33 + 1 = 31 ਍    䐀椀洀 猀琀爀吀攀猀琀䌀漀渀琀攀渀琀⠀䴀䄀堀䌀伀䰀唀䴀一䤀一䐀䔀堀Ⰰ ㌀㄀⤀ 䄀猀 匀琀爀椀渀最ഀഀ ਍    䐀椀洀 䤀开䐀攀氀愀礀开䘀氀愀最 䄀猀 䤀渀琀攀最攀爀ഀഀ ਍    倀甀戀氀椀挀 䤀开䐀䜀嘀圀愀椀琀䘀氀愀最 䄀猀 䤀渀琀攀最攀爀 㴀  ഀഀ ਍    ✀愀猀 愀 瀀愀爀琀 漀昀 琀栀攀 搀攀挀氀愀爀愀琀椀漀渀猀㨀ഀഀ '============================== ਍    ✀ഀഀ ' Dim Instance_SolarCalc = New Sonnenstand.Berechnung ' creates an INSTANCE ਍    ✀ऀऀऀऀ                ✀  䘀椀氀攀        䌀氀愀猀猀ഀഀ ' ਍    ✀椀渀 攀愀挀栀 猀甀戀爀漀甀琀椀渀攀 眀栀攀爀攀 琀栀攀 昀甀渀挀琀椀漀渀猀 漀昀 琀栀攀 挀氀愀猀猀 愀爀攀 甀猀攀搀㨀ഀഀ '============================================================= ਍    ✀ഀഀ ' Dim Class_SolarCalc As New Sonnenstand.Berechnung ਍    ✀ऀऀऀऀ                    ✀  䘀椀氀攀        䌀氀愀猀猀ഀഀ ' ਍    ✀㴀㴀㴀㴀㴀㴀㴀㴀㴀㴀㴀㴀㴀㴀㴀㴀㴀㴀㴀㴀㴀㴀㴀㴀㴀㴀㴀㴀㴀㴀㴀㴀㴀㴀㴀㴀㴀㴀㴀㴀㴀㴀㴀㴀㴀㴀㴀㴀㴀㴀㴀㴀㴀㴀㴀㴀㴀㴀㴀㴀㴀㴀ഀഀ ਍    ✀䐀椀洀 䤀渀猀琀愀渀挀攀开䔀稀匀氀漀䈀甀猀 㴀 一攀眀 䔀稀⸀匀氀漀开䈀甀猀开吀攀猀琀⸀䔀稀开匀氀漀开䈀甀猀开吀攀猀琀攀爀开䘀漀爀洀㄀         ✀ 挀爀攀愀琀攀猀 愀渀 䤀一匀吀䄀一䌀䔀ഀഀ 'Dim Class_EzSloBus As New Ez.Slo_Bus_Test.Ez_Slo_Bus_Tester_Form1 ' defines a Class ਍ഀഀ ' ################################################################### ਍    ✀ ⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀ഀഀ Public Sub New() ਍ഀഀ ' This call is required by the designer. ਍        䤀渀椀琀椀愀氀椀稀攀䌀漀洀瀀漀渀攀渀琀⠀⤀ഀഀ ਍        ✀ 䄀搀搀 愀渀礀 椀渀椀琀椀愀氀椀稀愀琀椀漀渀 愀昀琀攀爀 琀栀攀 䤀渀椀琀椀愀氀椀稀攀䌀漀洀瀀漀渀攀渀琀⠀⤀ 挀愀氀氀⸀ഀഀ ਍        ✀䴀攀⸀吀攀砀琀 ☀㴀 ∀   嘀攀爀猀椀漀渀 ㄀㈀㜀㄀㠀愀∀ഀഀ 'Me.Text &= " Version 13a08a" ' changing >Sub< to >Function< ਍        ✀䴀攀⸀吀攀砀琀 ☀㴀 ∀   嘀攀爀猀椀漀渀 ㄀㐀㐀 ㄀愀∀  ✀ 匀眀椀琀挀栀 琀漀 嘀椀猀甀愀氀 匀琀甀搀椀漀 䔀砀瀀爀攀猀猀 ㈀ ㄀㌀ഀഀ Me.Text &= " Version 14429a" ' delete all >My.Application.DoEvents()< ਍ഀഀ Me.BackColor = Color.Beige ਍        䴀攀⸀䠀攀椀最栀琀 㴀 ㈀  ഀഀ ਍        圀椀琀栀 䴀攀⸀搀最瘀开䐀椀猀瀀氀愀礀ഀഀ .RowsDefaultCellStyle.BackColor = Color.Bisque ਍            ⸀䄀氀琀攀爀渀愀琀椀渀最刀漀眀猀䐀攀昀愀甀氀琀䌀攀氀氀匀琀礀氀攀⸀䈀愀挀欀䌀漀氀漀爀 㴀 䌀漀氀漀爀⸀䈀攀椀最攀ഀഀ .RowHeadersVisible = False ਍            ✀吀漀 栀椀搀攀 琀栀攀 琀爀椀愀渀最甀氀愀爀 愀爀爀漀眀ഀഀ .RowHeadersDefaultCellStyle.Padding = New Padding(3) ਍            ✀吀漀 栀椀搀攀 琀栀攀 氀愀猀琀 爀漀眀⠀䐀攀昀愀甀氀琀 渀攀眀爀漀眀⤀ഀഀ .AllowUserToAddRows = False ਍        䔀渀搀 圀椀琀栀ഀഀ ਍        ✀圀椀琀栀 䴀攀⸀搀最瘀开䐀椀猀瀀氀愀礀⸀䌀漀氀甀洀渀䠀攀愀搀攀爀猀䐀攀昀愀甀氀琀䌀攀氀氀匀琀礀氀攀ഀഀ With Me.dgv_Display.DefaultCellStyle ਍            ⸀䈀愀挀欀䌀漀氀漀爀 㴀 䌀漀氀漀爀⸀一愀瘀礀ഀഀ .ForeColor = Color.Black ਍            ⸀䘀漀渀琀 㴀 一攀眀 䘀漀渀琀⠀䴀攀⸀搀最瘀开䐀椀猀瀀氀愀礀⸀䘀漀渀琀Ⰰ 䘀漀渀琀匀琀礀氀攀⸀刀攀最甀氀愀爀⤀ഀഀ '.Font = New Font("Tahoma", 9) ਍            ⸀䘀漀渀琀 㴀 一攀眀 䘀漀渀琀⠀∀䌀漀甀爀椀攀爀 一攀眀∀Ⰰ 㤀⤀ഀഀ End With ਍ഀഀ txt_Columns.Text = (MAXROWINDEX + 1).ToString ਍        氀戀氀䄀⸀吀攀砀琀 㴀 匀琀爀椀渀最⸀䔀洀瀀琀礀ഀഀ ਍        最戀砀开䘀椀氀氀开刀漀眀⸀嘀椀猀椀戀氀攀 㴀 吀爀甀攀ഀഀ gbx_Fill_Table.Visible = True ਍ഀഀ 'Instance_EzSloBus.Visible = True ' makes sure the RS232 Interface COM is opened ਍        ✀䤀渀猀琀愀渀挀攀开䔀稀匀氀漀䈀甀猀⸀嘀椀猀椀戀氀攀 㴀 䘀愀氀猀攀ഀഀ ਍    䔀渀搀 匀甀戀ഀഀ ਍    倀甀戀氀椀挀 匀甀戀 䐀愀琀愀䐀椀猀瀀氀愀礀䘀漀爀洀开䰀漀愀搀⠀猀攀渀搀攀爀 䄀猀 伀戀樀攀挀琀Ⰰ 攀 䄀猀 匀礀猀琀攀洀⸀䔀瘀攀渀琀䄀爀最猀⤀ 䠀愀渀搀氀攀猀 䴀攀⸀䰀漀愀搀ഀഀ ਍        ✀䌀愀氀氀 昀挀琀渀开䌀爀攀愀琀攀䐀䜀嘀⠀⤀ഀഀ str_FunctionReply = strfctn_CreateDGV() ਍ഀഀ ' ############################################################ ਍ഀഀ For Me.intColumn = 0 To 4 Step 1 ਍            䘀漀爀 䴀攀⸀椀渀琀刀漀眀 㴀   吀漀 ㌀㄀ 匀琀攀瀀 ㄀ഀഀ strDGVBoxText(Me.intColumn, Me.intRow) = String.Empty ਍            一攀砀琀 䴀攀⸀椀渀琀刀漀眀ഀഀ Next Me.intColumn ਍ഀഀ dgv_Display.Visible = True ਍ഀഀ ' ############################################################ ਍ഀഀ End Sub ਍    ✀ ⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀ഀഀ ' ########################################################### ਍ഀഀ ਍    ✀倀甀戀氀椀挀 匀甀戀 昀挀琀渀开䌀爀攀愀琀攀䐀䜀嘀⠀⤀ഀഀ Public Function strfctn_CreateDGV() As String ਍ഀഀ Dim iCounter As Integer ਍ഀഀ dgv_Display.Rows.Clear() ਍ഀഀ If dgv_Display.Columns.Count = 0 Then ਍            ✀ 匀瀀愀氀琀攀渀 栀椀渀稀甀昀ﰀ最攀渀 ഀഀ With dgv_Display ਍                ⸀䌀漀氀甀洀渀猀⸀䄀搀搀⠀∀匀瀀䠀攀愀搀攀爀䌀漀氀开 ∀Ⰰ ∀䄀搀搀爀攀猀猀∀⤀ഀഀ .Columns.Add("SpHeaderCol_1", "Identity") ਍                ⸀䌀漀氀甀洀渀猀⸀䄀搀搀⠀∀匀瀀䠀攀愀搀攀爀䌀漀氀开㈀∀Ⰰ ∀匀圀 嘀攀爀猀椀漀渀∀⤀ഀഀ .Columns.Add("SpHeaderCol_3", "Artikelnummer") ਍                ⸀䌀漀氀甀洀渀猀⸀䄀搀搀⠀∀匀瀀䠀攀愀搀攀爀䌀漀氀开㐀∀Ⰰ ∀匀攀爀椀攀渀渀甀洀洀攀爀∀⤀ഀഀ .Columns.Add("SpHeaderCol_5", "Manufacturer") ਍                ⸀䌀漀氀甀洀渀猀⸀䄀搀搀⠀∀匀瀀䠀攀愀搀攀爀䌀漀氀开㘀∀Ⰰ ∀匀琀愀琀甀猀∀⤀ഀഀ .Location = New Point(170, 10) ' (x , y) ਍            䔀渀搀 圀椀琀栀ഀഀ ਍            ✀匀瀀愀氀琀攀渀 䈀爀攀椀琀攀 攀椀渀猀琀攀氀氀攀渀ഀഀ For iCounter = 1 To (dgv_Display.Columns.Count - 1) ਍                搀最瘀开䐀椀猀瀀氀愀礀⸀䌀漀氀甀洀渀猀⠀椀䌀漀甀渀琀攀爀⤀⸀圀椀搀琀栀 㴀 ㄀㈀ ഀഀ dgv_Display.Columns(iCounter).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter ਍            一攀砀琀ഀഀ dgv_Display.Columns(0).Width = 60 ਍            搀最瘀开䐀椀猀瀀氀愀礀⸀䌀漀氀甀洀渀猀⠀ ⤀⸀䐀攀昀愀甀氀琀䌀攀氀氀匀琀礀氀攀⸀䄀氀椀最渀洀攀渀琀 㴀 䐀愀琀愀䜀爀椀搀嘀椀攀眀䌀漀渀琀攀渀琀䄀氀椀最渀洀攀渀琀⸀䴀椀搀搀氀攀䌀攀渀琀攀爀ഀഀ ਍            ✀䌀愀氀氀 昀挀琀渀开匀攀琀搀最瘀开䐀椀猀瀀氀愀礀匀椀稀攀⠀⤀ഀഀ str_FunctionReply = strfctn_Setdgv_DisplaySize() ਍ഀഀ dgv_Display.ColumnHeadersDefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter ਍        䔀渀搀 䤀昀ഀഀ ਍        ✀瀀渀氀吀眀漀⸀嘀椀猀椀戀氀攀 㴀 䘀愀氀猀攀 ഀഀ strfctn_CreateDGV = "strfctn_CreateDGV is done" ਍ഀഀ End Function ' ***************************************** ਍    ✀ ⨀⨀⨀⨀⨀⨀⨀⨀⨀⨀⨀⨀⨀⨀⨀⨀⨀⨀⨀⨀⨀⨀⨀⨀⨀⨀⨀⨀⨀⨀⨀⨀⨀⨀⨀⨀⨀⨀⨀⨀⨀⨀⨀⨀⨀⨀⨀⨀⨀⨀⨀⨀⨀⨀⨀⨀⨀ഀഀ ਍    ✀ ⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀ഀഀ ' ########################################################### ਍ഀഀ 'Public Sub fctn_Setdgv_DisplaySize() ਍    倀甀戀氀椀挀 䘀甀渀挀琀椀漀渀 猀琀爀昀挀琀渀开匀攀琀搀最瘀开䐀椀猀瀀氀愀礀匀椀稀攀⠀⤀ 䄀猀 匀琀爀椀渀最ഀഀ ਍        䐀椀洀 椀䌀漀甀渀琀攀爀 䄀猀 䤀渀琀攀最攀爀 㴀  ഀഀ Dim iTotalWidth As Integer = 0 ਍        䐀椀洀 椀吀漀琀愀氀䠀攀椀最栀琀 䄀猀 䤀渀琀攀最攀爀 㴀  ഀഀ Dim iYLocation As Integer ਍ഀഀ 'Feld Breite einstellen ਍        椀吀漀琀愀氀圀椀搀琀栀 㴀  ഀഀ For iCounter = 0 To (dgv_Display.Columns.Count - 1) Step 1 ਍            椀吀漀琀愀氀圀椀搀琀栀 ⬀㴀 搀最瘀开䐀椀猀瀀氀愀礀⸀䌀漀氀甀洀渀猀⠀椀䌀漀甀渀琀攀爀⤀⸀圀椀搀琀栀ഀഀ Next iCounter ਍ഀഀ 'Feld Höhe einstellen ਍        椀吀漀琀愀氀䠀攀椀最栀琀 㴀  ഀഀ For iCounter = 0 To (dgv_Display.Rows.Count - 1) Step 1 ਍            椀吀漀琀愀氀䠀攀椀最栀琀 ⬀㴀 搀最瘀开䐀椀猀瀀氀愀礀⸀刀漀眀猀⠀椀䌀漀甀渀琀攀爀⤀⸀䠀攀椀最栀琀ഀഀ Next iCounter ਍ഀഀ 'dgv_Display.Size = New Size((iTotalWidth + 43), (iTotalHeight + 30)) ਍ഀഀ dgv_Display.Size = New Size((iTotalWidth + 5), (iTotalHeight + 30)) ਍ഀഀ If ((iTotalHeight + 90) <= 200) Then ਍            䴀攀⸀䠀攀椀最栀琀 㴀 ㈀  ഀഀ Else ਍            䴀攀⸀䠀攀椀最栀琀 㴀 椀吀漀琀愀氀䠀攀椀最栀琀 ⬀ 㤀 ഀഀ End If ਍ഀഀ If iTotalHeight < 600 Then ਍            椀夀䰀漀挀愀琀椀漀渀 㴀 ㈀  ഀഀ Else ਍            椀夀䰀漀挀愀琀椀漀渀 㴀 ㄀  ഀഀ End If ਍ഀഀ Dim NewYLocation As New System.Drawing.Point(iYLocation, Me.Location.Y) ' Starting at the upper left ਍        䴀攀⸀䰀漀挀愀琀椀漀渀 㴀 一攀眀夀䰀漀挀愀琀椀漀渀                                          ✀ 猀挀爀攀攀渀 挀漀爀渀攀爀ഀഀ ਍        䐀椀洀 一攀眀堀䰀漀挀愀琀椀漀渀 䄀猀 一攀眀 匀礀猀琀攀洀⸀䐀爀愀眀椀渀最⸀倀漀椀渀琀⠀㄀  Ⰰ 䴀攀⸀䰀漀挀愀琀椀漀渀⸀堀⤀    ✀ 匀琀愀爀琀椀渀最 愀琀 琀栀攀 甀瀀瀀攀爀 氀攀昀琀ഀഀ Me.Location = NewXLocation ' screen corner ਍ഀഀ strfctn_Setdgv_DisplaySize = "strfctn_Setdgv_DisplaySize is done" ਍ഀഀ End Function ਍    ✀ ⨀⨀⨀⨀⨀⨀⨀⨀⨀⨀⨀⨀⨀⨀⨀⨀⨀⨀⨀⨀⨀⨀⨀⨀⨀⨀⨀⨀⨀⨀⨀⨀⨀⨀⨀⨀⨀⨀⨀⨀⨀⨀⨀⨀⨀⨀⨀⨀⨀⨀⨀⨀⨀⨀⨀⨀⨀ഀഀ ਍    ✀ ⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀ഀഀ ' ########################################################### ਍ഀഀ Private Sub btn_FillTable_Click(sender As System.Object, e As System.EventArgs) Handles btn_FillTable.Click ਍ഀഀ MAXROWINDEX = Val(txt_Columns.Text) - 1 ਍        氀戀氀䄀⸀吀攀砀琀 㴀 匀琀爀椀渀最⸀䔀洀瀀琀礀ഀഀ ਍        䘀漀爀 䴀攀⸀椀渀琀刀漀眀 㴀   吀漀 䴀䄀堀刀伀圀䤀一䐀䔀堀 匀琀攀瀀 ㄀ഀഀ For Me.intColumn = 0 To MAXCOLUMNINDEX Step 1 ਍                猀琀爀吀攀猀琀䌀漀渀琀攀渀琀⠀椀渀琀䌀漀氀甀洀渀Ⰰ 椀渀琀刀漀眀⤀ 㴀 椀渀琀䌀漀氀甀洀渀⸀吀漀匀琀爀椀渀最 ☀ ∀Ⰰ ∀ ☀ 椀渀琀刀漀眀⸀吀漀匀琀爀椀渀最ഀഀ Next Me.intColumn ਍        一攀砀琀 䴀攀⸀椀渀琀刀漀眀ഀഀ ਍        ✀䌀愀氀氀 昀挀琀渀开䌀爀攀愀琀攀䐀䜀嘀⠀⤀ഀഀ str_FunctionReply = strfctn_CreateDGV() ਍ഀഀ For Me.intRow = 0 To MAXROWINDEX Step 1 ਍            䘀漀爀 䴀攀⸀椀渀琀䌀漀氀甀洀渀 㴀   吀漀 䴀䄀堀䌀伀䰀唀䴀一䤀一䐀䔀堀 匀琀攀瀀 ㄀ഀഀ ਍                吀爀礀ഀഀ strDGVBoxText(Me.intColumn, Me.intRow) = strTestContent(intColumn, intRow) ਍                䌀愀琀挀栀 攀砀 䄀猀 匀礀猀琀攀洀⸀䔀砀挀攀瀀琀椀漀渀ഀഀ MessageBox.Show(ex.Message) ਍                䔀渀搀 吀爀礀ഀഀ ਍            一攀砀琀 䴀攀⸀椀渀琀䌀漀氀甀洀渀ഀഀ ਍            圀椀琀栀 搀最瘀开䐀椀猀瀀氀愀礀⸀刀漀眀猀ഀഀ .Add(strDGVBoxText(0, intRow), _ ਍                     猀琀爀䐀䜀嘀䈀漀砀吀攀砀琀⠀㄀Ⰰ 椀渀琀刀漀眀⤀Ⰰ 开ഀഀ strDGVBoxText(2, intRow), _ ਍                     猀琀爀䐀䜀嘀䈀漀砀吀攀砀琀⠀㌀Ⰰ 椀渀琀刀漀眀⤀Ⰰ 开ഀഀ strDGVBoxText(4, intRow), _ ਍                     猀琀爀䐀䜀嘀䈀漀砀吀攀砀琀⠀㔀Ⰰ 椀渀琀刀漀眀⤀Ⰰ 开ഀഀ strDGVBoxText(6, intRow)) ਍            䔀渀搀 圀椀琀栀ഀഀ ਍            ✀搀最瘀开䐀椀猀瀀氀愀礀⸀刀漀眀䠀攀愀搀攀爀猀䈀漀爀搀攀爀匀琀礀氀攀⸀ ⠀ⴀ㄀Ⰰ 椀渀琀刀漀眀⸀吀漀匀琀爀椀渀最⤀ഀഀ ਍            ✀䌀愀氀氀 昀挀琀渀开匀攀琀搀最瘀开䐀椀猀瀀氀愀礀匀椀稀攀⠀⤀ഀഀ str_FunctionReply = strfctn_Setdgv_DisplaySize() ਍ഀഀ Next (Me.intRow) ਍ഀഀ End Sub ਍ഀഀ 'Private Sub dgv_Display_CellContentClick(sender As System.Object, e As System.Windows.Forms.DataGridViewCellEventArgs) Handles dgv_Display.CellContentClick ਍    倀甀戀氀椀挀 匀甀戀 搀最瘀开䐀椀猀瀀氀愀礀开䌀攀氀氀䌀氀椀挀欀⠀猀攀渀搀攀爀 䄀猀 匀礀猀琀攀洀⸀伀戀樀攀挀琀Ⰰ 攀 䄀猀 匀礀猀琀攀洀⸀圀椀渀搀漀眀猀⸀䘀漀爀洀猀⸀䐀愀琀愀䜀爀椀搀嘀椀攀眀䌀攀氀氀䔀瘀攀渀琀䄀爀最猀⤀ 䠀愀渀搀氀攀猀 搀最瘀开䐀椀猀瀀氀愀礀⸀䌀攀氀氀䌀氀椀挀欀ഀഀ ਍        䐀椀洀 猀琀爀䴀漀搀甀氀攀䤀搀 䄀猀 匀琀爀椀渀最 㴀 匀琀爀椀渀最⸀䔀洀瀀琀礀ഀഀ Dim strModuleAddress As String = String.Empty ਍        䐀椀洀 椀渀琀匀攀氀攀挀琀攀搀刀漀眀 䄀猀 䤀渀琀攀最攀爀ഀഀ Dim intFixedColAddress As Integer ਍        䐀椀洀 椀渀琀䘀椀砀攀搀䌀漀氀䤀搀攀渀琀椀琀礀 䄀猀 䤀渀琀攀最攀爀ഀഀ Dim iCounter As Integer ਍ഀഀ Dim Instance_EzSloBus = New Ez.Slo_Bus_Test.Ez_Slo_Bus_Tester_Form1 ' creates an INSTANCE ਍        䐀椀洀 䌀氀愀猀猀开䔀稀匀氀漀䈀甀猀 䄀猀 一攀眀 䔀稀⸀匀氀漀开䈀甀猀开吀攀猀琀⸀䔀稀开匀氀漀开䈀甀猀开吀攀猀琀攀爀开䘀漀爀洀㄀         ✀ 搀攀昀椀渀攀猀 愀 䌀氀愀猀猀ഀഀ ਍        䤀开䐀䜀嘀圀愀椀琀䘀氀愀最 㴀 ㄀ഀഀ ਍        氀戀氀䄀⸀吀攀砀琀 㴀 ∀匀瀀愀氀琀攀 ⠀䌀漀氀⤀㨀 ∀ ☀ 攀⸀䌀漀氀甀洀渀䤀渀搀攀砀 ☀ 瘀戀䌀爀䰀昀 ☀ ∀娀攀椀氀攀 ⠀刀漀眀⤀㨀 ∀ ☀ 攀⸀刀漀眀䤀渀搀攀砀 ☀ 瘀戀䌀爀䰀昀ഀഀ intSelectedRow = e.RowIndex ਍ഀഀ iCounter = e.ColumnIndex ' not used here !! ਍ഀഀ intFixedColAddress = dgv_Display.Columns("SpHeaderCol_0").Index ਍        椀渀琀䘀椀砀攀搀䌀漀氀䤀搀攀渀琀椀琀礀 㴀 搀最瘀开䐀椀猀瀀氀愀礀⸀䌀漀氀甀洀渀猀⠀∀匀瀀䠀攀愀搀攀爀䌀漀氀开㄀∀⤀⸀䤀渀搀攀砀ഀഀ ਍        䤀昀 攀⸀刀漀眀䤀渀搀攀砀 㸀㴀   䄀渀搀 攀⸀䌀漀氀甀洀渀䤀渀搀攀砀 㸀㴀   吀栀攀渀ഀഀ lblA.Text &= "Inhalt: >" & Convert.ToString(dgv_Display.Rows(e.RowIndex).Cells(e.ColumnIndex).Value) & "<" & vbCrLf ਍        䔀氀猀攀ഀഀ lblA.Text &= "Inhalt: Leer" & vbCrLf ਍        䔀渀搀 䤀昀ഀഀ ਍        ✀瀀最戀匀攀愀爀挀栀⸀嘀愀氀甀攀 㴀 ⠀ ⤀   ✀ 䌀氀攀愀爀猀 倀爀漀最爀攀猀猀 䈀愀爀ഀഀ ਍        䤀昀 ⠀⠀椀渀琀匀攀氀攀挀琀攀搀刀漀眀 㸀㴀  ⤀ 䄀渀搀 ⠀椀渀琀䘀椀砀攀搀䌀漀氀䄀搀搀爀攀猀猀 㸀㴀  ⤀ 䄀渀搀 ⠀椀渀琀䘀椀砀攀搀䌀漀氀䤀搀攀渀琀椀琀礀 㸀㴀  ⤀⤀ 吀栀攀渀ഀഀ ਍            猀琀爀䴀漀搀甀氀攀䄀搀搀爀攀猀猀 㴀 䌀漀渀瘀攀爀琀⸀吀漀匀琀爀椀渀最⠀搀最瘀开䐀椀猀瀀氀愀礀⸀刀漀眀猀⠀椀渀琀匀攀氀攀挀琀攀搀刀漀眀⤀⸀䌀攀氀氀猀⠀椀渀琀䘀椀砀攀搀䌀漀氀䄀搀搀爀攀猀猀⤀⸀嘀愀氀甀攀⤀ഀഀ strModuleId = Convert.ToString(dgv_Display.Rows(intSelectedRow).Cells(intFixedColIdentity).Value) ਍ഀഀ lblA.Text &= "Address: >" & strModuleAddress & "<" & vbCrLf ਍ഀഀ 'pnlTwo.Visible = True ਍            搀最瘀开䐀椀猀瀀氀愀礀⸀嘀椀猀椀戀氀攀 㴀 䘀愀氀猀攀ഀഀ ਍            琀砀琀开䴀漀搀甀氀攀䤀䐀⸀吀攀砀琀 㴀 猀琀爀䴀漀搀甀氀攀䤀搀ഀഀ txt_ModuleAddress.Text = strModuleAddress ਍ഀഀ Else ਍            䌀愀氀氀 䈀攀攀瀀⠀⤀ഀഀ ਍            䴀攀猀猀愀最攀䈀漀砀⸀匀栀漀眀⠀∀夀漀甀 挀氀椀挀欀攀搀 琀漀 眀爀漀渀最 愀爀攀愀℀∀Ⰰ ∀䔀爀爀漀爀∀⤀ഀഀ 'PumpServiceToolStripMenuItem.Visible = False ਍            ✀嘀愀氀瘀攀匀攀爀瘀椀挀攀吀漀漀氀匀琀爀椀瀀䴀攀渀甀䤀琀攀洀⸀嘀椀猀椀戀氀攀 㴀 䘀愀氀猀攀ഀഀ End If ਍ഀഀ I_DGVWaitFlag = 0 ਍ഀഀ Me.Visible = False ਍ഀഀ ਍    䔀渀搀 匀甀戀ഀഀ ਍ഀഀ Public Sub btn_ClearTable_Click(sender As System.Object, e As System.EventArgs) Handles btn_ClearTable.Click ਍ഀഀ lblA.Text = String.Empty ਍ഀഀ 'Call fctn_CreateDGV() ਍        猀琀爀开䘀甀渀挀琀椀漀渀刀攀瀀氀礀 㴀 猀琀爀昀挀琀渀开䌀爀攀愀琀攀䐀䜀嘀⠀⤀ഀഀ ਍        ✀䌀愀氀氀 昀挀琀渀开匀攀琀搀最瘀开䐀椀猀瀀氀愀礀匀椀稀攀⠀⤀ഀഀ str_FunctionReply = strfctn_Setdgv_DisplaySize() ਍ഀഀ End Sub ਍ഀഀ ' ###################################################################### ਍ഀഀ 'Public Sub FillNextRow(ByVal str_Col0 As String, ByVal str_Col1 As String, ByVal str_Col2 As String, _ ਍    倀甀戀氀椀挀 䘀甀渀挀琀椀漀渀 猀琀爀昀挀琀渀开䘀椀氀氀一攀砀琀刀漀眀⠀䈀礀嘀愀氀 猀琀爀开䌀漀氀  䄀猀 匀琀爀椀渀最Ⰰ 䈀礀嘀愀氀 猀琀爀开䌀漀氀㄀ 䄀猀 匀琀爀椀渀最Ⰰ 䈀礀嘀愀氀 猀琀爀开䌀漀氀㈀ 䄀猀 匀琀爀椀渀最Ⰰ 开ഀഀ ByVal str_Col3 As String, ByVal str_Col4 As String, ByVal str_Col5 As String, _ ਍                                        䈀礀嘀愀氀 猀琀爀开䌀漀氀㘀 䄀猀 匀琀爀椀渀最⤀ 䄀猀 匀琀爀椀渀最ഀഀ ਍        䐀椀洀 猀琀爀开䌀漀氀甀洀渀吀攀砀琀⠀䴀䄀堀䌀伀䰀唀䴀一䤀一䐀䔀堀⤀ 䄀猀 匀琀爀椀渀最ഀഀ ਍        䴀攀⸀椀渀琀刀漀眀 㴀  ഀഀ str_ColumnText(0) = str_Col0 ਍        猀琀爀开䌀漀氀甀洀渀吀攀砀琀⠀㄀⤀ 㴀 猀琀爀开䌀漀氀㄀ഀഀ str_ColumnText(2) = str_Col2 ਍        猀琀爀开䌀漀氀甀洀渀吀攀砀琀⠀㌀⤀ 㴀 猀琀爀开䌀漀氀㌀ഀഀ str_ColumnText(4) = str_Col4 ਍        猀琀爀开䌀漀氀甀洀渀吀攀砀琀⠀㔀⤀ 㴀 猀琀爀开䌀漀氀㔀ഀഀ str_ColumnText(6) = str_Col6 ਍ഀഀ For Me.intColumn = 0 To MAXCOLUMNINDEX Step 1 ਍ഀഀ Try ਍                猀琀爀䐀䜀嘀䈀漀砀吀攀砀琀⠀䴀攀⸀椀渀琀䌀漀氀甀洀渀Ⰰ 䴀攀⸀椀渀琀刀漀眀⤀ 㴀 猀琀爀开䌀漀氀甀洀渀吀攀砀琀⠀䴀攀⸀椀渀琀䌀漀氀甀洀渀⤀ഀഀ Catch ex As System.Exception ਍                䴀攀猀猀愀最攀䈀漀砀⸀匀栀漀眀⠀攀砀⸀䴀攀猀猀愀最攀⤀ഀഀ End Try ਍ഀഀ Next Me.intColumn ਍ഀഀ ' My.Application.DoEvents() '14429 ਍ഀഀ Try ਍            圀椀琀栀 搀最瘀开䐀椀猀瀀氀愀礀⸀刀漀眀猀ഀഀ .Add(strDGVBoxText(0, Me.intRow), _ ਍                     猀琀爀䐀䜀嘀䈀漀砀吀攀砀琀⠀㄀Ⰰ 䴀攀⸀椀渀琀刀漀眀⤀Ⰰ 开ഀഀ strDGVBoxText(2, Me.intRow), _ ਍                     猀琀爀䐀䜀嘀䈀漀砀吀攀砀琀⠀㌀Ⰰ 䴀攀⸀椀渀琀刀漀眀⤀Ⰰ 开ഀഀ strDGVBoxText(4, Me.intRow), _ ਍                     猀琀爀䐀䜀嘀䈀漀砀吀攀砀琀⠀㔀Ⰰ 䴀攀⸀椀渀琀刀漀眀⤀Ⰰ 开ഀഀ strDGVBoxText(6, Me.intRow)) ਍            䔀渀搀 圀椀琀栀ഀഀ Catch ex As Exception ਍            䴀攀猀猀愀最攀䈀漀砀⸀匀栀漀眀⠀攀砀⸀䴀攀猀猀愀最攀Ⰰ ∀䐀䜀嘀 䔀爀爀漀爀∀⤀ഀഀ End Try ਍ഀഀ 'With dgv_Display.Rows ਍        ✀    ⸀䄀搀搀⠀猀琀爀䐀䜀嘀䈀漀砀吀攀砀琀⠀ Ⰰ 䴀攀⸀椀渀琀刀漀眀⤀Ⰰ 开ഀഀ ' strDGVBoxText(1, Me.intRow), _ ਍        ✀         猀琀爀䐀䜀嘀䈀漀砀吀攀砀琀⠀㈀Ⰰ 䴀攀⸀椀渀琀刀漀眀⤀Ⰰ 开ഀഀ ' strDGVBoxText(3, Me.intRow), _ ਍        ✀         猀琀爀䐀䜀嘀䈀漀砀吀攀砀琀⠀㐀Ⰰ 䴀攀⸀椀渀琀刀漀眀⤀Ⰰ 开ഀഀ ' strDGVBoxText(5, Me.intRow)) ਍        ✀䔀渀搀 圀椀琀栀ഀഀ ਍        ✀䌀愀氀氀 昀挀琀渀开匀攀琀搀最瘀开䐀椀猀瀀氀愀礀匀椀稀攀⠀⤀ഀഀ str_FunctionReply = strfctn_Setdgv_DisplaySize() ਍ഀഀ strfctn_FillNextRow = "strfctn_FillNextRow is done" ਍    䔀渀搀 䘀甀渀挀琀椀漀渀ഀഀ ' ###################################################################### ਍ഀഀ Private Sub btn_FillRow_Click(sender As System.Object, e As System.EventArgs) Handles btn_FillRow.Click ਍ഀഀ 'Call FillNextRow(txt_Col1.Text, txt_Col2.Text, txt_Col3.Text, txt_Col4.Text, txt_Col5.Text, txt_Col6.Text, txt_Col7.Text) ਍        猀琀爀开䘀甀渀挀琀椀漀渀刀攀瀀氀礀 㴀 猀琀爀昀挀琀渀开䘀椀氀氀一攀砀琀刀漀眀⠀琀砀琀开䌀漀氀㄀⸀吀攀砀琀Ⰰ 琀砀琀开䌀漀氀㈀⸀吀攀砀琀Ⰰ 琀砀琀开䌀漀氀㌀⸀吀攀砀琀Ⰰ 琀砀琀开䌀漀氀㐀⸀吀攀砀琀Ⰰ 琀砀琀开䌀漀氀㔀⸀吀攀砀琀Ⰰ 琀砀琀开䌀漀氀㘀⸀吀攀砀琀Ⰰ 琀砀琀开䌀漀氀㜀⸀吀攀砀琀⤀ഀഀ ਍    䔀渀搀 匀甀戀ഀഀ ਍ഀഀ Private Sub DGV_Delay_Timer_Tick(sender As System.Object, e As System.EventArgs) Handles DGV_Delay_Timer.Tick ਍        䤀开䐀攀氀愀礀开䘀氀愀最 㴀 ㄀ഀഀ End Sub ਍    ✀ ⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀ഀഀ ਍    ✀倀爀椀瘀愀琀攀 匀甀戀 䐀䜀嘀开䐀攀氀愀礀开吀椀洀攀⠀䈀礀嘀愀氀 䴀椀氀氀椀猀攀挀漀渀搀猀 䄀猀 䰀漀渀最⤀ഀഀ Private Function strfctn_DGV_Delay_Time(ByVal Milliseconds As Long) As String ਍ഀഀ I_Delay_Flag = 0 ਍        䐀䜀嘀开䐀攀氀愀礀开吀椀洀攀爀⸀䤀渀琀攀爀瘀愀氀 㴀 䴀椀氀氀椀猀攀挀漀渀搀猀   ✀ 㼀 匀攀挀漀渀搀猀ഀഀ DGV_Delay_Timer.Enabled = True ਍        䐀漀ഀഀ ' My.Application.DoEvents() '14429 ਍        䰀漀漀瀀 圀栀椀氀攀 ⠀䤀开䐀攀氀愀礀开䘀氀愀最 㴀  ⤀ഀഀ ਍        䐀䜀嘀开䐀攀氀愀礀开吀椀洀攀爀⸀䔀渀愀戀氀攀搀 㴀 䘀愀氀猀攀ഀഀ strfctn_DGV_Delay_Time = "strfctn_DGV_Delay_Time is done" ਍    䔀渀搀 䘀甀渀挀琀椀漀渀ഀഀ ਍    ✀ ⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀⌀ഀഀ ਍䔀渀搀 䌀氀愀猀猀ഀഀ