Public Class NewFp Private V_enterToTab As Boolean = False Private V_DeleteKey As Boolean = False Private V_CurrentDel As Boolean = False Private V_FIRSTINDEX As Integer = 0 Private V_NextRowindex As Integer = -1 Private A_Ubound As New ArrayList Private V_SpaceEdit As Boolean = True Private V_sameRHeight As Boolean = True Private v_Checkbox_ColIndex As Int16 = -1 Private v_ACellposLabel As ToolStripStatusLabel = Nothing Private v_ACellImeLabel As ToolStripStatusLabel = Nothing Private v_AMessageLabel As ToolStripStatusLabel = Nothing Private v_AEditStatusLabel As ToolStripStatusLabel = Nothing Public ÀüÁÙ°ªº¹»ç() As String Public ÇѱÛÇʵå() As String Public ´ÙÀ½ÁÙÇʵå¸í As String Public ±âº»½ºÅ¸ÀÏÀ妽º As Short Private v_AAutoAddrowInLast As ToolStripButton = Nothing 'Private V_AButtonAdd As ToolStripButton = Nothing '//Ãß°¡¹öư 'Private v_AButtonInsert As ToolStripButton = Nothing '//»ðÀÔ¹öư Public Event Arin_DataChanged(ByVal sender As Object, ByVal Status As String) '//¹Ì»ç¿ë Public Event Arin_AddRow(ByVal sender As Object, ByVal Status As String) '//¹Ì»ç¿ë Public Event Arin_InsertRow(ByVal sender As Object, ByVal Status As String) '//¹Ì»ç¿ë Public Event Arin_AddLog(ByVal sender As Object, ByVal msg As String) Public Event Arin_Before_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) '//Űº¸µå°¡ ´­·µÀ»‹š ¸ÕÀú ½ÇÇàÇÒ ÇÔ¼ö(ºäÀÇ keydownÀº ³ªÁß¿¡ ÀϾ´Ù) Public Event Arin_Before_EditModeOff(ByVal sender As Object, ByVal e As System.EventArgs) ' _ ' Public Property AButtonAdd() As ToolStripButton ' Get ' Return Me.V_AButtonAdd ' End Get ' Set(ByVal value As ToolStripButton) ' Me.V_AButtonAdd = value ' End Set 'End Property _ Public Property AAutoAddrowInLast() As ToolStripButton Get Return Me.v_AAutoAddrowInLast End Get Set(ByVal value As ToolStripButton) Me.v_AAutoAddrowInLast = value End Set End Property Private Sub Disp_Msg(ByVal msgstr As String) If Not v_AMessageLabel Is Nothing Then v_AMessageLabel.Text = "[ºä¸Þ¼¼Áö] : " & msgstr & Space(1) & Now.ToString v_AMessageLabel.ForeColor = Color.Green My.Computer.Audio.PlaySystemSound(Media.SystemSounds.Hand) End If End Sub _ Public Property AEditStatusLabel() As ToolStripStatusLabel Get Return Me.v_AEditStatusLabel End Get Set(ByVal value As ToolStripStatusLabel) Me.v_AEditStatusLabel = value End Set End Property _ Public Property AMessageLabel() As ToolStripStatusLabel Get Return Me.v_AMessageLabel End Get Set(ByVal value As ToolStripStatusLabel) Me.v_AMessageLabel = value End Set End Property _ Public Property ACellposLabel() As ToolStripStatusLabel Get Return Me.v_ACellposLabel End Get Set(ByVal value As ToolStripStatusLabel) Me.v_ACellposLabel = value End Set End Property _ Public Property ACellImeLabel() As ToolStripStatusLabel Get Return Me.v_ACellImeLabel End Get Set(ByVal value As ToolStripStatusLabel) Me.v_ACellImeLabel = value End Set End Property _ Public Property ACheckBox_ColIndex() As Int16 Get Return v_Checkbox_ColIndex End Get Set(ByVal value As Int16) v_Checkbox_ColIndex = value End Set End Property _ Public Property ASameRowheight() As Boolean Get Return V_sameRHeight End Get Set(ByVal value As Boolean) V_sameRHeight = value End Set End Property _ Public Property AEditFromSpace() As Boolean Get Return V_SpaceEdit End Get Set(ByVal value As Boolean) V_SpaceEdit = value End Set End Property Public Sub ArinSearch() Dim Frow, Fcol As Integer Me.Search(Me.ActiveSheetIndex, InputBox("¼±ÅÃµÈ ¿­¿¡¼­ °Ë»öÇÒ ¹®ÀÚ¸¦ ÀÔ·ÂÇϼ¼¿ä.", "°Ë»ö¹®ÀÚ¸¦ ÀÔ·ÂÇϼ¼¿ä"), False, False, False, True, True, False, False, 0, 0, Frow, Fcol) If Frow >= 0 AndAlso Fcol >= 0 Then '//°Ë»öµÌ´Ù¸é Me.ActiveSheet.SetActiveCell(Frow, Fcol) SendKeys.Send("{ENTER}") End If End Sub ''' ''' Áߺ¹°Ë»ç·çƾ¿¡¼­ »ç¿ëÇÏ´Â ÇÔ¼ö ''' ''' ''' ''' ''' ''' Private Function DupCheckBool(ByVal num1 As Integer, ByVal num2 As Integer, ByVal Source As ArrayList) As Boolean If Source Is Nothing Then Return False If Source.IndexOf(num1) >= 0 Then Return True If Source.IndexOf(num2) >= 0 Then Return True Return False End Function ''' ''' Áߺ¹µÈ µ¥ÀÌÅ͸¦ °Ë»öÇÕ´Ï´Ù. startindex = ½ÃÀÛÇÒ ÁÙ¹øÈ£,endindex = Á¾·áÇÒ ÁÙ¹øÈ£, source °Ë»ö¿øº»ÀÇ ¿­¹øÈ£µé, target °Ë»ö´ë»óÀÇ ¿­¹øÈ£µé ''' °Ë»ö¿Ï·áÈÄ Àüü Áߺ¹µÈ °¹¼ö¸¦ ¸®ÅÏÇÕ´Ï´Ù. ''' ''' ''' ''' ''' ''' ''' Public Function ADupCheck(ByVal StartIndex As Integer, ByVal EndIndex As Integer, ByVal Source() As Short, ByVal Tartger() As Short, Optional ByVal CheckColnum As Short = -1, Optional ByVal CheckValue As Boolean = True, Optional ByVal ¼³¸í¿­ As Short = -1, Optional ByVal ¼³¸í As String = "", Optional ByVal PBar As ProgressBar = Nothing) As ArrayList '''''°Ë»ö¹æ¹ýÀº 1¹ø°³Ã¼ºÎÅÍ ¸¶Áö¸·°³Ã¼±îÁö Ç®·çÇÁ¸¦ µ¹¸é¼­ µ¿ÀÏÇÑ ³ðÀ» ã´Â´Ù. Dim ¿øº», ´ë»ó As String 'New System.Text.StringBuilder Dim DupList As New ArrayList Dim fcnt As Integer = 0 If Not PBar Is Nothing Then PBar.Value = StartIndex PBar.Minimum = StartIndex PBar.Maximum = EndIndex End If For A As Integer = StartIndex To EndIndex 'MsgBox(StartIndex & "/" & EndIndex) ¿øº» = "" For Each T As Short In Source ¿øº» &= Me.ActiveSheet.Cells(A, T).Value Next If ¿øº».ToString <> "" Then For B As Integer = StartIndex To EndIndex If A <> B AndAlso Not DupCheckBool(A, B, DupList) Then '//°°Àº¶óÀÎÀº ÇÇÇÏ°í ±×·¸Áö ¾ÊÀº ¶óÀÎÀÇ ¹øÈ£¸¦ È®ÀÎÇÑ´Ù. ´ë»ó = "" For Each T As Short In Tartger ´ë»ó &= Me.ActiveSheet.Cells(B, T).Value Next 'MsgBox(¿øº» & "/" & ´ë»ó) If ¿øº».ToString = ´ë»ó.ToString Then 'MsgBox(¿øº») If DupList Is Nothing Then DupList = New ArrayList DupList.Add(A) DupList.Add(B) fcnt += 1 If CheckColnum > -1 Then Me.ActiveSheet.Cells(A, CheckColnum).Value = CheckValue Me.ActiveSheet.Cells(B, CheckColnum).Value = CheckValue End If If ¼³¸í¿­ > -1 Then Me.ActiveSheet.Cells(A, ¼³¸í¿­).Value &= "[" & A + 1 & "/" & B + 1 & "]" & ¼³¸í '//¼³¸íÇϵµ·ÏÇÞÀ»½Ã¿¡ Me.ActiveSheet.Cells(B, ¼³¸í¿­).Value &= "[" & A + 1 & "/" & B + 1 & "]" & ¼³¸í '//¼³¸íÇϵµ·ÏÇÞÀ»½Ã¿¡ End If End If End If Next End If If Not PBar Is Nothing Then If PBar.Value < PBar.Maximum Then PBar.Value += 1 Me.Invalidate() End If Next Return DupList 'NOTICE("[ÀüÁÖ¹øÈ£] Áߺ¹°Ë»ç ¿Ï·á(" & fcnt & "°³ÀÇ µ¥ÀÌÅ͸¦ ã¾Ò½À´Ï´Ù)", Me.lb_msg) End Function Public Function ADupCheck2(ByVal StartIndex As Integer, ByVal EndIndex As Integer, ByVal Source() As Short, ByVal Tartger() As Short, Optional ByVal CheckColnum As Short = -1, Optional ByVal PBar As ProgressBar = Nothing) As Integer '''''°Ë»ö¹æ¹ýÀº 1¹ø°³Ã¼ºÎÅÍ ¸¶Áö¸·°³Ã¼±îÁö Ç®·çÇÁ¸¦ µ¹¸é¼­ µ¿ÀÏÇÑ ³ðÀ» ã´Â´Ù. Dim ¿øº», ´ë»ó As String 'New System.Text.StringBuilder Dim fcnt As Integer = 0 If Not PBar Is Nothing Then PBar.Value = StartIndex PBar.Minimum = StartIndex PBar.Maximum = EndIndex End If For A As Integer = StartIndex To EndIndex ¿øº» = "" For Each T As Short In Source ¿øº» &= Me.ActiveSheet.Cells(A, T).Value Next If ¿øº».Trim.ToString <> "" Then For B As Integer = StartIndex To EndIndex If A <> B Then '//°°Àº¶óÀÎÀº ÇÇÇÏ°í ±×·¸Áö ¾ÊÀº ¶óÀÎÀÇ ¹øÈ£¸¦ È®ÀÎÇÑ´Ù. ´ë»ó = "" For Each T As Short In Tartger ´ë»ó &= Me.ActiveSheet.Cells(B, T).Value Next If ¿øº».Trim.ToString = ´ë»ó.Trim.ToString Then fcnt += 1 If CheckColnum > -1 Then Me.ActiveSheet.Cells(A, CheckColnum).Value = True Me.ActiveSheet.Cells(B, CheckColnum).Value = True End If End If End If Next End If If Not PBar Is Nothing Then If PBar.Value < PBar.Maximum Then PBar.Value += 1 Me.Invalidate() End If Next Return fcnt 'NOTICE("[ÀüÁÖ¹øÈ£] Áߺ¹°Ë»ç ¿Ï·á(" & fcnt & "°³ÀÇ µ¥ÀÌÅ͸¦ ã¾Ò½À´Ï´Ù)", Me.lb_msg) End Function ''' ''' Áߺ¹°Ë»ç °°ÀºÁÙ ''' ''' ''' ''' ''' ''' ''' ''' ''' ''' Public Function AdupCheckSR(ByVal StartIndex As Integer, ByVal EndIndex As Integer, ByVal Source() As Short, ByVal Tartger() As Short, Optional ByVal CheckColnum As Short = -1, Optional ByVal PBar As ProgressBar = Nothing, Optional ByVal TrueDirection As Boolean = True) As Integer Dim ¿øº», ´ë»ó As String 'New System.Text.StringBuilder Dim fcnt As Integer = 0 Dim Can As Boolean = False If Not PBar Is Nothing Then : PBar.Value = StartIndex : PBar.Minimum = StartIndex : PBar.Maximum = EndIndex : End If For A As Integer = StartIndex To EndIndex ¿øº» = "" : ´ë»ó = "" Can = False For Each T As Short In Source ¿øº» &= Me.ActiveSheet.Cells(A, T).Value Next For Each T As Short In Tartger ´ë»ó &= Me.ActiveSheet.Cells(A, T).Value Next If ¿øº».Trim.ToString <> "" Then If TrueDirection = True Then If ¿øº».Trim.ToString = ´ë»ó.Trim.ToString Then Can = True Else If ¿øº».Trim.ToString <> ´ë»ó.Trim.ToString Then Can = True End If If Can Then fcnt += 1 If CheckColnum > -1 Then Me.ActiveSheet.Cells(A, CheckColnum).Value = True End If End If If Not PBar Is Nothing Then If PBar.Value < PBar.Maximum Then PBar.Value += 1 Me.Invalidate() End If Next Return fcnt End Function ''' ''' Áߺ¹°Ë»ç °°ÀºÁÙ °ø¶õÆ÷ÇÔ ''' ''' ''' ''' ''' ''' ''' ''' ''' ''' Public Function ADupCheckSr_inBlank(ByVal StartIndex As Integer, ByVal EndIndex As Integer, ByVal Source() As Short, ByVal Tartger() As Short, Optional ByVal CheckColnum As Short = -1, Optional ByVal PBar As ProgressBar = Nothing, Optional ByVal TrueDirection As Boolean = True) As Integer Dim ¿øº», ´ë»ó As String 'New System.Text.StringBuilder Dim fcnt As Integer = 0 Dim Can As Boolean = False If Not PBar Is Nothing Then : PBar.Value = StartIndex : PBar.Minimum = StartIndex : PBar.Maximum = EndIndex : End If For A As Integer = StartIndex To EndIndex ¿øº» = "" : ´ë»ó = "" Can = False For Each T As Short In Source ¿øº» &= Me.ActiveSheet.Cells(A, T).Text Next For Each T As Short In Tartger ´ë»ó &= Me.ActiveSheet.Cells(A, T).Text Next If TrueDirection = True Then If ¿øº».Trim.ToString = ´ë»ó.Trim.ToString Then Can = True Else If ¿øº».Trim.ToString <> ´ë»ó.Trim.ToString Then Can = True End If If Can Then fcnt += 1 If CheckColnum > -1 Then Me.ActiveSheet.Cells(A, CheckColnum).Value = True End If If Not PBar Is Nothing Then If PBar.Value < PBar.Maximum Then PBar.Value += 1 Me.Invalidate() End If Next Return fcnt End Function ''' ''' ÇöÀçÀ§Ä¡ À§¿¡ »õ·Î¿î ÇàÀ» Ãß°¡ÇÕ´Ï´Ù(¹Ù¿îµå Àû¿ëµÊ) ''' ''' Public Sub AInsertNewRow() If Not Me.Focused Then Me.Focus() Me.ActiveSheet.Rows.Add(Me.ActiveSheet.ActiveRowIndex, 1) Me.ActiveSheet.SetActiveCell(Me.ActiveSheet.ActiveRowIndex, Me.AFirstColumn_Index) End Sub ''' ''' ¸¶Áö¸·¿¡ »õ·Î¿î ÇàÀ» Ãß°¡ÇÕ´Ï´Ù(¹Ù¿îµå Àû¿ëµÊ) ''' ''' Public Sub AAddNewRow() If Not Me.Focused Then Me.Focus() 'Me.ActiveSheet.RowCount += 1 Me.ActiveSheet.Rows.Add(Me.ActiveSheet.RowCount, 1) Me.ActiveSheet.SetActiveCell(Me.ActiveSheet.RowCount, Me.AFirstColumn_Index) SendKeys.Send("{UP}") SendKeys.Send("{DOWN}") End Sub ''' ''' ¸¶Áö¸·¿¡ »õ·Î¿î ÇàÀ» Ãß°¡ÇÕ´Ï´Ù.(¹Ù¿îµåÀû¿ë¾ÈµÊ) ''' ''' Public Sub AAddNewRowU() If Not Me.Focused Then Me.Focus() Dim Idx As Integer Me.ActiveSheet.AddUnboundRows(Me.ActiveSheet.RowCount, 1) Idx = Me.ActiveSheet.RowCount - 1 Me.ActiveSheet.Rows(Idx).Tag = "UNBOUND" Me.ActiveSheet.SetActiveCell(Me.ActiveSheet.RowCount, AFirstColumn_Index) SendKeys.Send("{ENTER}") End Sub _ Public Property ANextRow_ColIndex() As Integer Get Return V_NextRowindex End Get Set(ByVal value As Integer) V_NextRowindex = value End Set End Property _ Public Property AFirstColumn_Index() As Integer Get Return V_FIRSTINDEX End Get Set(ByVal value As Integer) V_FIRSTINDEX = value End Set End Property _ Public Property ADeleteCell() As Boolean Get Return V_CurrentDel End Get Set(ByVal value As Boolean) V_CurrentDel = value End Set End Property _ Public Property ADeleteRow() As Boolean Get Return V_DeleteKey End Get Set(ByVal value As Boolean) V_DeleteKey = value End Set End Property ''' ''' Ä¿¼­¸¦ ´ÙÀ½¼¿·Î À̵¿ (¹®Á¦°¡ Á» ÀÖ´Ù ¿­³Êºñ 0Àΰ͵鿡´ëÇØ¼­ ''' ''' Public Sub ANext_Cell() '//Ä¿¼­¸¦ ´ÙÀ½¼¿·Î À̵¿ÇÑ´Ù. ´ÙÀ½¼¿ÀÇ ³Êºñ°¡ 0À̰ųª tabstop ÀÌ false ÀÌ¸é ±× ´ÙÀ½À¸·Î À̵¿ÇÑ´Ù. Dim index As Integer = 0 Start: index += 1 If Me.ActiveColumnindex + index >= Me.ActiveSheet.Columns.Count Then RaiseEvent Arin_AddLog(Me, "[ANEXT_CELL] ´ÙÀ½¿­¹øÈ£°¡ ¸¶Áö¸·¿­À̹ǷΠ¸®ÅÏ(ÇöÀç¿­¹øÈ£/Àüüī¿îÆ®:" & Me.ActiveColumnindex + index & "/" & Me.ActiveSheet.Columns.Count) If Me.ActiveRowindex = Me.ActiveSheet.RowCount - 1 Then '//¸¶Áö¸·ÁÙ¿¡°É·ÇÀ¸¸é Ãß°¡ If Not Me.v_AAutoAddrowInLast Is Nothing Then v_AAutoAddrowInLast.PerformClick() RaiseEvent Arin_AddLog(Me, "[ANEXT_CELL] ´ÙÀ½¿­¹øÈ£°¡ ¸¶Áö¸·¿­À̹ǷΠÇÑÁÙÃß°¡Çؾ߰ڴÙ.(ÇöÀç¿­¹øÈ£/Àüüī¿îÆ®:" & Me.ActiveColumnindex + index & "/" & Me.ActiveSheet.Columns.Count) Else RaiseEvent Arin_AddLog(Me, "[ANEXT_CELL] ´ÙÀ½¿­¹øÈ£°¡ ¸¶Áö¸·¿­À̹ǷΠ´ÙÀ½Áٷΰ¡¾ßÇÒ°æ¿ì°°´Ù(ÇöÀç¿­¹øÈ£/Àüüī¿îÆ®:" & Me.ActiveColumnindex + index & "/" & Me.ActiveSheet.Columns.Count) Me.ANEXT_ROW() End If Return '//¸¶Áö¸·¿­À̶ó¸é ±×³É ¸®ÅÏ End If If Me.ActiveSheet.Columns(Me.ActiveColumnindex + index).Width = 0 Or Me.ActiveSheet.Columns(Me.ActiveColumnindex + index).TabStop = False Then GoTo Start End If SendKeys.Send(vbTab) 'Me.ActiveSheet.SetActiveCell(Me.ActiveRowindex, Me.ActiveColumnindex + index) 'If Me.ActiveSheet.ActiveRowIndex <> Me.ActiveSheet.RowCount - 1 Then '//¸¶Áö¸·ÁÙÀÌ ¾Æ´Ï¸é ' If Me.ActiveSheet.ActiveColumnIndex = Me.ANextRow_ColIndex OrElse Me.ActiveSheet.ActiveColumnIndex = Me.ActiveSheet.ColumnCount - 1 Then '/¸¶Áö¸·¿­ÀÌ¸é ´ÙÀ½Á٠÷À¸·Î À̵¿ ' 'SendKeys.Send("{TAB}") ' MsgBox(Me.ActiveSheet.ActiveColumnIndex & "/" & Me.AFirstColumn_Index) ' Me.ActiveSheet.ActiveRowIndex += 1 ' Me.ActiveSheet.ActiveColumnIndex = V_FIRSTINDEX '//ùÀ妽º·Î ¿È±ä´Ù.±âº»°ªÀº 0ÀÌ´Ù. ' 'Me.ActiveSheet.SetActiveCell(Me.ActiveSheet.ActiveRowIndex + 1, V_FIRSTINDEX) ' Else ' 'SendKeys.Send("{TAB}") ' 'Me.ActiveSheet.SetActiveCell(Me.ActiveSheet.ActiveRowIndex, Me.ActiveSheet.ActiveColumnIndex + 1) ' 'Me.ActiveSheet.IsSelected(Me.ActiveSheet.ActiveRowIndex, Me.ActiveSheet.ActiveColumnIndex + 1) ' 'ME.ActiveSheet.SEL ' If Me.ActiveSheet.Columns(Me.ActiveColumnindex + 1).Width = 0 Or Then ' GoTo Start ' Else ' Me.ActiveSheet.ActiveColumnIndex += 1 ' End If ' End If 'Else '//¸¶Áö¸·ÁÙÀ϶§ ' If Me.ActiveSheet.ActiveColumnIndex = Me.ANextRow_ColIndex OrElse Me.ActiveSheet.ActiveColumnIndex <> Me.ActiveSheet.ColumnCount - 1 Then '/¸¶Áö¸·¿­ÀÌ¸é ´ÙÀ½Á٠÷À¸·Î À̵¿ ' 'Me.ActiveSheet.ActiveRowIndex += 1 ' If Not Me.AAutoAddrowInLast Is Nothing Then ' Me.AAutoAddrowInLast.PerformClick() ' End If ' Else ' If Me.ActiveSheet.Columns(Me.ActiveColumnindex + 1).Width = 0 Then ' GoTo Start ' Else ' Me.ActiveSheet.ActiveColumnIndex += 1 ' End If ' End If Dim Ee As New FarPoint.Win.Spread.EnterCellEventArgs(Nothing, Me.ActiveSheet.ActiveRowIndex, Me.ActiveSheet.ActiveColumnIndex) NewFp_EnterCell(Nothing, Ee) '//ÀÌÈÄ¿¡ ¿£Åͼ¿ÀÌ ¹ß»ýÇÏÁö¾ÊÀ¸¹Ç·Î ¹ß»ý½ÃÄÑÁØ´Ù. 'End If End Sub ''' ''' Ä¿¼­¸¦ ÀÌÀü¼¿·Î À̵¿ ''' ''' Public Sub APrev_Cell() If Me.ActiveSheet.ActiveRowIndex <> 0 Then '//ùÁÙÀÌ ¾Æ´Ï¸é If Me.ActiveSheet.ActiveColumnIndex = 0 Then '/ù¿­À̸é ÀÌÀüÁ٠÷À¸·Î À̵¿ 'SendKeys.Send("{TAB}") Me.ActiveSheet.ActiveRowIndex -= 1 Me.ActiveSheet.ActiveColumnIndex = V_FIRSTINDEX '//ùÀ妽º·Î ¿È±ä´Ù.±âº»°ªÀº 0ÀÌ´Ù. 'Me.ActiveSheet.SetActiveCell(Me.ActiveSheet.ActiveRowIndex + 1, V_FIRSTINDEX) Else 'SendKeys.Send("{TAB}") 'Me.ActiveSheet.SetActiveCell(Me.ActiveSheet.ActiveRowIndex, Me.ActiveSheet.ActiveColumnIndex + 1) 'Me.ActiveSheet.IsSelected(Me.ActiveSheet.ActiveRowIndex, Me.ActiveSheet.ActiveColumnIndex + 1) 'ME.ActiveSheet.SEL Me.ActiveSheet.ActiveColumnIndex -= 1 End If Else If Me.ActiveSheet.ActiveColumnIndex <> 0 Then '/ù¿­ÀÌ ¾Æ´Ï¸é 'Me.ActiveSheet.ActiveRowIndex += 1 Me.ActiveSheet.ActiveColumnIndex -= 1 '//ùÀ妽º·Î ¿È±ä´Ù.±âº»°ªÀº 0ÀÌ´Ù. End If End If End Sub ''' ''' Ä¿¼­¸¦ ´ÙÀ½ÁÙ·Î À̵¿ ''' ''' Public Sub ANEXT_ROW() If Me.ActiveSheet.ActiveRowIndex <> (Me.ActiveSheet.RowCount - 1) Then '//¸¶Áö¸·ÁÙÀÌ ¾Æ´Ï¸é Me.ActiveSheet.ActiveRowIndex += 1 Me.ActiveSheet.ActiveColumnIndex = V_FIRSTINDEX '//ùÀ妽º·Î ¿È±ä´Ù.±âº»°ªÀº 0ÀÌ´Ù. End If Dim Ee As New FarPoint.Win.Spread.EnterCellEventArgs(Nothing, Me.ActiveSheet.ActiveRowIndex, Me.ActiveSheet.ActiveColumnIndex) NewFp_EnterCell(Nothing, Ee) '//ÀÌÈÄ¿¡ ¿£Åͼ¿ÀÌ ¹ß»ýÇÏÁö¾ÊÀ¸¹Ç·Î ¹ß»ý½ÃÄÑÁØ´Ù. End Sub ''' ''' Ä¿¼­¸¦ ÀÌÀüÁÙ·Î À̵¿ ''' ''' Public Sub APrev_ROW() If Me.ActiveSheet.ActiveRowIndex <> 0 Then '//ùÁÙÀÌ ¾Æ´Ï¸é Me.ActiveSheet.ActiveRowIndex -= 1 Me.ActiveSheet.ActiveColumnIndex = V_FIRSTINDEX '//ùÀ妽º·Î ¿È±ä´Ù.±âº»°ªÀº 0ÀÌ´Ù. End If End Sub ''' ''' ¼±ÅÃÁÙ¹øÈ£¿¡ÀÇÇϰųª ÀÔ·ÂÇÑ ¿­¹øÈ£¿¡ True °ªÀ» Àü´ÞÇÕ´Ï´Ù.(üũ¹Ú½º üũ¿ëµµ) ''' ''' ''' Public Sub ASelect(Optional ByVal Columnindex As Int16 = -1) Dim sheet As FarPoint.Win.Spread.SheetView = Me.ActiveSheet If Columnindex = -1 AndAlso Me.ACheckBox_ColIndex <> -1 Then Columnindex = Me.ACheckBox_ColIndex '//ÁöÁ¤µÈ¿­Á¦¸ñÀÌ ÀÕ´ÂÁö sheet.AutoFilterReset(Columnindex) For i As Integer = 0 To sheet.RowCount - 1 sheet.Cells(i, Columnindex).Value = True Next End Sub ''' ''' ¼±ÅÃÁÙ¹øÈ£¿¡ÀÇÇϰųª ÀÔ·ÂµÈ ¿­¹øÈ£¿¡ FALSE °ªÀ» Àü´ÞÇÕ´Ï´Ù..(üũ¹Ú½º ÇØÁ¦¿ëµµ) ''' ''' ''' Public Sub AUnselect(Optional ByVal index As Int16 = -1) Dim sheet As FarPoint.Win.Spread.SheetView = Me.ActiveSheet If index = -1 AndAlso Me.ACheckBox_ColIndex <> -1 Then index = Me.ACheckBox_ColIndex '//ÁöÁ¤µÈ¿­Á¦¸ñÀÌ ÀÕ´ÂÁö sheet.AutoFilterReset(index) For i As Integer = 0 To sheet.RowCount - 1 sheet.Cells(i, index).Value = False Next End Sub ''' ''' checkbox_colindex¿¡ÀÇÇϰųª ÀÔ·ÂµÈ ¿­¹øÈ£¸¦ °¡Áö°í ¼±ÅùÝÀü ½Ãŵ´Ï´Ù.(üũ¹Ú½º ¹ÝÀü) ''' ''' ''' Public Sub AReverse(Optional ByVal index As Int16 = -1) Dim sheet As FarPoint.Win.Spread.SheetView = Me.ActiveSheet If index = -1 AndAlso Me.ACheckBox_ColIndex <> -1 Then index = ACheckBox_ColIndex '//ÁöÁ¤µÈ¿­Á¦¸ñÀÌ ÀÕ´ÂÁö sheet.AutoFilterReset(index) For i As Integer = 0 To sheet.RowCount - 1 sheet.Cells(i, index).Value = IIf(sheet.Cells(i, index).Value = True, False, True) Next End Sub ''' ''' ÀÔ·ÂµÈ ÁÙ¹øÈ£¿Í ű×=µ¥ÀÌÅÍÇÊµå °¡ ÀÏÄ¡ÇÏ´Â ¼¿À» ¹ÝȯÇÕ´Ï´Ù. ''' ''' ''' ''' ''' ''' Public Function Cells(ByVal index As Integer, ByVal Tag As Object, Optional ByVal Sheetindex As Integer = -1) As FarPoint.Win.Spread.Cell Dim RetVal As FarPoint.Win.Spread.Cell = Nothing If Sheetindex = -1 Then Sheetindex = Me.ActiveSheetIndex For Each SC As FarPoint.Win.Spread.Column In Me.Sheets(Sheetindex).Columns If SC.DataField.ToUpper = Tag.ToString.ToUpper Then RetVal = Me.Sheets(Sheetindex).Cells(index, SC.Index) Exit For End If Next If RetVal Is Nothing Then MsgBox("Can't Find column [" & Tag.ToString & "]", MsgBoxStyle.Critical, "Farpoint function Cells") End If Return RetVal End Function ''' ''' ÇöÀç¼±ÅÃµÈ ÁÙÀÇ ¿­¹øÈ£¿¡ÇØ´çÇÏ´Â ¼¿À» ¹ÝȯÇÕ´Ï´Ù. ''' ''' ''' ''' ''' Public Function Cells(ByVal Columnindex As Integer, Optional ByVal Sheetindex As Integer = -1) As FarPoint.Win.Spread.Cell Dim RetVal As FarPoint.Win.Spread.Cell = Nothing If Sheetindex = -1 Then Sheetindex = Me.ActiveSheetIndex Return Me.Sheets(Sheetindex).Cells(Me.ActiveSheet.ActiveRowIndex, Columnindex) Return RetVal End Function ''' ''' ÇöÀç¼±ÅÃµÈ ¼¿À» ¹ÝȯÇÕ´Ï´Ù ''' ''' ''' Public Function Cells() As FarPoint.Win.Spread.Cell Dim RetVal As FarPoint.Win.Spread.Cell = Nothing Return Me.ActiveSheet.Cells(Me.ActiveRowindex, Me.ActiveColumnindex) Return RetVal End Function ''' ''' ÀüÁÙÀÇ ÇöÀç¿­À§Ä¡ ¼¿À» ¹Ýȯ ''' ''' ''' ''' Public Function CellsPR(Optional ByVal FirstrowValueisNothing As Boolean = False) As FarPoint.Win.Spread.Cell If FirstrowValueisNothing AndAlso Me.ActiveRowindex = 0 Then Return Nothing If Me.ActiveRowindex = 0 Then If FirstrowValueisNothing Then Return Nothing Else Return Me.ActiveSheet.ActiveCell End If Else Return Me.ActiveSheet.Cells(Me.ActiveRowindex - 1, Me.ActiveColumnindex) End If End Function ''' ''' ¾Õ¼¿À» ¹Ýȯ ''' ''' ''' ''' Public Function CellsPC(Optional ByVal FirstColValueisNothing As Boolean = False) As FarPoint.Win.Spread.Cell If FirstColValueisNothing AndAlso Me.ActiveColumnindex = 0 Then Return Nothing If Me.ActiveColumnindex = 0 Then If FirstColValueisNothing Then Return Nothing Else Return Me.ActiveSheet.ActiveCell End If Else Return Me.ActiveSheet.Cells(Me.ActiveRowindex, Me.ActiveColumnindex - 1) End If End Function ''' ''' ÀÔ·ÂµÈ ÅÂ±×¿Í µ¥ÀÌÅÍÇʵ尡 ÀÏÄ¡ÇÏ´Â ¼¿À» ¹ÝȯÇÕ´Ï´Ù.(ÁÙ¹øÈ£´Â ÇöÀçÁÙ) ''' ''' ''' ''' ''' Public Function Cells(ByVal Tag As Object, Optional ByVal Sheetindex As Integer = -1) As FarPoint.Win.Spread.Cell Dim RetVal As FarPoint.Win.Spread.Cell = Nothing If Sheetindex = -1 Then Sheetindex = Me.ActiveSheetIndex For Each SC As FarPoint.Win.Spread.Column In Me.Sheets(Sheetindex).Columns If SC.DataField.ToUpper = Tag.ToString.ToUpper Then RetVal = Me.Sheets(Sheetindex).Cells(Me.ActiveRowindex, SC.Index) Exit For End If Next If RetVal Is Nothing Then MsgBox("Can't Find column [" & Tag.ToString & "]", MsgBoxStyle.Critical, "Farpoint function Cells") End If Return RetVal End Function ''' ''' ÀÔ·ÂµÈ ÅÂ±×¿Í µ¥ÀÌÅÍÇʵ尡 ÀÏÄ¡ÇÏ´Â ¼¿À» ¹ÝȯÇÕ´Ï´Ù.(ÁÙ¹øÈ£´Â ÀüÁÙ) ''' ''' ''' ''' ''' Public Function CellsR(ByVal Tag As Object, Optional ByVal Sheetindex As Integer = -1) As FarPoint.Win.Spread.Cell Dim RetVal As FarPoint.Win.Spread.Cell = Nothing Dim Rindex As Integer = Me.ActiveSheet.ActiveRowIndex : If Rindex > 0 Then Rindex -= 1 If Sheetindex = -1 Then Sheetindex = Me.ActiveSheetIndex For Each SC As FarPoint.Win.Spread.Column In Me.Sheets(Sheetindex).Columns If SC.DataField.ToUpper = Tag.ToString.ToUpper Then RetVal = Me.Sheets(Sheetindex).Cells(Rindex, SC.Index) Exit For End If Next If RetVal Is Nothing Then MsgBox("Can't Find column [" & Tag.ToString & "]", MsgBoxStyle.Critical, "Farpoint function Cells") End If Return RetVal End Function ''' ''' ÀԷµÈű×(ű״ ·¹À̺í¸í)¿Í ÀÏÄ¡ÇÏ´Â ¼¿À» ¹ÝȯÇÕ´Ï´Ù.(ÁÙ¹øÈ£´Â ÇöÀçÁÙ) ''' ''' ''' ''' ''' Public Function Cells2(ByVal Tag As String, Optional ByVal Sheetindex As Integer = -1) As FarPoint.Win.Spread.Cell Dim RetVal As FarPoint.Win.Spread.Cell = Nothing If Sheetindex = -1 Then Sheetindex = Me.ActiveSheetIndex For Each SC As FarPoint.Win.Spread.Column In Me.Sheets(Sheetindex).Columns If SC.Label.ToUpper = Tag.ToString.ToUpper Then RetVal = Me.Sheets(Sheetindex).Cells(Me.ActiveRowindex, SC.Index) Exit For End If Next If RetVal Is Nothing Then MsgBox("Can't Find column [" & Tag.ToString & "]", MsgBoxStyle.Critical, "Farpoint function Cells") End If Return RetVal End Function ''' ''' ÀԷµÈű×(ű״ ·¹À̺í¸í)¿Í ÀÏÄ¡ÇÏ´Â ¿­À» ¹ÝȯÇÕ´Ï´Ù.(ÁÙ¹øÈ£´Â ÇöÀçÁÙ) ''' ''' ''' ''' ''' Public Function Column2(ByVal Tag As String, Optional ByVal Sheetindex As Integer = -1) As FarPoint.Win.Spread.Column Dim RetVal As FarPoint.Win.Spread.Column = Nothing If Sheetindex = -1 Then Sheetindex = Me.ActiveSheetIndex For Each SC As FarPoint.Win.Spread.Column In Me.Sheets(Sheetindex).Columns If SC.Label.ToUpper = Tag.ToString.ToUpper Then Return SC End If Next MsgBox("Can't Find column [" & Tag.ToString & "]", MsgBoxStyle.Critical, "Farpoint function column2") Return Nothing End Function ''' ''' Çʵ巹À̺í°ú ÀÏÄ¡ÇÏ´Â ¿­ÀÇ À§Ä¡¸¦ ¹ÝȯÇÕ´Ï´Ù. ''' ''' ''' ''' ''' Public Function ColIndex2(ByVal Tag As String, Optional ByVal Sheetindex As Integer = -1) As Integer Dim RetVal As Integer = -1 If Sheetindex = -1 Then Sheetindex = Me.ActiveSheetIndex For Each SC As FarPoint.Win.Spread.Column In Me.Sheets(Sheetindex).Columns If SC.Label.ToUpper = Tag.ToString.ToUpper Then RetVal = SC.Index Exit For End If Next If RetVal = -1 Then MsgBox("Can't Find column [" & Tag.ToString & "]", MsgBoxStyle.Critical, "Farpoint function Cells") End If Return RetVal End Function ''' ''' ¿­ÀÇ µ¥ÀÌÅÍÇʵå¿Í ÀÏÄ¡Çϴ¿­ ¹øÈ£¸¦ ¹Ýȯ ''' ''' ''' ''' ''' Public Function ColIndex(ByVal DataField As String, Optional ByVal Sheetindex As Integer = -1) As Integer Dim RetVal As Integer = -1 If Sheetindex = -1 Then Sheetindex = Me.ActiveSheetIndex For Each SC As FarPoint.Win.Spread.Column In Me.Sheets(Sheetindex).Columns If SC.DataField.ToUpper = DataField.ToString.ToUpper Then RetVal = SC.Index Exit For End If Next If RetVal = -1 Then MsgBox("Can't Find column [" & Tag.ToString & "]", MsgBoxStyle.Critical, "Farpoint function Cells") End If Return RetVal End Function ''' ''' ÀԷµÈű×(·¹À̺í¸í)¿Í ÀÏÄ¡ÇÏ´Â ¼¿À» ¹ÝȯÇÕ´Ï´Ù. ''' ''' ''' ''' ''' ''' Public Function Cells2(ByVal RowIndex As Integer, ByVal Tag As String, Optional ByVal Sheetindex As Integer = -1) As FarPoint.Win.Spread.Cell Dim RetVal As FarPoint.Win.Spread.Cell = Nothing If Sheetindex = -1 Then Sheetindex = Me.ActiveSheetIndex For Each SC As FarPoint.Win.Spread.Column In Me.Sheets(Sheetindex).Columns If SC.Label.ToUpper = Tag.ToString.ToUpper Then RetVal = Me.Sheets(Sheetindex).Cells(RowIndex, SC.Index) Exit For End If Next If RetVal Is Nothing Then MsgBox("Can't Find column Label [" & Tag.ToString & "]", MsgBoxStyle.Critical, "Farpoint function Cells") End If Return RetVal End Function ''' ''' ÀüÁÙÀ» ¹ÝȯÇÕ´Ï´Ù ''' ''' ''' Public Function GetProw() As FarPoint.Win.Spread.Row If Me.ActiveSheet.ActiveRowIndex = 0 Then Return Me.ActiveSheet.ActiveRow Return Me.ActiveSheet.Rows(Me.ActiveSheet.ActiveRowIndex - 1) End Function ''' ''' Ȱ¼ºÈ­µÈ ¿­Á¦¸ñÁÙÀ» ¹ÝȯÇÕ´Ï´Ù. ''' ''' ''' Public Function ActiveColumn() As FarPoint.Win.Spread.Column Return Me.ActiveSheet.Columns(Me.ActiveColumnindex) End Function ''' ''' Ȱ¼ºÈ­µÈ ÁÙ¹øÈ£¸¦ ¹Ýȯ ''' ''' ''' Public Function ActiveRowindex() As Integer Return Me.ActiveSheet.ActiveRowIndex End Function ''' ''' Ȱ¼ºÈ­µÈ ¿­¹öÈ£¸¦ ¹Ýȯ ''' ''' ''' Public Function ActiveColumnindex() As Integer Return Me.ActiveSheet.ActiveColumnIndex End Function Public Sub AViewSetting_Load(ByVal ÀüÁÙ°ªº¹»ç As String, ByVal ÇѱÛÇʵå As String, ByVal ´ÙÀ½ÁÙ¿­À̸§ As String, Optional ByVal Tag As String = "", Optional ByVal FN As String = "") '//ÆÄ¶ó¹ÌÅÍ´Â ±âº»°ªÀÌ´Ù iniÆÄÀÏ¿¡ Á¸ÀçÇÏÁö¾Ê¾ÒÀ»°æ¿ì »ç¿ëÇÑ´Ù. Dim File As New System.IO.FileInfo(My.Application.Info.DirectoryPath & "\" & FN & "spread.INI") Dim a As New tinyIni(File.FullName) If a.Exist = False Then Me.AViewSetting_Save(ÀüÁÙ°ªº¹»ç, ÇѱÛÇʵå, ´ÙÀ½ÁÙ¿­À̸§, Tag, FN) Dim ÀüÁÙ, ÇѱÛ, ´ÙÀ½ÁÙ As String Dim v±âº»½ºÅ¸ÀÏÀ妽º As Short ÀüÁÙ = a.Read(Me.Parent.Name & "-" & (Me.Name & Tag), "prerowcopy", ÀüÁÙ°ªº¹»ç) ÇÑ±Û = a.Read(Me.Parent.Name & "-" & (Me.Name & Tag), "hangulfield", ÇѱÛÇʵå) ´ÙÀ½ÁÙ = a.Read(Me.Parent.Name & "-" & (Me.Name & Tag), "nextcolumn", ´ÙÀ½ÁÙ¿­À̸§) v±âº»½ºÅ¸ÀÏÀ妽º = a.Read(Me.Parent.Name & "-" & (Me.Name & Tag), "defstyleindex", 0) Me.ÀüÁÙ°ªº¹»ç = ÀüÁÙ.Split(",") Me.ÇѱÛÇʵå = ÇѱÛ.Split(",") Me.´ÙÀ½ÁÙÇʵå¸í = ´ÙÀ½ÁÙ Me.±âº»½ºÅ¸ÀÏÀ妽º = v±âº»½ºÅ¸ÀÏÀ妽º End Sub Public Sub AViewSetting_Save(ByVal ÀüÁÙ°ªº¹»ç As String, ByVal ÇѱÛÇʵå As String, ByVal ´ÙÀ½ÁÙ¿­À̸§ As String, ByVal ±âº»½ºÅ¸ÀÏÀ妽º As Short, Optional ByVal Tag As String = "", Optional ByVal FN As String = "") '//ÆÄ¶ó¹ÌÅÍ´Â ±âº»°ªÀÌ´Ù iniÆÄÀÏ¿¡ Á¸ÀçÇÏÁö¾Ê¾ÒÀ»°æ¿ì »ç¿ëÇÑ´Ù. Dim File As New System.IO.FileInfo(My.Application.Info.DirectoryPath & "\" & FN & "spread.INI") Dim a As New tinyIni(File.FullName) If a.Exist = False Then a.Create() a.Write(Me.Parent.Name & "-" & (Me.Name & Tag), "prerowcopy", ÀüÁÙ°ªº¹»ç) a.Write(Me.Parent.Name & "-" & (Me.Name & Tag), "hangulfield", ÇѱÛÇʵå) a.Write(Me.Parent.Name & "-" & (Me.Name & Tag), "nextcolumn", ´ÙÀ½ÁÙ¿­À̸§) a.Write(Me.Parent.Name & "-" & (Me.Name & Tag), "defstyleindex", ±âº»½ºÅ¸ÀÏÀ妽º) End Sub ''' ''' ºäÀÇ ¿­³Êºñ,¿­À̸§(¿É¼Ç),ÁÜÆÑÅ͵îÀ» ÀúÀåÇÕ´Ï´Ù. ''' ''' ''' Public Sub ASetting_Save(Optional ByVal ColName As Boolean = True, Optional ByVal Tag As String = "", Optional ByVal FN As String = "") ColSize_Save(Tag, FN) If ColName Then ColName_Save(Tag, FN) CurrentState_Save(Tag, FN) AZOOM_Save(Tag, FN) End Sub ''' ''' ºäÀÇ ¿­³Êºñ,¿­À̸§(¿É¼Ç),ÁÜÆÑÅ͵îÀ» ºÒ·¯¿É´Ï´Ù ''' ''' ''' Public Sub ASetting_Load(Optional ByVal ColName As Boolean = True, Optional ByVal Tag As String = "", Optional ByVal FN As String = "") ColSize_Load(Tag, FN) If ColName Then ColName_Load(Tag, FN) CurrentState_Load(Tag, FN) AZOOM_LOAD(Tag, FN) End Sub ''' ''' ÇöÀç ¿­³Êºñ¸¦ Spread.ini ÆÄÀÏ¿¡ ÀúÀåÇÕ´Ï´Ù. ''' ''' Public Sub AZOOM_Save(ByVal tag As String, ByVal fn As String) Dim File As New System.IO.FileInfo(My.Application.Info.DirectoryPath & "\" & fn & "spread.INI") If System.IO.Directory.Exists(File.DirectoryName) = False Then System.IO.Directory.CreateDirectory(File.DirectoryName) Dim a As New tinyIni(File.FullName) a.Write(Me.Parent.Name & "-" & (Me.Name & tag), "ZOOM", Me.ActiveSheet.ZoomFactor) End Sub ''' ''' ÇöÀç ¿­³Êºñ¸¦ Spread.ini ÆÄÀÏ·Î ºÎÅÍ ºÒ·¯¿É´Ï´Ù. ''' ''' Public Sub AZOOM_LOAD(ByVal tag As String, ByVal fn As String) Dim FILEname As String = My.Application.Info.DirectoryPath & "\" & fn & "spread.INI" If Not System.IO.File.Exists(FILEname) Then MsgBox("¿­³Êºñ ÆÄÀÏÀÌ Á¸ÀçÇÏÁö ¾Ê½À´Ï´Ù", MsgBoxStyle.Critical, "¿­³Êºñ¼³Á¤-¿À·ù") ColSize_Save(tag, fn) Return End If 'MsgBox("PARENT" & Me.Parent.Name.ToString & "/" & Me.Parent.Text) Dim a As New tinyIni(FILEname) Me.ActiveSheet.ZoomFactor = a.Read(Me.Parent.Name & "-" & (Me.Name & tag), "ZOOM", 1) End Sub ''' ''' ÇöÀç ¿­³Êºñ¸¦ Spread.ini ÆÄÀÏ¿¡ ÀúÀåÇÕ´Ï´Ù. ''' ''' Public Sub ColSize_Save(ByVal tag As String, ByVal fn As String) Dim File As New System.IO.FileInfo(My.Application.Info.DirectoryPath & "\" & fn & "spread.INI") If System.IO.Directory.Exists(File.DirectoryName) = False Then System.IO.Directory.CreateDirectory(File.DirectoryName) Dim a As New tinyIni(File.FullName) For Each z As FarPoint.Win.Spread.Column In Me.ActiveSheet.Columns a.Write(Me.Parent.Name & "-" & (Me.Name & tag), "COLSIZE" & z.Index.ToString, z.Width) Next End Sub ''' ''' ÇöÀç ¿­³Êºñ¸¦ Spread.ini ÆÄÀÏ·Î ºÎÅÍ ºÒ·¯¿É´Ï´Ù. ''' ''' Public Sub ColSize_Load(ByVal tag As String, ByVal fn As String) Dim FILEname As String = My.Application.Info.DirectoryPath & "\" & fn & "spread.INI" If Not System.IO.File.Exists(FILEname) Then MsgBox("¿­³Êºñ ÆÄÀÏÀÌ Á¸ÀçÇÏÁö ¾Ê½À´Ï´Ù", MsgBoxStyle.Critical, "¿­³Êºñ¼³Á¤-¿À·ù") ColSize_Save(tag, fn) Return End If 'MsgBox("PARENT" & Me.Parent.Name.ToString & "/" & Me.Parent.Text) Dim a As New tinyIni(FILEname) For Each col As FarPoint.Win.Spread.Column In Me.ActiveSheet.Columns 'MsgBox(COL.Index) 'a.Write(Me.Parent.Name, "COLSIZE" & COL.Index.ToString, File, COL.Width) Try col.Width = a.Read(Me.Parent.Name & "-" & (Me.Name & tag), "COLSIZE" & col.Index.ToString) Catch ex As Exception '//¾øÀ»°æ¿ì¿¡´Â ¿¡·¯¸¦ ³»¹Ç·Î ±×³É ³ª°£´Ù End Try Next End Sub Public Sub ColName_Load(ByVal tag As String, ByVal fn As String) Dim FILEname As String = My.Application.Info.DirectoryPath & "\" & fn & "spread.INI" If Not System.IO.File.Exists(FILEname) Then MsgBox("¿­³Êºñ ÆÄÀÏÀÌ Á¸ÀçÇÏÁö ¾Ê½À´Ï´Ù", MsgBoxStyle.Critical, "¿­³Êºñ¼³Á¤-¿À·ù") ColSize_Save(tag, fn) Return End If 'MsgBox("PARENT" & Me.Parent.Name.ToString & "/" & Me.Parent.Text) Dim a As New tinyIni(FILEname) For Each col As FarPoint.Win.Spread.Column In Me.ActiveSheet.Columns 'MsgBox(COL.Index) 'a.Write(Me.Parent.Name, "COLSIZE" & COL.Index.ToString, File, COL.Width) Try col.Label = a.Read(Me.Parent.Name & "-" & Me.Name & tag, "COLNAME" & col.Index.ToString).ToString.Trim(Chr(0)) Catch ex As Exception '//¾øÀ»°æ¿ì¿¡´Â ¿¡·¯¸¦ ³»¹Ç·Î ±×³É ³ª°£´Ù End Try Next End Sub Public Sub ColName_Save(ByVal tag As String, ByVal fn As String) Dim File As New System.IO.FileInfo(My.Application.Info.DirectoryPath & "\" & fn & "spread.INI") If System.IO.Directory.Exists(File.DirectoryName) = False Then System.IO.Directory.CreateDirectory(File.DirectoryName) Dim a As New tinyIni(File.FullName) For Each z As FarPoint.Win.Spread.Column In Me.ActiveSheet.Columns a.Write(Me.Parent.Name & "-" & Me.Name & tag, "COLNAME" & z.Index.ToString, z.Label) Next End Sub ''' ''' [º¸Ãæ¿ä¸Á] :ÁÙ³ôÀ̸¦ ÀúÀå ''' ''' Public Sub CurrentState_Save(ByVal tag As String, ByVal fn As String) Dim File As New System.IO.FileInfo(My.Application.Info.DirectoryPath & "\" & fn & "spread.INI") If System.IO.Directory.Exists(File.DirectoryName) = False Then System.IO.Directory.CreateDirectory(File.DirectoryName) Dim a As New tinyIni(File.FullName) a.Write(Me.Parent.Name & "-" & Me.Name & tag, "RowHeight", Me.ActiveSheet.Rows.Default.Height) '//°íÁ¤¹®ÀÚ ÀúÀå End Sub ''' ''' [º¸Ãæ¿ä¸Á] :ÁÙ³ôÀ̸¦ ºÒ·¯¿Â´Ù.(spre.ini) ''' ''' Public Sub CurrentState_Load(ByVal tag As String, ByVal fn As String) Dim a As New tinyIni(My.Application.Info.DirectoryPath & "\" & fn & "spread.INI") If Not a.Exist Then MsgBox("¿­³Êºñ ÆÄÀÏÀÌ Á¸ÀçÇÏÁö ¾Ê½À´Ï´Ù", MsgBoxStyle.Critical, "¿­³Êºñ¼³Á¤-¿À·ù") CurrentState_Save(tag, fn) a = Nothing Return End If '//ÆÄÀÏÀÌ Á¸ÀçÇÒ¶§ ºÒ·¯¿Â´Ù. Me.ActiveSheet.Rows.Default.Height = a.Read(Me.Parent.Name & "-" & Me.Name & tag, "RowHeight", 20) '//°íÁ¤¹®ÀÚ¸¦ °¡Á®¿É´Ï´Ù. a = Nothing End Sub Private Sub Delete_itm(Optional ByVal rowindex As Integer = -1, Optional ByVal prompt As Boolean = True) Dim Commit As Boolean = True Dim A As New System.Text.StringBuilder("°æ°í : µ¥ÀÌÅÍ »èÁ¦¸¦ ¼±ÅÃÇß½À´Ï´Ù") A.AppendLine() A.AppendLine("ÇöÀç ¼±ÅÃµÈ ÁÙÀÌ »èÁ¦µË´Ï´Ù") A.AppendLine("°è¼ÓÇϽðڽÀ´Ï±î?") If prompt Then If MsgBox(A.ToString, MsgBoxStyle.Critical + MsgBoxStyle.OkCancel, "¼±ÅÃÁÙ »èÁ¦") <> MsgBoxResult.Ok Then Commit = False End If If Not Commit Then Return '//¸í·ÉÇÁ·ÒÇÁÆ®¿¡¼­ Ãë¼Ò¸¦ ¼±ÅÃÇÞÀ»½Ã¿¡´Â ºüÁ®³ª°£´Ù. Me.ActiveSheet.ActiveRow.Remove() End Sub Private Sub NewFp_Change(ByVal sender As Object, ByVal e As FarPoint.Win.Spread.ChangeEventArgs) Handles Me.Change If e.Column = Me.ACheckBox_ColIndex AndAlso Me.ActiveSheet.Cells(e.Row, Me.ACheckBox_ColIndex).Value = True Then '//¼±Åà Me.ActiveSheet.Rows(e.Row).BackColor = Color.LightGreen Else Me.ActiveSheet.Rows(e.Row).BackColor = Color.White End If End Sub Private Sub NewFp_EditModeOff(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.EditModeOff RaiseEvent Arin_Before_EditModeOff(sender, e) '//¿ø·¡ºä°¡ after ¹ß»ýÀ̹ǷΠbefore ¹ß»ý¿ë À̺¥Æ®Çϳª ¸Í±Û¾îÁØ´Ù. If Not Me.v_AEditStatusLabel Is Nothing Then '//¶óº§ÀÌ µÇ¾îÀÖ´Ù¸é Me.v_AEditStatusLabel.Text = "[À̵¿]" Me.v_AEditStatusLabel.ForeColor = Color.Black End If '//ºüÁ®³ª¿Ã¶§ ÀÌ ¼¿¹øÈ£°¡ Á¾·á¿­¹øÈ£¶ó¸é ´ÙÀ½ÁÙ·Î ³Ñ±ä´Ù If (Me.ANextRow_ColIndex = Me.ActiveSheet.ActiveColumnIndex) OrElse (Me.ActiveSheet.ActiveColumnIndex = (Me.ActiveSheet.ColumnCount - 1)) Then '//´ÙÀ½Áٷΰ¡¾ÆÁl °æ¿ì¶ó¸é RaiseEvent Arin_AddLog(Me, "editmode off and next_row") Me.ANEXT_ROW() Else RaiseEvent Arin_AddLog(Me, "editmode off nextcell") Me.ANext_Cell() End If End Sub Private Sub NewFp_EditModeOn(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.EditModeOn RaiseEvent Arin_AddLog(Me, "editmode on") If Not Me.v_AEditStatusLabel Is Nothing Then '//¶óº§ÀÌ µÇ¾îÀÖ´Ù¸é Me.v_AEditStatusLabel.Text = "[ÆíÁý]" Me.v_AEditStatusLabel.ForeColor = Color.Red End If End Sub Private Sub NewFp_Enter(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Enter End Sub ''' ''' ¼¿¿¡ ÁøÀÔÇÞÀ»½ÃÀÇ ÇÁ·Î½ÃÁ®. ''' ''' ''' ''' Private Sub NewFp_EnterCell(ByVal sender As Object, ByVal e As FarPoint.Win.Spread.EnterCellEventArgs) Handles Me.EnterCell If Not Me.v_ACellposLabel Is Nothing Then Me.v_ACellposLabel.Text = "[" & Me.ActiveSheet.ActiveRowIndex + 1 & ":" & Me.ActiveSheet.ActiveColumnIndex & "/" & Me.ActiveSheet.RowCount & "]" End If ' Me.Text = Me.view1.ÇѱÛÇʵå.GetUpperBound(0) & "/" & Array.IndexOf(Me.view1.ÇѱÛÇʵå, .ActiveColumn.Label) If Not Me.ÇѱÛÇʵå Is Nothing AndAlso Me.ÇѱÛÇʵå.GetUpperBound(0) >= 0 Then If Array.IndexOf(Me.ÇѱÛÇʵå, Me.ActiveColumn.Label) >= 0 Then Me.ImeMode = System.Windows.Forms.ImeMode.Hangul Else If Not Me.ActiveColumn.Tag Is Nothing Then If Array.IndexOf(Me.ÇѱÛÇʵå, Me.ActiveColumn.Tag) >= 0 Then Me.ImeMode = System.Windows.Forms.ImeMode.Hangul Else Me.ImeMode = System.Windows.Forms.ImeMode.Alpha End If Else If Not Me.ActiveColumn.DataField Is Nothing Then If Array.IndexOf(Me.ÇѱÛÇʵå, Me.ActiveColumn.DataField) >= 0 Then Me.ImeMode = System.Windows.Forms.ImeMode.Hangul Else Me.ImeMode = System.Windows.Forms.ImeMode.Alpha End If Else Me.ImeMode = System.Windows.Forms.ImeMode.Alpha End If End If End If End If 'If Not Me.v_ACellImeLabel Is Nothing Then--À̺κÐÀº Imemodechange À̺¥Æ®·Î ´ëüµÌ´Ù ' If Me.ImeMode = Windows.Forms.ImeMode.Hangul Then ' 'MsgBox("ÇѱÛÀÌ´Ù") ' Me.v_ACellImeLabel.Text = ("[ÇѱÛ]") ' Me.v_ACellImeLabel.ForeColor = Color.Blue ' Else ' ' MsgBox("ÀϹÝÀ¸·Îº¯°æ") ' Me.v_ACellImeLabel.Text = ("[ÀϹÝ]") ' Me.v_ACellImeLabel.ForeColor = Color.Black ' End If 'End If End Sub Private Sub NewFp_ImeModeChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.ImeModeChanged If Not Me.v_ACellImeLabel Is Nothing Then If Me.ImeMode = System.Windows.Forms.ImeMode.Hangul Then Me.v_ACellImeLabel.Text = ("[ÇѱÛ]") Me.v_ACellImeLabel.ForeColor = Color.Blue Else Me.v_ACellImeLabel.Text = ("[ÀϹÝ]") Me.v_ACellImeLabel.ForeColor = Color.Black End If End If End Sub ''' ''' ¿£ÅÍ۸¦ ´©¸£¸é ´ÙÀ½¼¿·ÎÀ̵¿Çϴ Ű¸ÊÀ» ¼³Á¤ÇÕ´Ï´Ù. ''' ''' Public Sub AEnterToNextItem(Optional ByVal EditOff As Boolean = True) Dim im As New FarPoint.Win.Spread.InputMap If EditOff Then im = Me.GetInputMap(FarPoint.Win.Spread.InputMapMode.WhenAncestorOfFocused) im.Put(New FarPoint.Win.Spread.Keystroke(Keys.Enter, Keys.None), FarPoint.Win.Spread.SpreadActions.MoveToNextColumn) End If im = Me.GetInputMap(FarPoint.Win.Spread.InputMapMode.WhenFocused) im.Put(New FarPoint.Win.Spread.Keystroke(Keys.Enter, Keys.None), FarPoint.Win.Spread.SpreadActions.MoveToNextColumn) '//ÀÚµ¿ÁٳѱèÀº »ç¿ëÇÏÁö¾Ê´Â´Ù. 'im.Put(New FarPoint.Win.Spread.Keystroke(Keys.Enter, Keys.None), FarPoint.Win.Spread.SpreadActions.) End Sub ''' ''' keydown À̺¥Æ®°¡ ºä³»¿¡¼­ 󸮵ɶ§ ¸ÕÀú ¹ß»ýÇÏ´Â À̺¥Æ® ''' ''' Overridable Sub Pre_KeyDown() End Sub ''' ''' ºä¿¡¼­ Űº¸µå°¡ ´­·ÇÀ»´ëÀÇ ¹ÝÀÀ ''' ''' ''' ''' Private Sub CustFP_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles Me.KeyDown RaiseEvent Arin_AddLog(Me, "keydown ¹ß»ý ÄÚµå=" & e.KeyCode & "ÇöÀçÁÙ¹øÈ£ : " & _ Me.ActiveSheet.ActiveRowIndex & " ÇöÀç¿­¹øÈ£:" & Me.ActiveSheet.ActiveColumnIndex & " ´ÙÀ½ÁÙ·ÎÀ̵¿ÇÒ¿­¹øÈ£:" & Me.ANextRow_ColIndex) RaiseEvent Arin_Before_KeyDown(sender, e) : RaiseEvent Arin_AddLog(Me, "Before Keydown À̺¥Æ®¸¦ ¹ß»ý½ÃÄ×½À´Ï´Ù.") Select Case e.KeyCode Case Keys.Enter e.SuppressKeyPress = False e.Handled = True If e.Control Then '//À­ÁÙ°ªÀ»º¹»ç RaiseEvent Arin_AddLog(Me, "keydown control ¿¡ÀÇÇØ À­ÁÙ º¹»ç") Me.Cells.Value = Me.CellsPR.Value '//º¹»çÇÏ°í ±×ÀÚ¸®¿¡ ¸ØÃá´Ù. Else '//ºóÁÙÀ϶§ »óÀ§°ª º¹»çÇÏ´Â·çÆ¾ÀÌ ¿ø¤© ¤Àview ¿¡ ÀÕ¾úÀ¸³ª ÇØ´ç keydown À̺¥Æ®°¡ À̰÷º¸´Ù ³ªÁß¿¡ ÀϾ±â‹š¹®¿¡ '//»ç¿ëÇÒ¼ö°¡¾ø°ÔµÇ¾ú´Ù. If Me.ActiveSheet.ActiveRowIndex = Me.ActiveSheet.RowCount - 1 Then '//¸¶Áö¸·ÁÙÀϰæ¿ì RaiseEvent Arin_AddLog(Me, "keydown ¸¶Áö¸·ÁÙÁøÀÔ ±â·ÏµÈ´ÙÀ½¿­¹øÈ£/ÇöÀç¿­¹øÈ£/Àüü¿­¹øÈ£ " & Me.ANextRow_ColIndex & "/" & Me.ActiveSheet.ActiveColumnIndex & _ "/" & Me.ActiveSheet.ColumnCount - 1) If (Me.ANextRow_ColIndex = Me.ActiveSheet.ActiveColumnIndex) OrElse (Me.ActiveSheet.ActiveColumnIndex = (Me.ActiveSheet.ColumnCount - 1)) Then '//´ÙÀ½Áٷΰ¡¾ÆÁl °æ¿ì¶ó¸é RaiseEvent Arin_AddLog(Me, "keydown ¸¶Áö¸·ÁÙÀ̸ç ÇÑÁÙ»ý¼ºÇؾßÇÔ " & Me.ANextRow_ColIndex & "/" & Me.ActiveSheet.ActiveColumnIndex & _ "¸¶Áö¸·¿­¹øÈ£ = " & Me.ActiveSheet.ColumnCount - 1) If Not Me.v_AAutoAddrowInLast Is Nothing Then Me.v_AAutoAddrowInLast.PerformClick() End If Else '//¸¶Áö¸·ÁÙÀÌ°í ´ÙÀ½ÁÙÀÌ¾Æ´Ï¸é ´ÙÀ½¼¿·ÎÀ̵¿ RaiseEvent Arin_AddLog(Me, "keydown ¸¶Áö¸·ÁÙÀ̳ª ´ÙÀ½¼¿·Î °¨") Me.ANext_Cell() End If Else '//¸¶Áö¸·ÁÙÀÌ¾Æ´Ï°í ¸¶Áö¸·¿­ÀÌ¸é ´ÙÀ½ÁÙ·Î 'MsgBox(Me.ANextRow_ColIndex & "/" & Me.ActiveSheet.ActiveColumnIndex) If (Me.ANextRow_ColIndex = Me.ActiveSheet.ActiveColumnIndex) OrElse (Me.ActiveSheet.ActiveColumnIndex = (Me.ActiveSheet.ColumnCount - 1)) Then '//´ÙÀ½Áٷΰ¡¾ÆÁl °æ¿ì¶ó¸é RaiseEvent Arin_AddLog(Me, "keydown ¸¶Áö¸·ÁÙÀÌ¾Æ´Ï¸ç ´ÙÀ½ÁÙ·Î" & Me.ANextRow_ColIndex & "/" & Me.ActiveSheet.ActiveColumnIndex) Me.ANEXT_ROW() Else RaiseEvent Arin_AddLog(Me, "keydown ¸¶Áö¸·ÁÙÀÌ¾Æ´Ï¸ç ´ÙÀ½¼¿·Î") Me.ANext_Cell() End If End If 'MsgBox("ÇÑÁٳѱâ°í ¸¶Áö¸·¿Ï·á´Ü¤§°Ô") End If 'If Not Me.v_AAutoAddrowInLast Is Nothing Then ' If Me.ActiveSheet.ActiveRowIndex = Me.ActiveSheet.RowCount - 1 Then '//¸¶Áö¸·ÁÙ¿¡ ' If Me.ANextRow_ColIndex = Me.ActiveSheet.ActiveColumnIndex Then '//´ÙÀ½Áٷΰ¡¾ÆÁl °æ¿ì¶ó¸é ' e.Handled = True ' Me.v_AAutoAddrowInLast.PerformClick() ' ElseIf Me.ActiveSheet.ActiveColumnIndex = Me.ActiveSheet.ColumnCount - 1 Then '//¸¶Áö¸·¿­À̶ó¸é ' e.Handled = True ' Me.v_AAutoAddrowInLast.PerformClick() ' End If ' End If 'End If Case Keys.Delete If e.Shift Then '//½¬ÇÁÆ®°¡ ´­·¯Á®ÀÕÀ»°æ¿ì If Me.V_DeleteKey Then Delete_itm(, True) e.Handled = True Else If Me.V_CurrentDel Then If Not Me.ActiveSheet.ActiveCell.Locked AndAlso Not Me.ActiveSheet.ActiveColumn.Locked Then Me.ActiveSheet.ActiveCell.ResetValue() Else Me.Disp_Msg("ÇöÀç ¼¿Àº Àá°ÜÀÖÀ¸¹Ç·Î °ªÀ» »èÁ¦ÇÒ ¼ö ¾ø½À´Ï´Ù") End If 'Me.OnEditModeOff(Nothing) e.Handled = True End If End If Case Keys.Space '//ÆíÁý¸ðµå If Me.V_SpaceEdit Then EditMode = True e.Handled = True Case Keys.F1 Case Keys.F2 Case Keys.F3 Case Keys.F4 Case Keys.F5 Case Keys.F6 Case Keys.F7 Case Keys.F8 Case Keys.F9 Case Keys.F10 Case Keys.F11 Case Keys.F12 Case 18 '//¿ÞÂÊALT e.SuppressKeyPress = False e.Handled = True Case Else '//±×¿Ü´Ù¸¥°ÔÀԷµǾîÀÖÀ»°æ¿ì¿¡´Â editmode ¿¡ µé¾î°¡°ÔµÇ¹Ç·Î ÇѱÛ󸮸¦ À§ÇØ ¹Ù·Î ¿¡µðÆ®¸ðµå·Î µé¾î¿À°ÔÇÑ´Ù. '//¼ýÀÚ°¡ÀÔ·ÂµÇ¸é ³Ñ¾î°¡¹ö¸®¹Ç·Î If e.KeyCode >= Keys.NumPad0 AndAlso e.KeyCode <= Keys.NumPad9 Then '//¿ìÃø¼ýÀÚÆÐÆ® ElseIf e.KeyCode >= Keys.D0 AndAlso e.KeyCode <= Keys.D9 Then '//ÀϹݼýÀÚÆÐµå Else If Not e.Alt AndAlso Not e.Control AndAlso Me.ImeMode = System.Windows.Forms.ImeMode.Hangul Then EditMode = True End If End If End Select End Sub ''' ''' ºäÀÇ ÁÙ ³ôÀÌ º¯°æµÇ¾úÀ»¶§ÀÇ ¹ÝÀÀ ''' ''' ''' ''' Private Sub CustFP_RowHeightChanged(ByVal sender As Object, ByVal e As FarPoint.Win.Spread.RowHeightChangedEventArgs) Handles Me.RowHeightChanged If Me.V_sameRHeight Then Dim Row As FarPoint.Win.Spread.RowHeightChangeExtents = e.RowList(0) Me.ActiveSheet.Rows.Default.Height = Me.ActiveSheet.Rows(Row.FirstRow).Height End If End Sub Public Sub Excel_Save(ByVal Filename As String, Optional ByVal INitdir As String = vbNullString, Optional ByVal Asfilter As Boolean = False) If Me.ActiveSheet.Rows.Count <= 0 Then MsgBox("³»º¸³»±âÇÒ ¸ñ·ÏÀÌ Á¸ÀçÇÏÁö ¾Ê½À´Ï´Ù", MsgBoxStyle.Critical, "È®ÀÎ") Exit Sub End If Try Dim A As New SaveFileDialog A.InitialDirectory = IIf(INitdir = vbNullString, My.Application.Info.DirectoryPath, INitdir) A.Filter = "¿¢¼¿ ¿öÅ©½ÃÆ®ÆÄÀÏ|*.XLS" A.FileName = Filename If A.ShowDialog = System.Windows.Forms.DialogResult.OK Then ' Me.prb1.Style = ProgressBarStyle.Marquee If Not Asfilter Then Me.SaveExcel(A.FileName, FarPoint.Excel.ExcelSaveFlags.SaveBothCustomRowAndColumnHeaders) Else Me.SaveExcel(A.FileName, FarPoint.Excel.ExcelSaveFlags.SaveAsFiltered) End If End If Catch ex As Exception MsgBox("³»º¸³»±â½ÇÆÐ" & vbCrLf & ex.ToString, MsgBoxStyle.Critical, "È®ÀÎ") End Try End Sub ''' ''' ½Ì±Û·Î¿ìÇü½ÄÀ»¶§ Ç¥½ÃÇϰíÀÚÇÏ´Â DatarowView ¸¦ º¸³»ÁÖ¸é ¼¿ÀÇ TAG¸¦ ¸ÂÃç¼­ Ç¥½ÃÇÕ´Ï´Ù. ''' ''' ''' Public Sub ASingleRow_Viewer(ByVal Drv As DataRowView, ByVal StartRange As Point, ByVal EndRange As Point) For i As Integer = StartRange.Y To EndRange.Y '//¹üÀ§Çà For j As Integer = StartRange.X To EndRange.X '//¹üÀ§¿­ If Not Me.ActiveSheet.Cells(i, j).Tag Is Nothing Then Me.ActiveSheet.Cells(i, j).Text = Drv(Me.ActiveSheet.Cells(i, j).Tag.ToString) End If Next Next End Sub ''' ''' ½Ì±Û·Î¿ìÇü½ÄÀ»¶§ Ç¥½ÃÇϰíÀÚÇÏ´Â DatarowView ¸¦ º¸³»ÁÖ¸é ¼¿ÀÇ TAG¸¦ ¸ÂÃç¼­ Ç¥½ÃÇÕ´Ï´Ù. ''' ''' ''' Public Sub ASingleRow_Viewer(ByVal Drv As DataRowView) For Each RW As FarPoint.Win.Spread.Row In Me.ActiveSheet.Rows For Each CL As FarPoint.Win.Spread.Column In Me.ActiveSheet.Columns If Not Me.ActiveSheet.Cells(RW.Index, CL.Index).Tag Is Nothing Then If Drv(Me.ActiveSheet.Cells(RW.Index, CL.Index).Tag.ToString) Is DBNull.Value Then Me.ActiveSheet.Cells(RW.Index, CL.Index).Value = "" Else Me.ActiveSheet.Cells(RW.Index, CL.Index).Value = Drv(Me.ActiveSheet.Cells(RW.Index, CL.Index).Tag.ToString) End If End If Next Next End Sub ''' ''' ½Ì±Û·Î¿ìÇü½ÄÀ» »ç¿ëÇÒ¶§ ½ºÇÁ·¹µå°ªÀ» µ¥ÀÌÅÍÅ×ÀÌºí¿¡ º¸³½´Ù. ''' ''' ''' Public Sub ASingleRow_Writer(ByRef Drv As DataRowView) If Not Me.ActiveSheet.ActiveCell.Tag Is Nothing Then 'MsgBox(Me.ActiveSheet.ActiveCell.Text) Drv(Me.ActiveSheet.ActiveCell.Tag.ToString) = Me.ActiveSheet.ActiveCell.Value End If End Sub Public Sub New() ' ÀÌ È£ÃâÀº Windows Form µðÀÚÀ̳ʿ¡ ÇÊ¿äÇÕ´Ï´Ù. InitializeComponent() ' InitializeComponent() È£Ãâ µÚ¿¡ ÃʱâÈ­ Äڵ带 Ãß°¡ÇϽʽÿÀ. End Sub Protected Overrides Sub Finalize() MyBase.Finalize() End Sub End Class