commit 7cb0365c6ed753a964314c320f96b6b81937b42a Author: chi Date: Sun May 24 12:36:36 2020 +0900 initial commit diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..e0cbfaf --- /dev/null +++ b/.gitignore @@ -0,0 +1,6 @@ +bin +debug +obj +*.user +*.v12 +*.v11 \ No newline at end of file diff --git a/ArinNewFp.sln b/ArinNewFp.sln new file mode 100644 index 0000000..ef23e64 --- /dev/null +++ b/ArinNewFp.sln @@ -0,0 +1,49 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.29709.97 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "ArinNewFp11", "ArinNewFpv11\ArinNewFp11.vbproj", "{3611D55B-71E3-4D92-9EFC-43F7D8BB8525}" +EndProject +Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "ArinNewFp13", "ArinNewFpv13\ArinNewFp13.vbproj", "{3611D55B-71E3-4D92-9EFC-43F7D8BB8555}" +EndProject +Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "ArinNewFp5", "ArinNewFpv5\ArinNewFp5.vbproj", "{B0371B1F-8657-47A6-979E-4AEB970559D2}" +EndProject +Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "ArinNewFp4", "ArinNewFpv4\ArinNewFp4.vbproj", "{1A24DEF6-0FD3-418F-95DC-0C0E5662ECEA}" +EndProject +Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "ArinNewFp4_Fx2", "ArinNewFpv4.Netfx2\ArinNewFp4_Fx2.vbproj", "{4F920F6C-6C0F-4866-9033-9F9839CB7853}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {3611D55B-71E3-4D92-9EFC-43F7D8BB8525}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {3611D55B-71E3-4D92-9EFC-43F7D8BB8525}.Debug|Any CPU.Build.0 = Debug|Any CPU + {3611D55B-71E3-4D92-9EFC-43F7D8BB8525}.Release|Any CPU.ActiveCfg = Release|Any CPU + {3611D55B-71E3-4D92-9EFC-43F7D8BB8525}.Release|Any CPU.Build.0 = Release|Any CPU + {3611D55B-71E3-4D92-9EFC-43F7D8BB8555}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {3611D55B-71E3-4D92-9EFC-43F7D8BB8555}.Debug|Any CPU.Build.0 = Debug|Any CPU + {3611D55B-71E3-4D92-9EFC-43F7D8BB8555}.Release|Any CPU.ActiveCfg = Release|Any CPU + {3611D55B-71E3-4D92-9EFC-43F7D8BB8555}.Release|Any CPU.Build.0 = Release|Any CPU + {B0371B1F-8657-47A6-979E-4AEB970559D2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B0371B1F-8657-47A6-979E-4AEB970559D2}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B0371B1F-8657-47A6-979E-4AEB970559D2}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B0371B1F-8657-47A6-979E-4AEB970559D2}.Release|Any CPU.Build.0 = Release|Any CPU + {1A24DEF6-0FD3-418F-95DC-0C0E5662ECEA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {1A24DEF6-0FD3-418F-95DC-0C0E5662ECEA}.Debug|Any CPU.Build.0 = Debug|Any CPU + {1A24DEF6-0FD3-418F-95DC-0C0E5662ECEA}.Release|Any CPU.ActiveCfg = Release|Any CPU + {1A24DEF6-0FD3-418F-95DC-0C0E5662ECEA}.Release|Any CPU.Build.0 = Release|Any CPU + {4F920F6C-6C0F-4866-9033-9F9839CB7853}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {4F920F6C-6C0F-4866-9033-9F9839CB7853}.Debug|Any CPU.Build.0 = Debug|Any CPU + {4F920F6C-6C0F-4866-9033-9F9839CB7853}.Release|Any CPU.ActiveCfg = Release|Any CPU + {4F920F6C-6C0F-4866-9033-9F9839CB7853}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {58418FCE-CC47-4C0F-A428-420583A1040D} + EndGlobalSection +EndGlobal diff --git a/ArinNewFp/Form1.Designer.vb b/ArinNewFp/Form1.Designer.vb new file mode 100644 index 0000000..a024097 --- /dev/null +++ b/ArinNewFp/Form1.Designer.vb @@ -0,0 +1,29 @@ + _ +Partial Class Form1 + Inherits System.Windows.Forms.Form + + 'Form은 Dispose를 재정의하여 구성 요소 목록을 정리합니다. + _ + Protected Overrides Sub Dispose(ByVal disposing As Boolean) + Try + If disposing AndAlso components IsNot Nothing Then + components.Dispose() + End If + Finally + MyBase.Dispose(disposing) + End Try + End Sub + + 'Windows Form 디자이너에 필요합니다. + Private components As System.ComponentModel.IContainer + + '참고: 다음 프로시저는 Windows Form 디자이너에 필요합니다. + '수정하려면 Windows Form 디자이너를 사용하십시오. + '코드 편집기를 사용하여 수정하지 마십시오. + _ + Private Sub InitializeComponent() + components = New System.ComponentModel.Container + Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.Text = "Form1" + End Sub +End Class diff --git a/ArinNewFp/Form1.vb b/ArinNewFp/Form1.vb new file mode 100644 index 0000000..10d55d4 --- /dev/null +++ b/ArinNewFp/Form1.vb @@ -0,0 +1,3 @@ +Public Class Form1 + +End Class \ No newline at end of file diff --git a/ArinNewFp/MyINI.vb b/ArinNewFp/MyINI.vb new file mode 100644 index 0000000..e9ca3e4 --- /dev/null +++ b/ArinNewFp/MyINI.vb @@ -0,0 +1,287 @@ +Imports System.IO + +Public Class tinyIni + Declare Function GetPrivateProfileString Lib "kernel32" Alias "GetPrivateProfileStringA" (ByVal lpApplicationName As String, ByVal lpKeyName As String, ByVal lpDefault As String, ByVal lpReturnedString As String, ByVal nSize As Integer, ByVal lpFileName As String) As Integer + Declare Function WritePrivateProfileString Lib "kernel32" Alias "WritePrivateProfileStringA" (ByVal lpApplicationName As String, ByVal lpKeyName As String, ByVal lpString As String, ByVal lpDownFileName As String) As Integer + 'Private Aname As String + Public FileName As String = vbNullString + Private FileNameBuf As String + Private m_sPath As String + Private m_sKey As String + Private m_sSection As String + Private m_sDefault As String + Private m_lLastReturnCode As Integer + + Public Sub New(ByVal File As String) + FileName = File + FileNameBuf = File + Me.Create() + + 'MsgBox("New 1=" & FileName & vbCrLf & "2=" & FileNameBuf) + + ' If Not System.IO.File.Exists(File) Then System.IO.File.Create(File) + End Sub + Public Sub Create() + If Exist() = True Then Return + Dim A As New IO.FileInfo(FileName) + A.Directory.Create() + Dim FS As IO.FileStream = A.Create() + Dim SW As New IO.StreamWriter(FS, System.Text.Encoding.Default) + SW.WriteLine("//Myini 로부터 자동생성된 파일입니다") + SW.WriteLine("//생성일자 : " & Now.ToString) + SW.Flush() + SW.Close() + FS.Close() + SW = Nothing + FS = Nothing + FileName = FileNameBuf + End Sub + Public Function Exist() As Boolean + Return System.IO.File.Exists(FileName) + End Function + + Public Function Read(ByVal appkey As String, ByVal subkey As String, Optional ByVal DefaultValue As String = vbNullString) As String '//변수초기화 + 'MsgBox("Read 1=" & FileName & vbCrLf & "2=" & FileNameBuf) + + Dim tempstr As Integer 'ini파일에서 읽어온 값을 임시저장하는 변수 + Dim strtemp As String = New String(Chr(0), 2000) 'ini파일의 임시 변수 + Dim Tempbuf As String + + If Not Exist() Then + MsgBox("환경파일이 존재하지 않습니다" & vbCrLf & "APP=" & appkey & vbCrLf & "subkey=" & subkey & vbCrLf & "파일명=" & FileName, MsgBoxStyle.Critical, "Error") + Return vbNullString + End If + Try + tempstr = GetPrivateProfileString(appkey, subkey, "", strtemp, Len(strtemp), FileName) + Tempbuf = strtemp.Substring(0, tempstr) + Tempbuf = Tempbuf.Trim(Chr(0)) + + FileName = FileNameBuf + + If Tempbuf.Trim = vbNullString AndAlso DefaultValue <> vbNullString Then + Return DefaultValue + Else + Return Tempbuf + End If + Catch ex As Exception + FileName = FileNameBuf + Return vbNullString + End Try + + End Function + Public Function ReadFile(ByVal appkey As String, ByVal subkey As String, ByVal filename2 As String, Optional ByVal DefaultValue As String = vbNullString) As String '//변수초기화 + 'MsgBox("ReadFile 1=" & FileName & vbCrLf & "2=" & FileNameBuf) + Dim tempstr As Integer 'ini파일에서 읽어온 값을 임시저장하는 변수 + Dim strtemp As String = New String(Chr(0), 2000) 'ini파일의 임시 변수 + Dim Tempbuf As String + + If Not System.IO.File.Exists(filename2) Then + MsgBox("환경파일이 존재하지 않습니다" & vbCrLf & "파일명=" & FileName, MsgBoxStyle.Critical, "Error") + Return vbNullString + End If + + Try + tempstr = GetPrivateProfileString(appkey, subkey, "", strtemp, Len(strtemp), filename2) + Tempbuf = strtemp.Substring(0, tempstr) + If Tempbuf.Trim = vbNullString AndAlso DefaultValue <> vbNullString Then + Return DefaultValue + Else + Return Tempbuf + End If + Catch ex As Exception + Return vbNullString + End Try + FileName = FileNameBuf + End Function + + Public Function Write(ByVal appkey As String, ByVal subkey As String, ByVal WriteVal As Object) As Integer + Dim RetVal As Integer + 'MsgBox("Write1 1=" & FileName & vbCrLf & "2=" & FileNameBuf) + If Not Exist() Then + MsgBox("환경파일이 존재하지 않습니다" & vbCrLf & "파일을 생성합니다." & vbCrLf & "파일명=" & FileName, MsgBoxStyle.Information, "확인") + Me.Create() + End If + ' FileName = Aname + RetVal = (WritePrivateProfileString(appkey, subkey, WriteVal, FileName)) + FileName = FileNameBuf + Return RetVal + + End Function + Public Sub Write(ByVal appkey As String, ByVal subkey As String, ByVal WriteVal As Object, ByVal fileName2 As String) + 'MsgBox("Write2 1=" & FileName & vbCrLf & "2=" & FileNameBuf) + If Not System.IO.File.Exists(fileName2) Then + MsgBox("[D] 환경파일이 존재하지 않습니다" & vbCrLf & "파일을 생성합니다." & vbCrLf & "파일명=" & fileName2, MsgBoxStyle.Information, "확인") + System.IO.File.Create(fileName2) + End If + WritePrivateProfileString(appkey, subkey, WriteVal, fileName2) + FileName = FileNameBuf + End Sub + + + + Public Sub EnumerateCurrentSection(ByRef sKey() As String, ByRef iCount As Integer) + Dim sSection As String + Dim iPos As Integer + Dim iNextPos As Integer + Dim sCur As String + + iCount = 0 + Erase sKey + sSection = INISection + If (Len(sSection) > 0) Then + iPos = 1 + iNextPos = InStr(iPos, sSection, Chr(0)) + Do While iNextPos <> 0 + sCur = Mid(sSection, iPos, iNextPos - iPos) + If (sCur <> Chr(0)) Then + iCount = iCount + 1 + 'UPGRADE_WARNING: sKey 배열의 하한이 1에서 0(으)로 변경되었습니다. 자세한 내용은 다음을 참조하십시오. 'ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?keyword="0F1C9BE1-AF9D-476E-83B1-17D43BECFF20"' + ReDim Preserve sKey(iCount) + sKey(iCount) = Mid(sSection, iPos, iNextPos - iPos) + iPos = iNextPos + 1 + iNextPos = InStr(iPos, sSection, Chr(0)) + End If + Loop + End If + End Sub + + + Public Sub GetAllsection(ByVal key As String, ByRef Section As ArrayList, ByRef Value As ArrayList) + Dim FS As New System.IO.FileStream(FileName, FileMode.Open) + Dim SR As New StreamReader(FS, System.Text.Encoding.Default) + Dim Findkey As String = "[" & key & "]" + Dim Line As String + Dim KeyPos As Integer = -1 + Dim Seppos As Integer = -1 + While SR.Peek > -1 + Line = SR.ReadLine + If KeyPos = -1 Then '//키를 못찻았으면 + If Line.ToUpper.IndexOf(Findkey.ToUpper) > -1 Then KeyPos = Line.ToUpper.IndexOf(Findkey.ToUpper) + Else '//찾앗으면 + If Line.IndexOf("[") = -1 Then '//그다음 키가 오기전까지 모두 추가한다. + Seppos = Line.IndexOf("=") + Section.Add(Line.Substring(0, Seppos)) + Value.Add(Line.Substring(Seppos + 1)) + Else + Exit While + End If + End If + End While + + SR.Close() + FS.Close() + + + End Sub + + Public Sub EnumerateAllSections(ByRef sSections() As String, ByRef iCount As Integer) + Dim sIniFile As String + Dim iPos As Integer + Dim iNextPos As Integer + Dim sCur As String + + iCount = 0 + Erase sSections + sIniFile = Sections + If (Len(sIniFile) > 0) Then + iPos = 1 + iNextPos = InStr(iPos, sIniFile, Chr(0)) + Do While iNextPos <> 0 + If (iNextPos <> iPos) Then + sCur = Mid(sIniFile, iPos, iNextPos - iPos) + iCount = iCount + 1 + 'UPGRADE_WARNING: sSections 배열의 하한이 1에서 0(으)로 변경되었습니다. 자세한 내용은 다음을 참조하십시오. 'ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?keyword="0F1C9BE1-AF9D-476E-83B1-17D43BECFF20"' + ReDim Preserve sSections(iCount) + sSections(iCount) = sCur + End If + iPos = iNextPos + 1 + iNextPos = InStr(iPos, sIniFile, Chr(0)) + Loop + End If + + End Sub + + Property INISection() As String + Get + Dim sBuf As String + Dim iSize As String + Dim iRetCode As Short + + sBuf = Space(8192) + iSize = CStr(Len(sBuf)) + iRetCode = GetPrivateProfileString(m_sSection, 0, m_sDefault, sBuf, CInt(iSize), m_sPath) + If (CDbl(iSize) > 0) Then + INISection = Left(sBuf, iRetCode) + Else + INISection = "" + End If + + End Get + Set(ByVal Value As String) + m_lLastReturnCode = WritePrivateProfileString(m_sSection, 0, Value, m_sPath) + End Set + End Property + ReadOnly Property Sections() As String + Get + Dim sBuf As String + Dim iSize As String + Dim iRetCode As Short + + sBuf = Space(8192) + iSize = CStr(Len(sBuf)) + iRetCode = GetPrivateProfileString(0, 0, m_sDefault, sBuf, CInt(iSize), m_sPath) + If (CDbl(iSize) > 0) Then + Sections = Left(sBuf, iRetCode) + Else + Sections = "" + End If + + End Get + End Property + + ReadOnly Property LastReturnCode() As Integer + Get + LastReturnCode = m_lLastReturnCode + End Get + End Property + ReadOnly Property Success() As Boolean + Get + Success = (m_lLastReturnCode <> 0) + End Get + End Property + 'UPGRADE_NOTE: Default이(가) Default_Renamed(으)로 업그레이드되었습니다. 자세한 내용은 다음을 참조하십시오. 'ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?keyword="A9E4979A-37FA-4718-9994-97DD76ED70A7"' + Property Default_Renamed() As String + Get + Default_Renamed = m_sDefault + End Get + Set(ByVal Value As String) + m_sDefault = Value + End Set + End Property + Property Path() As String + Get + Path = m_sPath + End Get + Set(ByVal Value As String) + m_sPath = Value + End Set + End Property + Property Key() As String + Get + Key = m_sKey + End Get + Set(ByVal Value As String) + m_sKey = Value + End Set + End Property + Property Section() As String + Get + Section = m_sSection + End Get + Set(ByVal Value As String) + m_sSection = Value + End Set + End Property + + +End Class \ No newline at end of file diff --git a/ArinNewFp/NewFp.Designer.vb b/ArinNewFp/NewFp.Designer.vb new file mode 100644 index 0000000..1be86ba --- /dev/null +++ b/ArinNewFp/NewFp.Designer.vb @@ -0,0 +1,36 @@ + _ +Partial Class NewFp + Inherits FarPoint.Win.Spread.FpSpread + + 'UserControl1은 Dispose를 재정의하여 구성 요소 목록을 정리합니다. + _ + Protected Overrides Sub Dispose(ByVal disposing As Boolean) + Try + If disposing AndAlso components IsNot Nothing Then + components.Dispose() + End If + Finally + MyBase.Dispose(disposing) + End Try + End Sub + + 'Windows Form 디자이너에 필요합니다. + Private components As System.ComponentModel.IContainer + + '참고: 다음 프로시저는 Windows Form 디자이너에 필요합니다. + '수정하려면 Windows Form 디자이너를 사용하십시오. + '코드 편집기를 사용하여 수정하지 마십시오. + _ + Private Sub InitializeComponent() + CType(Me, System.ComponentModel.ISupportInitialize).BeginInit() + Me.SuspendLayout() + ' + 'NewFp + ' + Me.ActiveSheetIndex = -1 + CType(Me, System.ComponentModel.ISupportInitialize).EndInit() + Me.ResumeLayout(False) + + End Sub + +End Class diff --git a/ArinNewFp/NewFp.resx b/ArinNewFp/NewFp.resx new file mode 100644 index 0000000..52a9ad3 --- /dev/null +++ b/ArinNewFp/NewFp.resx @@ -0,0 +1,123 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + False + + \ No newline at end of file diff --git a/ArinNewFp/NewFp.vb b/ArinNewFp/NewFp.vb new file mode 100644 index 0000000..5d894f6 --- /dev/null +++ b/ArinNewFp/NewFp.vb @@ -0,0 +1,1420 @@ +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 diff --git a/ArinNewFp/lov.Designer.vb b/ArinNewFp/lov.Designer.vb new file mode 100644 index 0000000..c3016d4 --- /dev/null +++ b/ArinNewFp/lov.Designer.vb @@ -0,0 +1,152 @@ + _ +Partial Class lov + Inherits System.Windows.Forms.Form + + 'Form은 Dispose를 재정의하여 구성 요소 목록을 정리합니다. + _ + Protected Overrides Sub Dispose(ByVal disposing As Boolean) + Try + If disposing AndAlso components IsNot Nothing Then + components.Dispose() + End If + Finally + MyBase.Dispose(disposing) + End Try + End Sub + + 'Windows Form 디자이너에 필요합니다. + Private components As System.ComponentModel.IContainer + + '참고: 다음 프로시저는 Windows Form 디자이너에 필요합니다. + '수정하려면 Windows Form 디자이너를 사용하십시오. + '코드 편집기를 사용하여 수정하지 마십시오. + _ + Private Sub InitializeComponent() + Me.components = New System.ComponentModel.Container() + Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(lov)) + Me.ToolStripButton1 = New System.Windows.Forms.ToolStripButton() + Me.TableLayoutPanel1 = New System.Windows.Forms.TableLayoutPanel() + Me.tb_searchtext = New System.Windows.Forms.TextBox() + Me.datagridview1 = New FarPoint.Win.Spread.FpSpread() + Me.datagridview1_Sheet1 = New FarPoint.Win.Spread.SheetView() + Me.ToolStrip1 = New System.Windows.Forms.ToolStrip() + Me.ToolStripButton2 = New System.Windows.Forms.ToolStripButton() + Me.BindingSource1 = New System.Windows.Forms.BindingSource(Me.components) + Me.TableLayoutPanel1.SuspendLayout() + CType(Me.datagridview1, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.datagridview1_Sheet1, System.ComponentModel.ISupportInitialize).BeginInit() + Me.ToolStrip1.SuspendLayout() + CType(Me.BindingSource1, System.ComponentModel.ISupportInitialize).BeginInit() + Me.SuspendLayout() + ' + 'ToolStripButton1 + ' + Me.ToolStripButton1.Alignment = System.Windows.Forms.ToolStripItemAlignment.Right + Me.ToolStripButton1.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image + Me.ToolStripButton1.Image = CType(resources.GetObject("ToolStripButton1.Image"), System.Drawing.Image) + Me.ToolStripButton1.ImageTransparentColor = System.Drawing.Color.Magenta + Me.ToolStripButton1.Name = "ToolStripButton1" + Me.ToolStripButton1.Size = New System.Drawing.Size(36, 37) + Me.ToolStripButton1.Text = "ToolStripButton1" + ' + 'TableLayoutPanel1 + ' + Me.TableLayoutPanel1.ColumnCount = 1 + Me.TableLayoutPanel1.ColumnStyles.Add(New System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 521.0!)) + Me.TableLayoutPanel1.Controls.Add(Me.tb_searchtext, 0, 0) + Me.TableLayoutPanel1.Controls.Add(Me.datagridview1, 0, 1) + Me.TableLayoutPanel1.Controls.Add(Me.ToolStrip1, 0, 2) + Me.TableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill + Me.TableLayoutPanel1.Location = New System.Drawing.Point(0, 0) + Me.TableLayoutPanel1.Margin = New System.Windows.Forms.Padding(3, 4, 3, 4) + Me.TableLayoutPanel1.Name = "TableLayoutPanel1" + Me.TableLayoutPanel1.RowCount = 3 + Me.TableLayoutPanel1.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 40.0!)) + Me.TableLayoutPanel1.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100.0!)) + Me.TableLayoutPanel1.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 40.0!)) + Me.TableLayoutPanel1.Size = New System.Drawing.Size(521, 499) + Me.TableLayoutPanel1.TabIndex = 4 + ' + 'tb_searchtext + ' + Me.tb_searchtext.CharacterCasing = System.Windows.Forms.CharacterCasing.Upper + Me.tb_searchtext.Dock = System.Windows.Forms.DockStyle.Fill + Me.tb_searchtext.Font = New System.Drawing.Font("맑은 고딕", 15.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(129, Byte)) + Me.tb_searchtext.Location = New System.Drawing.Point(3, 4) + Me.tb_searchtext.Margin = New System.Windows.Forms.Padding(3, 4, 3, 4) + Me.tb_searchtext.Name = "tb_searchtext" + Me.tb_searchtext.Size = New System.Drawing.Size(515, 35) + Me.tb_searchtext.TabIndex = 3 + Me.tb_searchtext.TextAlign = System.Windows.Forms.HorizontalAlignment.Center + ' + 'datagridview1 + ' + Me.datagridview1.AccessibleDescription = "datagridview1, Sheet1, Row 0, Column 0, " + Me.datagridview1.BackColor = System.Drawing.SystemColors.Control + Me.datagridview1.Dock = System.Windows.Forms.DockStyle.Fill + Me.datagridview1.Location = New System.Drawing.Point(3, 43) + Me.datagridview1.Name = "datagridview1" + Me.datagridview1.RightToLeft = System.Windows.Forms.RightToLeft.No + Me.datagridview1.Sheets.AddRange(New FarPoint.Win.Spread.SheetView() {Me.datagridview1_Sheet1}) + Me.datagridview1.Size = New System.Drawing.Size(515, 413) + Me.datagridview1.TabIndex = 4 + ' + 'datagridview1_Sheet1 + ' + Me.datagridview1_Sheet1.Reset() + Me.datagridview1_Sheet1.SheetName = "Sheet1" + 'Formulas and custom names must be loaded with R1C1 reference style + Me.datagridview1_Sheet1.ReferenceStyle = FarPoint.Win.Spread.Model.ReferenceStyle.R1C1 + Me.datagridview1_Sheet1.ColumnHeader.Rows.Get(0).Height = 30.0! + Me.datagridview1_Sheet1.RowHeader.Columns.Default.Resizable = False + Me.datagridview1_Sheet1.SelectionUnit = FarPoint.Win.Spread.Model.SelectionUnit.Row + Me.datagridview1_Sheet1.ReferenceStyle = FarPoint.Win.Spread.Model.ReferenceStyle.A1 + ' + 'ToolStrip1 + ' + Me.ToolStrip1.AutoSize = False + Me.ToolStrip1.Dock = System.Windows.Forms.DockStyle.Fill + Me.ToolStrip1.ImageScalingSize = New System.Drawing.Size(32, 32) + Me.ToolStrip1.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.ToolStripButton1, Me.ToolStripButton2}) + Me.ToolStrip1.Location = New System.Drawing.Point(0, 459) + Me.ToolStrip1.Name = "ToolStrip1" + Me.ToolStrip1.Size = New System.Drawing.Size(521, 40) + Me.ToolStrip1.TabIndex = 5 + Me.ToolStrip1.Text = "ToolStrip1" + ' + 'ToolStripButton2 + ' + Me.ToolStripButton2.Alignment = System.Windows.Forms.ToolStripItemAlignment.Right + Me.ToolStripButton2.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image + Me.ToolStripButton2.ImageTransparentColor = System.Drawing.Color.Magenta + Me.ToolStripButton2.Name = "ToolStripButton2" + Me.ToolStripButton2.Size = New System.Drawing.Size(23, 37) + Me.ToolStripButton2.Text = "ToolStripButton2" + ' + 'lov + ' + Me.AutoScaleDimensions = New System.Drawing.SizeF(7.0!, 12.0!) + Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.ClientSize = New System.Drawing.Size(521, 499) + Me.Controls.Add(Me.TableLayoutPanel1) + Me.Name = "lov" + Me.Text = "lov" + Me.TableLayoutPanel1.ResumeLayout(False) + Me.TableLayoutPanel1.PerformLayout() + CType(Me.datagridview1, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.datagridview1_Sheet1, System.ComponentModel.ISupportInitialize).EndInit() + Me.ToolStrip1.ResumeLayout(False) + Me.ToolStrip1.PerformLayout() + CType(Me.BindingSource1, System.ComponentModel.ISupportInitialize).EndInit() + Me.ResumeLayout(False) + + End Sub + Friend WithEvents ToolStripButton1 As System.Windows.Forms.ToolStripButton + Friend WithEvents TableLayoutPanel1 As System.Windows.Forms.TableLayoutPanel + Friend WithEvents tb_searchtext As System.Windows.Forms.TextBox + Friend WithEvents datagridview1 As FarPoint.Win.Spread.FpSpread + Friend WithEvents datagridview1_Sheet1 As FarPoint.Win.Spread.SheetView + Friend WithEvents ToolStrip1 As System.Windows.Forms.ToolStrip + Friend WithEvents ToolStripButton2 As System.Windows.Forms.ToolStripButton + Friend WithEvents BindingSource1 As System.Windows.Forms.BindingSource +End Class diff --git a/ArinNewFp/lov.resx b/ArinNewFp/lov.resx new file mode 100644 index 0000000..b19c7aa --- /dev/null +++ b/ArinNewFp/lov.resx @@ -0,0 +1,172 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + + + iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 + YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAhFSURBVFhHpVdrTJVHGqZF6Q8DTTZq8PLDoN2gAS9Ea0w0 + NupaW6kQRAEVKCIiIBzuN7nfBLkowqngZVVQ8QZmrb1wWinIuR8U0NXQrGu7PZuYTXaT/bXZpGnePs98 + 37FgtbW7kzyZOTPv+zwz77wz8x2vVy2JiYm/Kyoqii4tLW2vrKwcqqmpcZeXl/+XYJt9HKMNbXW3/7u8 + lpaWNregoKC4oaZGzgGm1lYZu3RJvhsYkH+OjSmwzT6O0Ya29KEvOTSq3168DQbDjobKSrleXy8Prl6V + 727dkonOThmtrhZHdrZYkpMV2GYfx2hDW/rQlxzk0ihfvUzLysoqOwkC1/nz8teeHrmHtjlpn5j37ZNh + haRJbQ3qN2zuVVYoH/p2wo9c5NSof71Mz8zMbL5QWysTfX0y3tAgw/v3gxhgjRWbDxwQiw7VTj4g1oNp + YkY9vD9JA+zvw3eit0/IRU5yaxIvL9NSU1MruxDOry9fFmdRkSKlyLAuNgj0pqfLmewcOZafr/DHnGzp + zciQwdRUsaSkqElqE00WV3GRfH3lspCT3NTQpH5evOPj43cbS0tl4sYNcR0qFjPIiGFgAOQXMjOlKS9P + du3a9XTjxo1jS5cuNRFss49jV2Cj/FI1X8J56JDiJDc1qKVJ/lReW7t27e9LQODAvt1vbhZzGkJKHDwo + fVhdCxItNDT08ZIlS/pgnw/EAmE6EjFmr6N/bR180uF7UAO2xgLcbzmquKlBLfhMOR1vREdHH+mqrpIn + vdfFghCb0zPEkmFAaA1SlpUly5cv/xx26cBmIBCYDbzJes+ePedqcnPlW5NJ7Ll5Ys5Ih28GOFgbFB/x + 5No16aqqFmrB7w1AK4sXL34r12CQ8eu9MlrfIBaE0QrR26gb0L9ixYpbMONxWgT4Aq8DLD4JCQnGKkTH + PTQo9oIC5euBFf3mLLYxCfy+h+iMYxLUoqbO4TVty5YtWS0Izd8++UQsSCgLEsySkyNnYYixB7ChOC+V + yQnkExcXZywH8d+HhsSOhLVAkKL0t4LvC7S7waFxYgz1NzdvSjOiRU1wKD6/8PDwa9dxZO63tSlHKwwG + MYFSJBL2vBU2XPkUcSSdsQRhdd+5I/aSErHAz4LwW/JyxZpfIF+CIxsnpgwcQ+TU8eDECblSUyvUBI8f + yeZERkY+uINbzFlZJVaE0VpYKD3Ygm3btj3BOPecYfcUn6ioKGMRToV7eFgc5eWaj/IjisSEo2lISpLV + q1c/3Lp169Merr6gUI2P1B2WASyUmuCaQ8IAEP7r7tmzYsNKrMXFCi04AevWrfsU40y4Z3seERFhzMOF + 5DabxYFbzqbsD4kVx5Z+JkwkLSGB4k7YF6EeasFJ8vA6KyrE2dEh1MR4AEkD8eP7e0aj2MrKxFpSKtbS + EilITBSccWYrs53FBxExZuO6dVss4sSDwwnbYGuDj628TEyIXHJcnKxatYriPKZrgoKCWgrho2xwD1Bj + DNtATYxzcV7B27dv/96Gx8OG2WkolzysYtmyZRUY51HzQSiNGehzW63irKtTNj/ZV4gJq9u3e5eEhIR4 + xLm6WeTI37sXE4Q9gXfCiXuGmhgPBryCQf5vEwlxXdqqqhTqkUC4MM5jfPbmzZuNafHx4rbZxIlj6rGx + 67UJkfgwKkqCg4Mni/Pef5McjcgXG86/4q+ukS9RUxPjagKB2OvHPdg7Ox4ND7qQxRs2bBhdv379uQOx + e8Rtt4ursXGKjQ3oR0hjIyNfJM4yG/53r2Llmk+Nqi9Bi5oYV1sQsHLlygEmnb3+sNgPE/WCTx5JiYmR + RKxMiSNsdmzTM8CmH6GPCQ+XwMDAF4m/jgss1oDIjXd36z4afxO0qAkblYRzFi5c2JqO/XMcOSKOxiNi + Zw2cwl0wji+dkWPH1G9PP9GP0O/44IOXibP4rlmz5k/X4Pvw4kXla1fcjZKOhVETNuoY+s2YMWPnlk2b + pAdPpwMrVWjCilm3tEzpI/oRnYj335dFixa9THwa3o6UfGT/48FBGcG5dzQ3Kd8eJCu1qAk7dRHxhgsJ + CAjoL0S4HEex2mN4uY4+D62/v65Wtr377i+KI/R7d4SGirW3V/6MCNLPqfMUfhgv1IJdCG2VB4o/ZpS2 + 6Z135Ex+njiPtwLHxdEKsMZvx/E2+Rz7GPqHTSR44Z5j1e/hGHZl4dhZ+3rlIT9q6AseJz5Yz+Aqpga1 + YO+vuWmFT+PKWbNm9cSFhcnHyFRnW/sU2BHG43jZdmPfcbk8whthRL0Tl1UEhKuB23txGi5jzx/jin54 + 5ao429s0//Z2+Rj3P7mpQS1d81nhx8FMIGzevHl30pD5pqYmcX700RTcPXVaJj77TG5fvCAt2Mv9sCPY + /gqrdbtc8heM3z19GvbGZ36mpkYhJ7mpoWv97HOdn0nzgZi5c+e6UnbulJs4Ms4THRpwf7s6TsgIyB/h + 8+pbPMFPR0eBMfkG3wKP+m4oYRdsXbDVfDoVB7nISW5d46Wf6UwK7musv7+/JRqZ3lmQL67OkwBey5MA + ax2uk3o/2x6w7xSAugOvIjnIRU6de/Kz/sLCpKJhjJ+f3823Q0IkA+e2u6wcxKd0ctYe6IKT0I2bjz70 + JQe5dM7Jp+UXC2fJUIVNnz796MyZM0eWBQWp1ZThnT+Dr9xPcS9YEGqCbfZxjDa0pQ99yaFz/erKny/c + JyYLMzbO29u72dfX9wtk8aP58+f/Y8GCBf/BbfYDwTb7OEYb2tJH9yXHb/5r5inMVB4XnlleHKFAApAD + VAENOthmH8doQ1v60Pd//nP6fGEIeXXy/uZ+8iXjc0qwzT6O0eYVw+3l9SN8HWI7NvTF+gAAAABJRU5E + rkJggg== + + + + 265, 17 + + + 156, 17 + + + 17, 17 + + \ No newline at end of file diff --git a/ArinNewFp/lov.vb b/ArinNewFp/lov.vb new file mode 100644 index 0000000..be9b261 --- /dev/null +++ b/ArinNewFp/lov.vb @@ -0,0 +1,106 @@ +Public Class lov + Dim Dt As New DataTable + Dim A As New System.Text.StringBuilder + + Public Msg As String = "" '//lov가 반환한 메세지 : O일경우를 제외하고 반환된다. + Public Row As DataRowView = Nothing '//반환된 데이터로우 : O 이거나 1 일때만 반환된다. + Public StatusE As rStatus + Public Enum rStatus + NotFound = 1 '//검색어에대한 데이터가 없다 + OneRow = 2 '//하나밖에없었다(ok) + Multirow = 3 '//여러개의 데이터가 조재한다. + Canceld = 4 '//취소되었다. + End Enum +#Region "New Function" + Public Sub New() + InitializeComponent() + End Sub + Public Sub New(ByVal Dtable As DataTable, Optional ByVal ImeMode As System.Windows.Forms.ImeMode = System.Windows.Forms.ImeMode.Hangul) + ' 이 호출은 Windows Form 디자이너에 필요합니다. + Dt = Dtable + InitializeComponent() + Me.BindingSource1.DataSource = Dt + Me.datagridview1.DataSource = Me.BindingSource1 + Me.tb_searchtext.ImeMode = ImeMode + End Sub +#End Region + +#Region "OK/CANCEL 버튼" + Private Sub Prc_OK() + Msg = "사용자선택" + Row = Me.BindingSource1.Current + StatusE = rStatus.OneRow + Me.DialogResult = System.Windows.Forms.DialogResult.OK + Me.Close() + End Sub + + Private Sub Prc_CalCel() + Msg = "사용자취소" + Row = Nothing + StatusE = rStatus.Canceld + Me.DialogResult = System.Windows.Forms.DialogResult.Cancel + Me.Close() + End Sub +#End Region + + + + ''' + ''' where 절을 생성한후 리턴(모든 열에대한 같은 where like 절 + ''' + ''' + ''' + Private Function WhereState() As String + A.Remove(0, A.Length) + For i As Integer = 0 To Me.Dt.Columns.Count - 1 + + If Dt.Columns(i).DataType.Name.ToUpper = "STRING" Then + A.Append(IIf(i = 0, "", Space(1) & "or ") & Dt.Columns(i).Caption & " like '" & Me.tb_searchtext.Text & "%'") + End If + Next + Return A.ToString + End Function + + Private Sub TextBox1_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles tb_searchtext.TextChanged + Me.BindingSource1.Filter = Me.WhereState + End Sub + Private Sub TextBox1_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles tb_searchtext.KeyDown + Select Case e.KeyCode + Case Keys.Down, Keys.Enter + Me.DataGridView1.Focus() + If Me.datagridview1.ActiveSheet.RowCount = 1 Then Me.Prc_OK() + Case Keys.Escape + Me.Prc_CalCel() + End Select + End Sub + + + Private Sub datagridview1_CellDoubleClick(ByVal sender As Object, ByVal e As FarPoint.Win.Spread.CellClickEventArgs) Handles datagridview1.CellDoubleClick + Me.Prc_OK() + End Sub + + Private Sub datagridview1_KeyDown1(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles datagridview1.KeyDown + Select Case e.KeyCode + Case Keys.F5 + Case Keys.Escape + Me.tb_searchtext.Focus() + Case Keys.Enter + Me.Prc_OK() + End Select + End Sub + + Private Sub datagridview1_KeyUp1(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles datagridview1.KeyUp + Select Case e.KeyCode + Case Keys.Escape + Me.tb_searchtext.Focus() + End Select + End Sub + + Private Sub ToolStripButton2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton2.Click + Me.Prc_OK() + End Sub + + Private Sub ToolStripButton1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton1.Click + Me.Prc_CalCel() + End Sub +End Class \ No newline at end of file diff --git a/ArinNewFpv11/ArinNewFp11.vbproj b/ArinNewFpv11/ArinNewFp11.vbproj new file mode 100644 index 0000000..87096ca --- /dev/null +++ b/ArinNewFpv11/ArinNewFp11.vbproj @@ -0,0 +1,243 @@ + + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {3611D55B-71E3-4D92-9EFC-43F7D8BB8525} + Library + ArinNewFp + ArinNewFp + Windows + + + 3.5 + + + false + v4.0 + publish\ + true + Disk + false + Foreground + 7 + Days + false + false + true + 0 + 1.0.0.%2a + false + true + + + + true + full + true + true + bin\Debug\ + + + _MYFORMS=True + 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022,42353,42354,42355 + x86 + + + pdbonly + false + true + true + bin\debug\ + + + _MYFORMS=True + 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022,42353,42354,42355 + x86 + + + + False + C:\Program Files (x86)\GrapeCity\Spread.NET 11\Windows Forms\v11.40.20177.0\bin\FarPoint.CalcEngine.dll + + + False + C:\Program Files (x86)\GrapeCity\Spread.NET 11\Windows Forms\v11.40.20177.0\bin\FarPoint.Excel.dll + + + False + C:\Program Files (x86)\GrapeCity\Spread.NET 11\Windows Forms\v11.40.20177.0\bin\FarPoint.Localization.dll + + + False + C:\Program Files (x86)\GrapeCity\Spread.NET 11\Windows Forms\v11.40.20177.0\bin\FarPoint.PDF.dll + + + False + C:\Program Files (x86)\GrapeCity\Spread.NET 11\Windows Forms\v11.40.20177.0\bin\FarPoint.PluginCalendar.WinForms.dll + + + False + C:\Program Files (x86)\GrapeCity\Spread.NET 11\Windows Forms\v11.40.20177.0\bin\FarPoint.Win.dll + + + False + C:\Program Files (x86)\GrapeCity\Spread.NET 11\Windows Forms\v11.40.20177.0\bin\FarPoint.Win.Chart.dll + + + False + C:\Program Files (x86)\GrapeCity\Spread.NET 11\Windows Forms\v11.40.20177.0\bin\FarPoint.Win.Spread.dll + + + False + C:\Program Files (x86)\GrapeCity\Spread.NET 11\Windows Forms\v11.40.20177.0\bin\FarPoint.Win.Spread.Html.dll + + + False + C:\Program Files (x86)\GrapeCity\Spread.NET 11\Windows Forms\v11.40.20177.0\bin\FarPoint.Win.TextRenderer.dll + + + False + C:\Program Files (x86)\GrapeCity\Spread.NET 11\Windows Forms\v11.40.20177.0\bin\GrapeCity.CalcEngine.dll + + + False + C:\Program Files (x86)\GrapeCity\Spread.NET 11\Windows Forms\v11.40.20177.0\bin\GrapeCity.Spreadsheet.dll + + + False + C:\Program Files (x86)\GrapeCity\Spread.NET 11\Windows Forms\v11.40.20177.0\bin\GrapeCity.Spreadsheet.Win.dll + + + False + C:\Program Files (x86)\GrapeCity\Spread.NET 11\Windows Forms\v11.40.20177.0\bin\GrapeCity.Win.PluginInputMan.dll + + + False + C:\Program Files (x86)\GrapeCity\Spread.NET 11\Windows Forms\v11.40.20177.0\bin\GrapeCity.Win.PluginInputMan.Design.dll + + + False + C:\Program Files (x86)\GrapeCity\Spread.NET 11\Windows Forms\v11.40.20177.0\bin\policy.11.0.FarPoint.Win.dll + + + False + C:\Program Files (x86)\GrapeCity\Spread.NET 11\Windows Forms\v11.40.20177.0\bin\policy.11.0.FarPoint.Win.Spread.dll + + + + + + + + + + + + + + + + + + + + + + lov.vb + + + Form + + + True + Application.myapp + + + + Component + + + NewFp.vb + + + + True + True + Resources.resx + + + True + Settings.settings + True + + + + + Designer + lov.vb + + + + VbMyResourcesResXFileCodeGenerator + Resources.Designer.vb + My.Resources + Designer + + + Designer + NewFp.vb + + + + + MyApplicationCodeGenerator + Application.Designer.vb + + + SettingsSingleFileGenerator + My + Settings.Designer.vb + + + + + + + + False + .NET Framework 3.5 SP1 Client Profile + false + + + False + .NET Framework 2.0%28x86%29 + true + + + False + .NET Framework 3.0%28x86%29 + false + + + False + .NET Framework 3.5 + false + + + False + .NET Framework 3.5 SP1 + false + + + + + \ No newline at end of file diff --git a/ArinNewFpv11/My Project/Application.Designer.vb b/ArinNewFpv11/My Project/Application.Designer.vb new file mode 100644 index 0000000..c33da88 --- /dev/null +++ b/ArinNewFpv11/My Project/Application.Designer.vb @@ -0,0 +1,13 @@ +'------------------------------------------------------------------------------ +' +' 이 코드는 도구를 사용하여 생성되었습니다. +' 런타임 버전:4.0.30319.42000 +' +' 파일 내용을 변경하면 잘못된 동작이 발생할 수 있으며, 코드를 다시 생성하면 +' 이러한 변경 내용이 손실됩니다. +' +'------------------------------------------------------------------------------ + +Option Strict On +Option Explicit On + diff --git a/ArinNewFpv11/My Project/Application.myapp b/ArinNewFpv11/My Project/Application.myapp new file mode 100644 index 0000000..758895d --- /dev/null +++ b/ArinNewFpv11/My Project/Application.myapp @@ -0,0 +1,10 @@ + + + false + false + 0 + true + 0 + 1 + true + diff --git a/ArinNewFpv11/My Project/AssemblyInfo.vb b/ArinNewFpv11/My Project/AssemblyInfo.vb new file mode 100644 index 0000000..c1c0a65 --- /dev/null +++ b/ArinNewFpv11/My Project/AssemblyInfo.vb @@ -0,0 +1,34 @@ +Imports System +Imports System.Reflection +Imports System.Runtime.InteropServices + +' 어셈블리의 일반 정보는 다음 특성 집합을 통해 제어됩니다. +' 어셈블리와 관련된 정보를 수정하려면 +' 이 특성 값을 변경하십시오. + +' 어셈블리 특성 값을 검토합니다. + + + + + + + + + + +'이 프로젝트가 COM에 노출되는 경우 다음 GUID는 typelib의 ID를 나타냅니다. + + +' 어셈블리의 버전 정보는 다음 네 가지 값으로 구성됩니다. +' +' 주 버전 +' 부 버전 +' 빌드 번호 +' 수정 버전 +' +' 모든 값을 지정하거나 아래와 같이 '*'를 사용하여 빌드 번호 및 수정 버전이 자동으로 +' 지정되도록 할 수 있습니다. + + + diff --git a/ArinNewFpv11/My Project/Resources.Designer.vb b/ArinNewFpv11/My Project/Resources.Designer.vb new file mode 100644 index 0000000..f4a3f63 --- /dev/null +++ b/ArinNewFpv11/My Project/Resources.Designer.vb @@ -0,0 +1,63 @@ +'------------------------------------------------------------------------------ +' +' 이 코드는 도구를 사용하여 생성되었습니다. +' 런타임 버전:4.0.30319.42000 +' +' 파일 내용을 변경하면 잘못된 동작이 발생할 수 있으며, 코드를 다시 생성하면 +' 이러한 변경 내용이 손실됩니다. +' +'------------------------------------------------------------------------------ + +Option Strict On +Option Explicit On + +Imports System + +Namespace My.Resources + + '이 클래스는 ResGen 또는 Visual Studio와 같은 도구를 통해 StronglyTypedResourceBuilder + '클래스에서 자동으로 생성되었습니다. + '멤버를 추가하거나 제거하려면 .ResX 파일을 편집한 다음 /str 옵션을 사용하여 ResGen을 + '다시 실행하거나 VS 프로젝트를 다시 빌드하십시오. + ''' + ''' 지역화된 문자열 등을 찾기 위한 강력한 형식의 리소스 클래스입니다. + ''' + _ + Friend Module Resources + + Private resourceMan As Global.System.Resources.ResourceManager + + Private resourceCulture As Global.System.Globalization.CultureInfo + + ''' + ''' 이 클래스에서 사용하는 캐시된 ResourceManager 인스턴스를 반환합니다. + ''' + _ + Friend ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager + Get + If Object.ReferenceEquals(resourceMan, Nothing) Then + Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("ArinNewFp.Resources", GetType(Resources).Assembly) + resourceMan = temp + End If + Return resourceMan + End Get + End Property + + ''' + ''' 이 강력한 형식의 리소스 클래스를 사용하여 모든 리소스 조회에 대한 현재 스레드의 CurrentUICulture + ''' 속성을 재정의합니다. + ''' + _ + Friend Property Culture() As Global.System.Globalization.CultureInfo + Get + Return resourceCulture + End Get + Set + resourceCulture = value + End Set + End Property + End Module +End Namespace diff --git a/ArinNewFpv11/My Project/Resources.resx b/ArinNewFpv11/My Project/Resources.resx new file mode 100644 index 0000000..af7dbeb --- /dev/null +++ b/ArinNewFpv11/My Project/Resources.resx @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/ArinNewFpv11/My Project/Settings.Designer.vb b/ArinNewFpv11/My Project/Settings.Designer.vb new file mode 100644 index 0000000..1010f54 --- /dev/null +++ b/ArinNewFpv11/My Project/Settings.Designer.vb @@ -0,0 +1,73 @@ +'------------------------------------------------------------------------------ +' +' 이 코드는 도구를 사용하여 생성되었습니다. +' 런타임 버전:4.0.30319.42000 +' +' 파일 내용을 변경하면 잘못된 동작이 발생할 수 있으며, 코드를 다시 생성하면 +' 이러한 변경 내용이 손실됩니다. +' +'------------------------------------------------------------------------------ + +Option Strict On +Option Explicit On + + +Namespace My + + _ + Partial Friend NotInheritable Class MySettings + Inherits Global.System.Configuration.ApplicationSettingsBase + + Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings()),MySettings) + +#Region "My.Settings 자동 저장 기능" +#If _MyType = "WindowsForms" Then + Private Shared addedHandler As Boolean + + Private Shared addedHandlerLockObject As New Object + + _ + Private Shared Sub AutoSaveSettings(ByVal sender As Global.System.Object, ByVal e As Global.System.EventArgs) + If My.Application.SaveMySettingsOnExit Then + My.Settings.Save() + End If + End Sub +#End If +#End Region + + Public Shared ReadOnly Property [Default]() As MySettings + Get + +#If _MyType = "WindowsForms" Then + If Not addedHandler Then + SyncLock addedHandlerLockObject + If Not addedHandler Then + AddHandler My.Application.Shutdown, AddressOf AutoSaveSettings + addedHandler = True + End If + End SyncLock + End If +#End If + Return defaultInstance + End Get + End Property + End Class +End Namespace + +Namespace My + + _ + Friend Module MySettingsProperty + + _ + Friend ReadOnly Property Settings() As Global.ArinNewFp.My.MySettings + Get + Return Global.ArinNewFp.My.MySettings.Default + End Get + End Property + End Module +End Namespace diff --git a/ArinNewFpv11/My Project/Settings.settings b/ArinNewFpv11/My Project/Settings.settings new file mode 100644 index 0000000..85b890b --- /dev/null +++ b/ArinNewFpv11/My Project/Settings.settings @@ -0,0 +1,7 @@ + + + + + + + diff --git a/ArinNewFpv11/My Project/licenses.licx b/ArinNewFpv11/My Project/licenses.licx new file mode 100644 index 0000000..43d4733 --- /dev/null +++ b/ArinNewFpv11/My Project/licenses.licx @@ -0,0 +1 @@ +FarPoint.Win.Spread.FpSpread, FarPoint.Win.Spread, Version=11.40.20177.0, Culture=neutral, PublicKeyToken=327c3516b1b18457 diff --git a/ArinNewFpv13/ArinNewFp13.vbproj b/ArinNewFpv13/ArinNewFp13.vbproj new file mode 100644 index 0000000..75dcfb9 --- /dev/null +++ b/ArinNewFpv13/ArinNewFp13.vbproj @@ -0,0 +1,190 @@ + + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {3611D55B-71E3-4D92-9EFC-43F7D8BB8555} + Library + ArinNewFp + ArinNewFp + Windows + + + 3.5 + + + false + v4.5.2 + publish\ + true + Disk + false + Foreground + 7 + Days + false + false + true + 0 + 1.0.0.%2a + false + true + + + + true + full + true + true + bin\Debug\ + + + _MYFORMS=True + 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022,42353,42354,42355 + x86 + false + + + pdbonly + false + true + true + bin\debug\ + + + _MYFORMS=True + 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022,42353,42354,42355 + x86 + false + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + lov.vb + + + Form + + + True + Application.myapp + + + + Component + + + NewFp.vb + + + + True + True + Resources.resx + + + True + Settings.settings + True + + + + + Designer + lov.vb + + + + VbMyResourcesResXFileCodeGenerator + Resources.Designer.vb + My.Resources + Designer + + + Designer + NewFp.vb + + + + + MyApplicationCodeGenerator + Application.Designer.vb + + + SettingsSingleFileGenerator + My + Settings.Designer.vb + + + + + + + + False + .NET Framework 3.5 SP1 Client Profile + false + + + False + .NET Framework 2.0%28x86%29 + true + + + False + .NET Framework 3.0%28x86%29 + false + + + False + .NET Framework 3.5 + false + + + False + .NET Framework 3.5 SP1 + false + + + + + \ No newline at end of file diff --git a/ArinNewFpv13/My Project/Application.Designer.vb b/ArinNewFpv13/My Project/Application.Designer.vb new file mode 100644 index 0000000..c33da88 --- /dev/null +++ b/ArinNewFpv13/My Project/Application.Designer.vb @@ -0,0 +1,13 @@ +'------------------------------------------------------------------------------ +' +' 이 코드는 도구를 사용하여 생성되었습니다. +' 런타임 버전:4.0.30319.42000 +' +' 파일 내용을 변경하면 잘못된 동작이 발생할 수 있으며, 코드를 다시 생성하면 +' 이러한 변경 내용이 손실됩니다. +' +'------------------------------------------------------------------------------ + +Option Strict On +Option Explicit On + diff --git a/ArinNewFpv13/My Project/Application.myapp b/ArinNewFpv13/My Project/Application.myapp new file mode 100644 index 0000000..758895d --- /dev/null +++ b/ArinNewFpv13/My Project/Application.myapp @@ -0,0 +1,10 @@ + + + false + false + 0 + true + 0 + 1 + true + diff --git a/ArinNewFpv13/My Project/AssemblyInfo.vb b/ArinNewFpv13/My Project/AssemblyInfo.vb new file mode 100644 index 0000000..c1c0a65 --- /dev/null +++ b/ArinNewFpv13/My Project/AssemblyInfo.vb @@ -0,0 +1,34 @@ +Imports System +Imports System.Reflection +Imports System.Runtime.InteropServices + +' 어셈블리의 일반 정보는 다음 특성 집합을 통해 제어됩니다. +' 어셈블리와 관련된 정보를 수정하려면 +' 이 특성 값을 변경하십시오. + +' 어셈블리 특성 값을 검토합니다. + + + + + + + + + + +'이 프로젝트가 COM에 노출되는 경우 다음 GUID는 typelib의 ID를 나타냅니다. + + +' 어셈블리의 버전 정보는 다음 네 가지 값으로 구성됩니다. +' +' 주 버전 +' 부 버전 +' 빌드 번호 +' 수정 버전 +' +' 모든 값을 지정하거나 아래와 같이 '*'를 사용하여 빌드 번호 및 수정 버전이 자동으로 +' 지정되도록 할 수 있습니다. + + + diff --git a/ArinNewFpv13/My Project/Resources.Designer.vb b/ArinNewFpv13/My Project/Resources.Designer.vb new file mode 100644 index 0000000..c9c886a --- /dev/null +++ b/ArinNewFpv13/My Project/Resources.Designer.vb @@ -0,0 +1,63 @@ +'------------------------------------------------------------------------------ +' +' 이 코드는 도구를 사용하여 생성되었습니다. +' 런타임 버전:4.0.30319.42000 +' +' 파일 내용을 변경하면 잘못된 동작이 발생할 수 있으며, 코드를 다시 생성하면 +' 이러한 변경 내용이 손실됩니다. +' +'------------------------------------------------------------------------------ + +Option Strict On +Option Explicit On + +Imports System + +Namespace My.Resources + + '이 클래스는 ResGen 또는 Visual Studio와 같은 도구를 통해 StronglyTypedResourceBuilder + '클래스에서 자동으로 생성되었습니다. + '멤버를 추가하거나 제거하려면 .ResX 파일을 편집한 다음 /str 옵션을 사용하여 ResGen을 + '다시 실행하거나 VS 프로젝트를 다시 빌드하십시오. + ''' + ''' 지역화된 문자열 등을 찾기 위한 강력한 형식의 리소스 클래스입니다. + ''' + _ + Friend Module Resources + + Private resourceMan As Global.System.Resources.ResourceManager + + Private resourceCulture As Global.System.Globalization.CultureInfo + + ''' + ''' 이 클래스에서 사용하는 캐시된 ResourceManager 인스턴스를 반환합니다. + ''' + _ + Friend ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager + Get + If Object.ReferenceEquals(resourceMan, Nothing) Then + Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("ArinNewFp.Resources", GetType(Resources).Assembly) + resourceMan = temp + End If + Return resourceMan + End Get + End Property + + ''' + ''' 이 강력한 형식의 리소스 클래스를 사용하여 모든 리소스 조회에 대해 현재 스레드의 CurrentUICulture 속성을 + ''' 재정의합니다. + ''' + _ + Friend Property Culture() As Global.System.Globalization.CultureInfo + Get + Return resourceCulture + End Get + Set + resourceCulture = value + End Set + End Property + End Module +End Namespace diff --git a/ArinNewFpv13/My Project/Resources.resx b/ArinNewFpv13/My Project/Resources.resx new file mode 100644 index 0000000..af7dbeb --- /dev/null +++ b/ArinNewFpv13/My Project/Resources.resx @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/ArinNewFpv13/My Project/Settings.Designer.vb b/ArinNewFpv13/My Project/Settings.Designer.vb new file mode 100644 index 0000000..ffbd675 --- /dev/null +++ b/ArinNewFpv13/My Project/Settings.Designer.vb @@ -0,0 +1,73 @@ +'------------------------------------------------------------------------------ +' +' 이 코드는 도구를 사용하여 생성되었습니다. +' 런타임 버전:4.0.30319.42000 +' +' 파일 내용을 변경하면 잘못된 동작이 발생할 수 있으며, 코드를 다시 생성하면 +' 이러한 변경 내용이 손실됩니다. +' +'------------------------------------------------------------------------------ + +Option Strict On +Option Explicit On + + +Namespace My + + _ + Partial Friend NotInheritable Class MySettings + Inherits Global.System.Configuration.ApplicationSettingsBase + + Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings()),MySettings) + +#Region "My.Settings 자동 저장 기능" +#If _MyType = "WindowsForms" Then + Private Shared addedHandler As Boolean + + Private Shared addedHandlerLockObject As New Object + + _ + Private Shared Sub AutoSaveSettings(sender As Global.System.Object, e As Global.System.EventArgs) + If My.Application.SaveMySettingsOnExit Then + My.Settings.Save() + End If + End Sub +#End If +#End Region + + Public Shared ReadOnly Property [Default]() As MySettings + Get + +#If _MyType = "WindowsForms" Then + If Not addedHandler Then + SyncLock addedHandlerLockObject + If Not addedHandler Then + AddHandler My.Application.Shutdown, AddressOf AutoSaveSettings + addedHandler = True + End If + End SyncLock + End If +#End If + Return defaultInstance + End Get + End Property + End Class +End Namespace + +Namespace My + + _ + Friend Module MySettingsProperty + + _ + Friend ReadOnly Property Settings() As Global.ArinNewFp.My.MySettings + Get + Return Global.ArinNewFp.My.MySettings.Default + End Get + End Property + End Module +End Namespace diff --git a/ArinNewFpv13/My Project/Settings.settings b/ArinNewFpv13/My Project/Settings.settings new file mode 100644 index 0000000..85b890b --- /dev/null +++ b/ArinNewFpv13/My Project/Settings.settings @@ -0,0 +1,7 @@ + + + + + + + diff --git a/ArinNewFpv13/My Project/licenses.licx b/ArinNewFpv13/My Project/licenses.licx new file mode 100644 index 0000000..15613e2 --- /dev/null +++ b/ArinNewFpv13/My Project/licenses.licx @@ -0,0 +1 @@ +FarPoint.Win.Spread.FpSpread, FarPoint.Win.Spread, Version=13.45.20191.0, Culture=neutral, PublicKeyToken=327c3516b1b18457 diff --git a/ArinNewFpv4.Netfx2/ArinNewFp4_Fx2.vbproj b/ArinNewFpv4.Netfx2/ArinNewFp4_Fx2.vbproj new file mode 100644 index 0000000..e867009 --- /dev/null +++ b/ArinNewFpv4.Netfx2/ArinNewFp4_Fx2.vbproj @@ -0,0 +1,201 @@ + + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {4F920F6C-6C0F-4866-9033-9F9839CB7853} + Library + ArinNewFp + ArinNewFp + Windows + + + 3.5 + + + false + v2.0 + publish\ + true + Disk + false + Foreground + 7 + Days + false + false + true + 0 + 1.0.0.%2a + false + true + + + + true + full + true + true + bin\Debug\ + + + _MYFORMS=True + 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022,42353,42354,42355 + x86 + + + pdbonly + false + true + true + bin\debug\ + + + _MYFORMS=True + 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022,42353,42354,42355 + + + + + + + + + + + + + + + + + + + + + + + Form1.vb + + + Form + + + Form2.vb + + + Form + + + Form3.vb + + + Form + + + lov.vb + + + Form + + + True + Application.myapp + + + + Component + + + NewFp.vb + + + + True + True + Resources.resx + + + True + Settings.settings + True + + + + + Form1.vb + + + Form2.vb + + + Designer + lov.vb + + + + VbMyResourcesResXFileCodeGenerator + Resources.Designer.vb + My.Resources + Designer + + + Designer + NewFp.vb + + + + + MyApplicationCodeGenerator + Application.Designer.vb + + + SettingsSingleFileGenerator + My + Settings.Designer.vb + + + + + + + + False + .NET Framework 3.5 SP1 Client Profile + false + + + False + .NET Framework 2.0%28x86%29 + true + + + False + .NET Framework 3.0%28x86%29 + false + + + False + .NET Framework 3.5 + false + + + False + .NET Framework 3.5 SP1 + false + + + + + + + + \ No newline at end of file diff --git a/ArinNewFpv4.Netfx2/Form1.Designer.vb b/ArinNewFpv4.Netfx2/Form1.Designer.vb new file mode 100644 index 0000000..e500f21 --- /dev/null +++ b/ArinNewFpv4.Netfx2/Form1.Designer.vb @@ -0,0 +1,61 @@ + _ +Partial Class Form1 + Inherits System.Windows.Forms.Form + + 'Form은 Dispose를 재정의하여 구성 요소 목록을 정리합니다. + _ + Protected Overrides Sub Dispose(ByVal disposing As Boolean) + Try + If disposing AndAlso components IsNot Nothing Then + components.Dispose() + End If + Finally + MyBase.Dispose(disposing) + End Try + End Sub + + 'Windows Form 디자이너에 필요합니다. + Private components As System.ComponentModel.IContainer + + '참고: 다음 프로시저는 Windows Form 디자이너에 필요합니다. + '수정하려면 Windows Form 디자이너를 사용하십시오. + '코드 편집기에서는 수정하지 마세요. + _ + Private Sub InitializeComponent() + Me.FpSpread1 = New FarPoint.Win.Spread.FpSpread() + Me.FpSpread1_Sheet1 = New FarPoint.Win.Spread.SheetView() + CType(Me.FpSpread1, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.FpSpread1_Sheet1, System.ComponentModel.ISupportInitialize).BeginInit() + Me.SuspendLayout() + ' + 'FpSpread1 + ' + Me.FpSpread1.AccessibleDescription = "" + Me.FpSpread1.Location = New System.Drawing.Point(42, 148) + Me.FpSpread1.Name = "FpSpread1" + Me.FpSpread1.Sheets.AddRange(New FarPoint.Win.Spread.SheetView() {Me.FpSpread1_Sheet1}) + Me.FpSpread1.Size = New System.Drawing.Size(200, 100) + Me.FpSpread1.TabIndex = 0 + ' + 'FpSpread1_Sheet1 + ' + Me.FpSpread1_Sheet1.Reset() + FpSpread1_Sheet1.SheetName = "Sheet1" + ' + 'Form1 + ' + Me.AutoScaleDimensions = New System.Drawing.SizeF(7.0!, 12.0!) + Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.ClientSize = New System.Drawing.Size(284, 261) + Me.Controls.Add(Me.FpSpread1) + Me.Name = "Form1" + Me.Text = "Form1" + CType(Me.FpSpread1, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.FpSpread1_Sheet1, System.ComponentModel.ISupportInitialize).EndInit() + Me.ResumeLayout(False) + + End Sub + + Friend WithEvents FpSpread1 As FarPoint.Win.Spread.FpSpread + Friend WithEvents FpSpread1_Sheet1 As FarPoint.Win.Spread.SheetView +End Class diff --git a/ArinNewFpv4.Netfx2/Form1.resx b/ArinNewFpv4.Netfx2/Form1.resx new file mode 100644 index 0000000..7277865 --- /dev/null +++ b/ArinNewFpv4.Netfx2/Form1.resx @@ -0,0 +1,123 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 17, 17 + + \ No newline at end of file diff --git a/ArinNewFpv4.Netfx2/Form1.vb b/ArinNewFpv4.Netfx2/Form1.vb new file mode 100644 index 0000000..10d55d4 --- /dev/null +++ b/ArinNewFpv4.Netfx2/Form1.vb @@ -0,0 +1,3 @@ +Public Class Form1 + +End Class \ No newline at end of file diff --git a/ArinNewFpv4.Netfx2/Form2.Designer.vb b/ArinNewFpv4.Netfx2/Form2.Designer.vb new file mode 100644 index 0000000..8c8946f --- /dev/null +++ b/ArinNewFpv4.Netfx2/Form2.Designer.vb @@ -0,0 +1,61 @@ + _ +Partial Class Form2 + Inherits System.Windows.Forms.Form + + 'Form은 Dispose를 재정의하여 구성 요소 목록을 정리합니다. + _ + Protected Overrides Sub Dispose(ByVal disposing As Boolean) + Try + If disposing AndAlso components IsNot Nothing Then + components.Dispose() + End If + Finally + MyBase.Dispose(disposing) + End Try + End Sub + + 'Windows Form 디자이너에 필요합니다. + Private components As System.ComponentModel.IContainer + + '참고: 다음 프로시저는 Windows Form 디자이너에 필요합니다. + '수정하려면 Windows Form 디자이너를 사용하십시오. + '코드 편집기에서는 수정하지 마세요. + _ + Private Sub InitializeComponent() + Me.FpSpread1 = New FarPoint.Win.Spread.FpSpread() + Me.FpSpread1_Sheet1 = New FarPoint.Win.Spread.SheetView() + CType(Me.FpSpread1, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.FpSpread1_Sheet1, System.ComponentModel.ISupportInitialize).BeginInit() + Me.SuspendLayout() + ' + 'FpSpread1 + ' + Me.FpSpread1.AccessibleDescription = "" + Me.FpSpread1.Location = New System.Drawing.Point(128, 61) + Me.FpSpread1.Name = "FpSpread1" + Me.FpSpread1.Sheets.AddRange(New FarPoint.Win.Spread.SheetView() {Me.FpSpread1_Sheet1}) + Me.FpSpread1.Size = New System.Drawing.Size(200, 100) + Me.FpSpread1.TabIndex = 0 + ' + 'FpSpread1_Sheet1 + ' + Me.FpSpread1_Sheet1.Reset() + FpSpread1_Sheet1.SheetName = "Sheet1" + ' + 'Form2 + ' + Me.AutoScaleDimensions = New System.Drawing.SizeF(7.0!, 12.0!) + Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.ClientSize = New System.Drawing.Size(284, 261) + Me.Controls.Add(Me.FpSpread1) + Me.Name = "Form2" + Me.Text = "Form2" + CType(Me.FpSpread1, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.FpSpread1_Sheet1, System.ComponentModel.ISupportInitialize).EndInit() + Me.ResumeLayout(False) + + End Sub + + Friend WithEvents FpSpread1 As FarPoint.Win.Spread.FpSpread + Friend WithEvents FpSpread1_Sheet1 As FarPoint.Win.Spread.SheetView +End Class diff --git a/ArinNewFpv4.Netfx2/Form2.resx b/ArinNewFpv4.Netfx2/Form2.resx new file mode 100644 index 0000000..7277865 --- /dev/null +++ b/ArinNewFpv4.Netfx2/Form2.resx @@ -0,0 +1,123 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 17, 17 + + \ No newline at end of file diff --git a/ArinNewFpv4.Netfx2/Form2.vb b/ArinNewFpv4.Netfx2/Form2.vb new file mode 100644 index 0000000..361d614 --- /dev/null +++ b/ArinNewFpv4.Netfx2/Form2.vb @@ -0,0 +1,3 @@ +Public Class Form2 + +End Class \ No newline at end of file diff --git a/ArinNewFpv4.Netfx2/Form3.Designer.vb b/ArinNewFpv4.Netfx2/Form3.Designer.vb new file mode 100644 index 0000000..11469a6 --- /dev/null +++ b/ArinNewFpv4.Netfx2/Form3.Designer.vb @@ -0,0 +1,29 @@ + _ +Partial Class Form3 + Inherits System.Windows.Forms.Form + + 'Form은 Dispose를 재정의하여 구성 요소 목록을 정리합니다. + _ + Protected Overrides Sub Dispose(ByVal disposing As Boolean) + Try + If disposing AndAlso components IsNot Nothing Then + components.Dispose() + End If + Finally + MyBase.Dispose(disposing) + End Try + End Sub + + 'Windows Form 디자이너에 필요합니다. + Private components As System.ComponentModel.IContainer + + '참고: 다음 프로시저는 Windows Form 디자이너에 필요합니다. + '수정하려면 Windows Form 디자이너를 사용하십시오. + '코드 편집기를 사용하여 수정하지 마십시오. + _ + Private Sub InitializeComponent() + components = New System.ComponentModel.Container + Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.Text = "Form3" + End Sub +End Class diff --git a/ArinNewFpv4.Netfx2/Form3.vb b/ArinNewFpv4.Netfx2/Form3.vb new file mode 100644 index 0000000..a77cc2a --- /dev/null +++ b/ArinNewFpv4.Netfx2/Form3.vb @@ -0,0 +1,3 @@ +Public Class Form3 + +End Class \ No newline at end of file diff --git a/ArinNewFpv4.Netfx2/My Project/Application.Designer.vb b/ArinNewFpv4.Netfx2/My Project/Application.Designer.vb new file mode 100644 index 0000000..c33da88 --- /dev/null +++ b/ArinNewFpv4.Netfx2/My Project/Application.Designer.vb @@ -0,0 +1,13 @@ +'------------------------------------------------------------------------------ +' +' 이 코드는 도구를 사용하여 생성되었습니다. +' 런타임 버전:4.0.30319.42000 +' +' 파일 내용을 변경하면 잘못된 동작이 발생할 수 있으며, 코드를 다시 생성하면 +' 이러한 변경 내용이 손실됩니다. +' +'------------------------------------------------------------------------------ + +Option Strict On +Option Explicit On + diff --git a/ArinNewFpv4.Netfx2/My Project/Application.myapp b/ArinNewFpv4.Netfx2/My Project/Application.myapp new file mode 100644 index 0000000..758895d --- /dev/null +++ b/ArinNewFpv4.Netfx2/My Project/Application.myapp @@ -0,0 +1,10 @@ + + + false + false + 0 + true + 0 + 1 + true + diff --git a/ArinNewFpv4.Netfx2/My Project/AssemblyInfo.vb b/ArinNewFpv4.Netfx2/My Project/AssemblyInfo.vb new file mode 100644 index 0000000..c1c0a65 --- /dev/null +++ b/ArinNewFpv4.Netfx2/My Project/AssemblyInfo.vb @@ -0,0 +1,34 @@ +Imports System +Imports System.Reflection +Imports System.Runtime.InteropServices + +' 어셈블리의 일반 정보는 다음 특성 집합을 통해 제어됩니다. +' 어셈블리와 관련된 정보를 수정하려면 +' 이 특성 값을 변경하십시오. + +' 어셈블리 특성 값을 검토합니다. + + + + + + + + + + +'이 프로젝트가 COM에 노출되는 경우 다음 GUID는 typelib의 ID를 나타냅니다. + + +' 어셈블리의 버전 정보는 다음 네 가지 값으로 구성됩니다. +' +' 주 버전 +' 부 버전 +' 빌드 번호 +' 수정 버전 +' +' 모든 값을 지정하거나 아래와 같이 '*'를 사용하여 빌드 번호 및 수정 버전이 자동으로 +' 지정되도록 할 수 있습니다. + + + diff --git a/ArinNewFpv4.Netfx2/My Project/Resources.Designer.vb b/ArinNewFpv4.Netfx2/My Project/Resources.Designer.vb new file mode 100644 index 0000000..c9c886a --- /dev/null +++ b/ArinNewFpv4.Netfx2/My Project/Resources.Designer.vb @@ -0,0 +1,63 @@ +'------------------------------------------------------------------------------ +' +' 이 코드는 도구를 사용하여 생성되었습니다. +' 런타임 버전:4.0.30319.42000 +' +' 파일 내용을 변경하면 잘못된 동작이 발생할 수 있으며, 코드를 다시 생성하면 +' 이러한 변경 내용이 손실됩니다. +' +'------------------------------------------------------------------------------ + +Option Strict On +Option Explicit On + +Imports System + +Namespace My.Resources + + '이 클래스는 ResGen 또는 Visual Studio와 같은 도구를 통해 StronglyTypedResourceBuilder + '클래스에서 자동으로 생성되었습니다. + '멤버를 추가하거나 제거하려면 .ResX 파일을 편집한 다음 /str 옵션을 사용하여 ResGen을 + '다시 실행하거나 VS 프로젝트를 다시 빌드하십시오. + ''' + ''' 지역화된 문자열 등을 찾기 위한 강력한 형식의 리소스 클래스입니다. + ''' + _ + Friend Module Resources + + Private resourceMan As Global.System.Resources.ResourceManager + + Private resourceCulture As Global.System.Globalization.CultureInfo + + ''' + ''' 이 클래스에서 사용하는 캐시된 ResourceManager 인스턴스를 반환합니다. + ''' + _ + Friend ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager + Get + If Object.ReferenceEquals(resourceMan, Nothing) Then + Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("ArinNewFp.Resources", GetType(Resources).Assembly) + resourceMan = temp + End If + Return resourceMan + End Get + End Property + + ''' + ''' 이 강력한 형식의 리소스 클래스를 사용하여 모든 리소스 조회에 대해 현재 스레드의 CurrentUICulture 속성을 + ''' 재정의합니다. + ''' + _ + Friend Property Culture() As Global.System.Globalization.CultureInfo + Get + Return resourceCulture + End Get + Set + resourceCulture = value + End Set + End Property + End Module +End Namespace diff --git a/ArinNewFpv4.Netfx2/My Project/Resources.resx b/ArinNewFpv4.Netfx2/My Project/Resources.resx new file mode 100644 index 0000000..af7dbeb --- /dev/null +++ b/ArinNewFpv4.Netfx2/My Project/Resources.resx @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/ArinNewFpv4.Netfx2/My Project/Settings.Designer.vb b/ArinNewFpv4.Netfx2/My Project/Settings.Designer.vb new file mode 100644 index 0000000..ffbd675 --- /dev/null +++ b/ArinNewFpv4.Netfx2/My Project/Settings.Designer.vb @@ -0,0 +1,73 @@ +'------------------------------------------------------------------------------ +' +' 이 코드는 도구를 사용하여 생성되었습니다. +' 런타임 버전:4.0.30319.42000 +' +' 파일 내용을 변경하면 잘못된 동작이 발생할 수 있으며, 코드를 다시 생성하면 +' 이러한 변경 내용이 손실됩니다. +' +'------------------------------------------------------------------------------ + +Option Strict On +Option Explicit On + + +Namespace My + + _ + Partial Friend NotInheritable Class MySettings + Inherits Global.System.Configuration.ApplicationSettingsBase + + Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings()),MySettings) + +#Region "My.Settings 자동 저장 기능" +#If _MyType = "WindowsForms" Then + Private Shared addedHandler As Boolean + + Private Shared addedHandlerLockObject As New Object + + _ + Private Shared Sub AutoSaveSettings(sender As Global.System.Object, e As Global.System.EventArgs) + If My.Application.SaveMySettingsOnExit Then + My.Settings.Save() + End If + End Sub +#End If +#End Region + + Public Shared ReadOnly Property [Default]() As MySettings + Get + +#If _MyType = "WindowsForms" Then + If Not addedHandler Then + SyncLock addedHandlerLockObject + If Not addedHandler Then + AddHandler My.Application.Shutdown, AddressOf AutoSaveSettings + addedHandler = True + End If + End SyncLock + End If +#End If + Return defaultInstance + End Get + End Property + End Class +End Namespace + +Namespace My + + _ + Friend Module MySettingsProperty + + _ + Friend ReadOnly Property Settings() As Global.ArinNewFp.My.MySettings + Get + Return Global.ArinNewFp.My.MySettings.Default + End Get + End Property + End Module +End Namespace diff --git a/ArinNewFpv4.Netfx2/My Project/Settings.settings b/ArinNewFpv4.Netfx2/My Project/Settings.settings new file mode 100644 index 0000000..85b890b --- /dev/null +++ b/ArinNewFpv4.Netfx2/My Project/Settings.settings @@ -0,0 +1,7 @@ + + + + + + + diff --git a/ArinNewFpv4.Netfx2/My Project/licenses.licx b/ArinNewFpv4.Netfx2/My Project/licenses.licx new file mode 100644 index 0000000..b6d55c1 --- /dev/null +++ b/ArinNewFpv4.Netfx2/My Project/licenses.licx @@ -0,0 +1 @@ +FarPoint.Win.Spread.FpSpread, FarPoint.Win.Spread, Version=5.0.3518.2008, Culture=neutral, PublicKeyToken=327c3516b1b18457 diff --git a/ArinNewFpv4.Netfx2/MyINI.vb b/ArinNewFpv4.Netfx2/MyINI.vb new file mode 100644 index 0000000..e9ca3e4 --- /dev/null +++ b/ArinNewFpv4.Netfx2/MyINI.vb @@ -0,0 +1,287 @@ +Imports System.IO + +Public Class tinyIni + Declare Function GetPrivateProfileString Lib "kernel32" Alias "GetPrivateProfileStringA" (ByVal lpApplicationName As String, ByVal lpKeyName As String, ByVal lpDefault As String, ByVal lpReturnedString As String, ByVal nSize As Integer, ByVal lpFileName As String) As Integer + Declare Function WritePrivateProfileString Lib "kernel32" Alias "WritePrivateProfileStringA" (ByVal lpApplicationName As String, ByVal lpKeyName As String, ByVal lpString As String, ByVal lpDownFileName As String) As Integer + 'Private Aname As String + Public FileName As String = vbNullString + Private FileNameBuf As String + Private m_sPath As String + Private m_sKey As String + Private m_sSection As String + Private m_sDefault As String + Private m_lLastReturnCode As Integer + + Public Sub New(ByVal File As String) + FileName = File + FileNameBuf = File + Me.Create() + + 'MsgBox("New 1=" & FileName & vbCrLf & "2=" & FileNameBuf) + + ' If Not System.IO.File.Exists(File) Then System.IO.File.Create(File) + End Sub + Public Sub Create() + If Exist() = True Then Return + Dim A As New IO.FileInfo(FileName) + A.Directory.Create() + Dim FS As IO.FileStream = A.Create() + Dim SW As New IO.StreamWriter(FS, System.Text.Encoding.Default) + SW.WriteLine("//Myini 로부터 자동생성된 파일입니다") + SW.WriteLine("//생성일자 : " & Now.ToString) + SW.Flush() + SW.Close() + FS.Close() + SW = Nothing + FS = Nothing + FileName = FileNameBuf + End Sub + Public Function Exist() As Boolean + Return System.IO.File.Exists(FileName) + End Function + + Public Function Read(ByVal appkey As String, ByVal subkey As String, Optional ByVal DefaultValue As String = vbNullString) As String '//변수초기화 + 'MsgBox("Read 1=" & FileName & vbCrLf & "2=" & FileNameBuf) + + Dim tempstr As Integer 'ini파일에서 읽어온 값을 임시저장하는 변수 + Dim strtemp As String = New String(Chr(0), 2000) 'ini파일의 임시 변수 + Dim Tempbuf As String + + If Not Exist() Then + MsgBox("환경파일이 존재하지 않습니다" & vbCrLf & "APP=" & appkey & vbCrLf & "subkey=" & subkey & vbCrLf & "파일명=" & FileName, MsgBoxStyle.Critical, "Error") + Return vbNullString + End If + Try + tempstr = GetPrivateProfileString(appkey, subkey, "", strtemp, Len(strtemp), FileName) + Tempbuf = strtemp.Substring(0, tempstr) + Tempbuf = Tempbuf.Trim(Chr(0)) + + FileName = FileNameBuf + + If Tempbuf.Trim = vbNullString AndAlso DefaultValue <> vbNullString Then + Return DefaultValue + Else + Return Tempbuf + End If + Catch ex As Exception + FileName = FileNameBuf + Return vbNullString + End Try + + End Function + Public Function ReadFile(ByVal appkey As String, ByVal subkey As String, ByVal filename2 As String, Optional ByVal DefaultValue As String = vbNullString) As String '//변수초기화 + 'MsgBox("ReadFile 1=" & FileName & vbCrLf & "2=" & FileNameBuf) + Dim tempstr As Integer 'ini파일에서 읽어온 값을 임시저장하는 변수 + Dim strtemp As String = New String(Chr(0), 2000) 'ini파일의 임시 변수 + Dim Tempbuf As String + + If Not System.IO.File.Exists(filename2) Then + MsgBox("환경파일이 존재하지 않습니다" & vbCrLf & "파일명=" & FileName, MsgBoxStyle.Critical, "Error") + Return vbNullString + End If + + Try + tempstr = GetPrivateProfileString(appkey, subkey, "", strtemp, Len(strtemp), filename2) + Tempbuf = strtemp.Substring(0, tempstr) + If Tempbuf.Trim = vbNullString AndAlso DefaultValue <> vbNullString Then + Return DefaultValue + Else + Return Tempbuf + End If + Catch ex As Exception + Return vbNullString + End Try + FileName = FileNameBuf + End Function + + Public Function Write(ByVal appkey As String, ByVal subkey As String, ByVal WriteVal As Object) As Integer + Dim RetVal As Integer + 'MsgBox("Write1 1=" & FileName & vbCrLf & "2=" & FileNameBuf) + If Not Exist() Then + MsgBox("환경파일이 존재하지 않습니다" & vbCrLf & "파일을 생성합니다." & vbCrLf & "파일명=" & FileName, MsgBoxStyle.Information, "확인") + Me.Create() + End If + ' FileName = Aname + RetVal = (WritePrivateProfileString(appkey, subkey, WriteVal, FileName)) + FileName = FileNameBuf + Return RetVal + + End Function + Public Sub Write(ByVal appkey As String, ByVal subkey As String, ByVal WriteVal As Object, ByVal fileName2 As String) + 'MsgBox("Write2 1=" & FileName & vbCrLf & "2=" & FileNameBuf) + If Not System.IO.File.Exists(fileName2) Then + MsgBox("[D] 환경파일이 존재하지 않습니다" & vbCrLf & "파일을 생성합니다." & vbCrLf & "파일명=" & fileName2, MsgBoxStyle.Information, "확인") + System.IO.File.Create(fileName2) + End If + WritePrivateProfileString(appkey, subkey, WriteVal, fileName2) + FileName = FileNameBuf + End Sub + + + + Public Sub EnumerateCurrentSection(ByRef sKey() As String, ByRef iCount As Integer) + Dim sSection As String + Dim iPos As Integer + Dim iNextPos As Integer + Dim sCur As String + + iCount = 0 + Erase sKey + sSection = INISection + If (Len(sSection) > 0) Then + iPos = 1 + iNextPos = InStr(iPos, sSection, Chr(0)) + Do While iNextPos <> 0 + sCur = Mid(sSection, iPos, iNextPos - iPos) + If (sCur <> Chr(0)) Then + iCount = iCount + 1 + 'UPGRADE_WARNING: sKey 배열의 하한이 1에서 0(으)로 변경되었습니다. 자세한 내용은 다음을 참조하십시오. 'ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?keyword="0F1C9BE1-AF9D-476E-83B1-17D43BECFF20"' + ReDim Preserve sKey(iCount) + sKey(iCount) = Mid(sSection, iPos, iNextPos - iPos) + iPos = iNextPos + 1 + iNextPos = InStr(iPos, sSection, Chr(0)) + End If + Loop + End If + End Sub + + + Public Sub GetAllsection(ByVal key As String, ByRef Section As ArrayList, ByRef Value As ArrayList) + Dim FS As New System.IO.FileStream(FileName, FileMode.Open) + Dim SR As New StreamReader(FS, System.Text.Encoding.Default) + Dim Findkey As String = "[" & key & "]" + Dim Line As String + Dim KeyPos As Integer = -1 + Dim Seppos As Integer = -1 + While SR.Peek > -1 + Line = SR.ReadLine + If KeyPos = -1 Then '//키를 못찻았으면 + If Line.ToUpper.IndexOf(Findkey.ToUpper) > -1 Then KeyPos = Line.ToUpper.IndexOf(Findkey.ToUpper) + Else '//찾앗으면 + If Line.IndexOf("[") = -1 Then '//그다음 키가 오기전까지 모두 추가한다. + Seppos = Line.IndexOf("=") + Section.Add(Line.Substring(0, Seppos)) + Value.Add(Line.Substring(Seppos + 1)) + Else + Exit While + End If + End If + End While + + SR.Close() + FS.Close() + + + End Sub + + Public Sub EnumerateAllSections(ByRef sSections() As String, ByRef iCount As Integer) + Dim sIniFile As String + Dim iPos As Integer + Dim iNextPos As Integer + Dim sCur As String + + iCount = 0 + Erase sSections + sIniFile = Sections + If (Len(sIniFile) > 0) Then + iPos = 1 + iNextPos = InStr(iPos, sIniFile, Chr(0)) + Do While iNextPos <> 0 + If (iNextPos <> iPos) Then + sCur = Mid(sIniFile, iPos, iNextPos - iPos) + iCount = iCount + 1 + 'UPGRADE_WARNING: sSections 배열의 하한이 1에서 0(으)로 변경되었습니다. 자세한 내용은 다음을 참조하십시오. 'ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?keyword="0F1C9BE1-AF9D-476E-83B1-17D43BECFF20"' + ReDim Preserve sSections(iCount) + sSections(iCount) = sCur + End If + iPos = iNextPos + 1 + iNextPos = InStr(iPos, sIniFile, Chr(0)) + Loop + End If + + End Sub + + Property INISection() As String + Get + Dim sBuf As String + Dim iSize As String + Dim iRetCode As Short + + sBuf = Space(8192) + iSize = CStr(Len(sBuf)) + iRetCode = GetPrivateProfileString(m_sSection, 0, m_sDefault, sBuf, CInt(iSize), m_sPath) + If (CDbl(iSize) > 0) Then + INISection = Left(sBuf, iRetCode) + Else + INISection = "" + End If + + End Get + Set(ByVal Value As String) + m_lLastReturnCode = WritePrivateProfileString(m_sSection, 0, Value, m_sPath) + End Set + End Property + ReadOnly Property Sections() As String + Get + Dim sBuf As String + Dim iSize As String + Dim iRetCode As Short + + sBuf = Space(8192) + iSize = CStr(Len(sBuf)) + iRetCode = GetPrivateProfileString(0, 0, m_sDefault, sBuf, CInt(iSize), m_sPath) + If (CDbl(iSize) > 0) Then + Sections = Left(sBuf, iRetCode) + Else + Sections = "" + End If + + End Get + End Property + + ReadOnly Property LastReturnCode() As Integer + Get + LastReturnCode = m_lLastReturnCode + End Get + End Property + ReadOnly Property Success() As Boolean + Get + Success = (m_lLastReturnCode <> 0) + End Get + End Property + 'UPGRADE_NOTE: Default이(가) Default_Renamed(으)로 업그레이드되었습니다. 자세한 내용은 다음을 참조하십시오. 'ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?keyword="A9E4979A-37FA-4718-9994-97DD76ED70A7"' + Property Default_Renamed() As String + Get + Default_Renamed = m_sDefault + End Get + Set(ByVal Value As String) + m_sDefault = Value + End Set + End Property + Property Path() As String + Get + Path = m_sPath + End Get + Set(ByVal Value As String) + m_sPath = Value + End Set + End Property + Property Key() As String + Get + Key = m_sKey + End Get + Set(ByVal Value As String) + m_sKey = Value + End Set + End Property + Property Section() As String + Get + Section = m_sSection + End Get + Set(ByVal Value As String) + m_sSection = Value + End Set + End Property + + +End Class \ No newline at end of file diff --git a/ArinNewFpv4.Netfx2/NewFp.Designer.vb b/ArinNewFpv4.Netfx2/NewFp.Designer.vb new file mode 100644 index 0000000..1be86ba --- /dev/null +++ b/ArinNewFpv4.Netfx2/NewFp.Designer.vb @@ -0,0 +1,36 @@ + _ +Partial Class NewFp + Inherits FarPoint.Win.Spread.FpSpread + + 'UserControl1은 Dispose를 재정의하여 구성 요소 목록을 정리합니다. + _ + Protected Overrides Sub Dispose(ByVal disposing As Boolean) + Try + If disposing AndAlso components IsNot Nothing Then + components.Dispose() + End If + Finally + MyBase.Dispose(disposing) + End Try + End Sub + + 'Windows Form 디자이너에 필요합니다. + Private components As System.ComponentModel.IContainer + + '참고: 다음 프로시저는 Windows Form 디자이너에 필요합니다. + '수정하려면 Windows Form 디자이너를 사용하십시오. + '코드 편집기를 사용하여 수정하지 마십시오. + _ + Private Sub InitializeComponent() + CType(Me, System.ComponentModel.ISupportInitialize).BeginInit() + Me.SuspendLayout() + ' + 'NewFp + ' + Me.ActiveSheetIndex = -1 + CType(Me, System.ComponentModel.ISupportInitialize).EndInit() + Me.ResumeLayout(False) + + End Sub + +End Class diff --git a/ArinNewFpv4.Netfx2/NewFp.resx b/ArinNewFpv4.Netfx2/NewFp.resx new file mode 100644 index 0000000..52a9ad3 --- /dev/null +++ b/ArinNewFpv4.Netfx2/NewFp.resx @@ -0,0 +1,123 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + False + + \ No newline at end of file diff --git a/ArinNewFpv4.Netfx2/NewFp.vb b/ArinNewFpv4.Netfx2/NewFp.vb new file mode 100644 index 0000000..f1db5e8 --- /dev/null +++ b/ArinNewFpv4.Netfx2/NewFp.vb @@ -0,0 +1,1427 @@ +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 + Dim Section As String = Me.Parent.Name & "-" & (Me.Name & tag) + a.Write(Section, "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 + Dim Section As String = Me.Parent.Name & "-" & (Me.Name & tag) + col.Width = a.Read(Section, "COLSIZE" & col.Index.ToString) + Catch ex As Exception '//쿡 Ƿ ׳ + MsgBox("ColoSize_Load Error", MsgBoxStyle.Critical, "Ȯ") + 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 + Try + 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 + Catch ex As Exception + + End Try + + 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 = Windows.Forms.ImeMode.Hangul + Else + If Not Me.ActiveColumn.Tag Is Nothing Then + If Array.IndexOf(Me.ѱʵ, Me.ActiveColumn.Tag) >= 0 Then + Me.ImeMode = Windows.Forms.ImeMode.Hangul + Else + Me.ImeMode = 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 = Windows.Forms.ImeMode.Hangul + Else + Me.ImeMode = Windows.Forms.ImeMode.Alpha + End If + Else + Me.ImeMode = 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 = 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 = 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 = 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 diff --git a/ArinNewFpv4.Netfx2/TextFile1.txt b/ArinNewFpv4.Netfx2/TextFile1.txt new file mode 100644 index 0000000..17fb464 --- /dev/null +++ b/ArinNewFpv4.Netfx2/TextFile1.txt @@ -0,0 +1,1303 @@ +Public Class NEwfp07 + + Private V_enterToTab As Boolean = True + Private V_DeleteKey As Boolean = True + Private V_CurrentDel As Boolean = True + 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 + Public 전줄값복사() As String + Public 한글필드() As String + Public 다음줄필드명 As String + + 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 Event Arin_LovCodeEntry(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 AEnterToNextItem() As Boolean + Get + Return Me.V_enterToTab + End Get + Set(ByVal value As Boolean) + Me.V_enterToTab = 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 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 + + _ + 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 + + + ''' + ''' 중복검사루틴에서 사용하는 함수 + ''' + ''' + ''' + ''' + ''' + ''' + 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 + + 'NOTICE("중복되는 [전주번호]를 찾는중입니다...", Me.lb_msg) + 'Me.Invalidate() + 'MsgBox(Me.ActiveSheet.RowCount) + + + + 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 & "/" & B & "]" & 설명 '//설명하도록햇을시에 + Me.ActiveSheet.Cells(B, 설명열).Value &= "[" & A & "/" & B & "]" & 설명 '//설명하도록햇을시에 + 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 이면 그 다음으로 이동한다. + SendKeys.Send(vbTab) + Return + + ' Dim index As Integer = 0 + 'Start: + ' index += 1 + ' If Me.ActiveColumnindex = Me.ActiveSheet.ColumnCount - 1 Then Return '//현재열이 마지막열이라면 빠진다. + ' If Me.ActiveColumnindex + index > Me.ActiveSheet.Columns.Count Then Return + + ' If Me.ActiveSheet.Columns(Me.ActiveColumnindex + index).Width = 0 Or Me.ActiveSheet.Columns(Me.ActiveColumnindex + index).TabStop = False Then + ' GoTo Start + ' End If + + ' Me.ActiveSheet.SetActiveCell(Me.ActiveRowindex, Me.ActiveColumnindex + index) + + ' Dim Ee As New FarPoint.Win.Spread.EnterCellEventArgs(Nothing, Me.ActiveSheet.ActiveRowIndex, Me.ActiveSheet.ActiveColumnIndex) + ' NewFp_EnterCell(Nothing, Ee) '//이후에 엔터셀이 발생하지않으므로 발생시켜준다. + + 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 '//지정된열제목이 잇는지 + 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 '//지정된열제목이 잇는지 + 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 '//지정된열제목이 잇는지 + 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 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.DataField.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 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 + +#Region "설정저장부분" + + + 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 MyINI(File.FullName) + + If a.Exist = False Then Me.AViewSetting_Save(전줄값복사, 한글필드, 다음줄열이름, Tag, FN) + + Dim 전줄, 한글, 다음줄 As String + 전줄 = 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", 다음줄열이름) + + Me.전줄값복사 = 전줄.Split(",") + Me.한글필드 = 한글.Split(",") + Me.다음줄필드명 = 다음줄 + + End Sub + Public Sub AViewSetting_Save(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 MyINI(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", 다음줄열이름) + + 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) + 'MsgBox("뷰의 상태가 저장되었습니다", MsgBoxStyle.Information, "확인") + 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 MyINI(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 MyINI(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 MyINI(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 MyINI(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 MyINI(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 MyINI(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 MyINI(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 FILEname As String = My.Application.Info.DirectoryPath & "\" & fn & "spread.INI" + If Not System.IO.File.Exists(FILEname) Then + MsgBox("열너비 파일이 존재하지 않습니다", MsgBoxStyle.Critical, "열너비설정-오류") + CurrentState_Save(tag, fn) + Return + End If + Dim a As New MyINI(My.Application.Info.DirectoryPath & "\" & fn & "spread.INI") + Me.ActiveSheet.Rows.Default.Height = a.Read(Me.Parent.Name & "-" & Me.Name & tag, "RowHeight", 20) + End Sub + +#End Region + 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_EditModeOff(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.EditModeOff + RaiseEvent Arin_Before_EditModeOff(sender, e) '//원래뷰가 after 발생이므로 before 발생용 이벤트하나 맹글어준다. + RaiseEvent Arin_LovCodeEntry(sender, e) '//빠져나오는순간의 Lov코드용이다. + + If Not Me.v_ACellposLabel Is Nothing Then + Me.v_ACellposLabel.ForeColor = Color.Black + End If + '//빠져나올때 이 셀번호가 종료열번호라면 다음줄로 넘긴다 + If Me.V_enterToTab Then + If (Me.ANextRow_ColIndex = Me.ActiveSheet.ActiveColumnIndex) OrElse (Me.ActiveSheet.ActiveColumnIndex = (Me.ActiveSheet.ColumnCount - 1)) Then '//다음줄로가아햘 경우라면 + 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 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_ACellposLabel Is Nothing Then + Me.v_ACellposLabel.ForeColor = Color.Red + End If + 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.ActiveColumn.Label & ":" & 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 = Windows.Forms.ImeMode.Hangul + Else + Me.ImeMode = Windows.Forms.ImeMode.Alpha + 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 = 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 + + + ''' + ''' 뷰에서 키보드가 눌렷을대의 반응 + ''' + ''' + ''' + ''' + 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.V_enterToTab Then + If Me.ActiveSheet.ActiveRowIndex = Me.ActiveSheet.RowCount - 1 Then '//마지막줄일경우 + If (Me.ANextRow_ColIndex = Me.ActiveSheet.ActiveColumnIndex) OrElse (Me.ActiveSheet.ActiveColumnIndex = (Me.ActiveSheet.ColumnCount - 1)) Then '//다음줄로가아햘 경우라면 + RaiseEvent Arin_AddLog(Me, "keydown 마지막줄이며 한줄생성해야함 " & Me.ANextRow_ColIndex & "/" & Me.ActiveSheet.ActiveColumnIndex) + If Not Me.v_AAutoAddrowInLast Is Nothing Then + Me.v_AAutoAddrowInLast.PerformClick() '//한줄추가 + Me.ActiveSheet.ActiveColumnIndex = Me.V_FIRSTINDEX + NewFp_EnterCell(sender, Nothing) + 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 '//다음줄로가아햘 경우라면 + 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 + 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 '//Lov용이다. 위치에서 누르는 F5키는 모두검색하는 lOv로 변경한다. + RaiseEvent Arin_LovCodeEntry(sender, Nothing) + 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 = 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 = 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 +End Class diff --git a/ArinNewFpv4.Netfx2/lov.Designer.vb b/ArinNewFpv4.Netfx2/lov.Designer.vb new file mode 100644 index 0000000..bc5a6f3 --- /dev/null +++ b/ArinNewFpv4.Netfx2/lov.Designer.vb @@ -0,0 +1,159 @@ + _ +Partial Class lov + Inherits System.Windows.Forms.Form + + 'Form은 Dispose를 재정의하여 구성 요소 목록을 정리합니다. + _ + Protected Overrides Sub Dispose(ByVal disposing As Boolean) + Try + If disposing AndAlso components IsNot Nothing Then + components.Dispose() + End If + Finally + MyBase.Dispose(disposing) + End Try + End Sub + + 'Windows Form 디자이너에 필요합니다. + Private components As System.ComponentModel.IContainer + + '참고: 다음 프로시저는 Windows Form 디자이너에 필요합니다. + '수정하려면 Windows Form 디자이너를 사용하십시오. + '코드 편집기를 사용하여 수정하지 마십시오. + _ + Private Sub InitializeComponent() + Me.components = New System.ComponentModel.Container + Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(lov)) + Dim TipAppearance1 As FarPoint.Win.Spread.TipAppearance = New FarPoint.Win.Spread.TipAppearance + Me.ToolStripButton1 = New System.Windows.Forms.ToolStripButton + Me.TableLayoutPanel1 = New System.Windows.Forms.TableLayoutPanel + Me.tb_searchtext = New System.Windows.Forms.TextBox + Me.datagridview1 = New FarPoint.Win.Spread.FpSpread + Me.datagridview1_Sheet1 = New FarPoint.Win.Spread.SheetView + Me.ToolStrip1 = New System.Windows.Forms.ToolStrip + Me.ToolStripButton2 = New System.Windows.Forms.ToolStripButton + Me.BindingSource1 = New System.Windows.Forms.BindingSource(Me.components) + Me.TableLayoutPanel1.SuspendLayout() + CType(Me.datagridview1, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.datagridview1_Sheet1, System.ComponentModel.ISupportInitialize).BeginInit() + Me.ToolStrip1.SuspendLayout() + CType(Me.BindingSource1, System.ComponentModel.ISupportInitialize).BeginInit() + Me.SuspendLayout() + ' + 'ToolStripButton1 + ' + Me.ToolStripButton1.Alignment = System.Windows.Forms.ToolStripItemAlignment.Right + Me.ToolStripButton1.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image + Me.ToolStripButton1.Image = CType(resources.GetObject("ToolStripButton1.Image"), System.Drawing.Image) + Me.ToolStripButton1.ImageTransparentColor = System.Drawing.Color.Magenta + Me.ToolStripButton1.Name = "ToolStripButton1" + Me.ToolStripButton1.Size = New System.Drawing.Size(36, 37) + Me.ToolStripButton1.Text = "ToolStripButton1" + ' + 'TableLayoutPanel1 + ' + Me.TableLayoutPanel1.ColumnCount = 1 + Me.TableLayoutPanel1.ColumnStyles.Add(New System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 521.0!)) + Me.TableLayoutPanel1.Controls.Add(Me.tb_searchtext, 0, 0) + Me.TableLayoutPanel1.Controls.Add(Me.datagridview1, 0, 1) + Me.TableLayoutPanel1.Controls.Add(Me.ToolStrip1, 0, 2) + Me.TableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill + Me.TableLayoutPanel1.Location = New System.Drawing.Point(0, 0) + Me.TableLayoutPanel1.Margin = New System.Windows.Forms.Padding(3, 4, 3, 4) + Me.TableLayoutPanel1.Name = "TableLayoutPanel1" + Me.TableLayoutPanel1.RowCount = 3 + Me.TableLayoutPanel1.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 40.0!)) + Me.TableLayoutPanel1.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100.0!)) + Me.TableLayoutPanel1.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 40.0!)) + Me.TableLayoutPanel1.Size = New System.Drawing.Size(521, 499) + Me.TableLayoutPanel1.TabIndex = 4 + ' + 'tb_searchtext + ' + Me.tb_searchtext.CharacterCasing = System.Windows.Forms.CharacterCasing.Upper + Me.tb_searchtext.Dock = System.Windows.Forms.DockStyle.Fill + Me.tb_searchtext.Font = New System.Drawing.Font("맑은 고딕", 15.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(129, Byte)) + Me.tb_searchtext.Location = New System.Drawing.Point(3, 4) + Me.tb_searchtext.Margin = New System.Windows.Forms.Padding(3, 4, 3, 4) + Me.tb_searchtext.Name = "tb_searchtext" + Me.tb_searchtext.Size = New System.Drawing.Size(515, 35) + Me.tb_searchtext.TabIndex = 3 + Me.tb_searchtext.TextAlign = System.Windows.Forms.HorizontalAlignment.Center + ' + 'datagridview1 + ' + Me.datagridview1.About = "3.0.2003.2005" + Me.datagridview1.AccessibleDescription = "datagridview1, Sheet1, Row 0, Column 0, " + Me.datagridview1.BackColor = System.Drawing.SystemColors.Control + Me.datagridview1.Dock = System.Windows.Forms.DockStyle.Fill + Me.datagridview1.Location = New System.Drawing.Point(3, 43) + Me.datagridview1.Name = "datagridview1" + Me.datagridview1.RightToLeft = System.Windows.Forms.RightToLeft.No + Me.datagridview1.Sheets.AddRange(New FarPoint.Win.Spread.SheetView() {Me.datagridview1_Sheet1}) + Me.datagridview1.Size = New System.Drawing.Size(515, 413) + Me.datagridview1.TabIndex = 4 + TipAppearance1.BackColor = System.Drawing.SystemColors.Info + TipAppearance1.Font = New System.Drawing.Font("굴림", 9.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(129, Byte)) + TipAppearance1.ForeColor = System.Drawing.SystemColors.InfoText + Me.datagridview1.TextTipAppearance = TipAppearance1 + ' + 'datagridview1_Sheet1 + ' + Me.datagridview1_Sheet1.Reset() + Me.datagridview1_Sheet1.SheetName = "Sheet1" + 'Formulas and custom names must be loaded with R1C1 reference style + Me.datagridview1_Sheet1.ReferenceStyle = FarPoint.Win.Spread.Model.ReferenceStyle.R1C1 + Me.datagridview1_Sheet1.ColumnHeader.Rows.Get(0).Height = 30.0! + Me.datagridview1_Sheet1.RowHeader.Columns.Default.Resizable = False + Me.datagridview1_Sheet1.SelectionUnit = FarPoint.Win.Spread.Model.SelectionUnit.Row + Me.datagridview1_Sheet1.ReferenceStyle = FarPoint.Win.Spread.Model.ReferenceStyle.A1 + ' + 'ToolStrip1 + ' + Me.ToolStrip1.AutoSize = False + Me.ToolStrip1.Dock = System.Windows.Forms.DockStyle.Fill + Me.ToolStrip1.ImageScalingSize = New System.Drawing.Size(32, 32) + Me.ToolStrip1.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.ToolStripButton1, Me.ToolStripButton2}) + Me.ToolStrip1.Location = New System.Drawing.Point(0, 459) + Me.ToolStrip1.Name = "ToolStrip1" + Me.ToolStrip1.Size = New System.Drawing.Size(521, 40) + Me.ToolStrip1.TabIndex = 5 + Me.ToolStrip1.Text = "ToolStrip1" + ' + 'ToolStripButton2 + ' + Me.ToolStripButton2.Alignment = System.Windows.Forms.ToolStripItemAlignment.Right + Me.ToolStripButton2.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image + Me.ToolStripButton2.Image = CType(resources.GetObject("ToolStripButton2.Image"), System.Drawing.Image) + Me.ToolStripButton2.ImageTransparentColor = System.Drawing.Color.Magenta + Me.ToolStripButton2.Name = "ToolStripButton2" + Me.ToolStripButton2.Size = New System.Drawing.Size(36, 37) + Me.ToolStripButton2.Text = "ToolStripButton2" + ' + 'lov + ' + Me.AutoScaleDimensions = New System.Drawing.SizeF(7.0!, 12.0!) + Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.ClientSize = New System.Drawing.Size(521, 499) + Me.Controls.Add(Me.TableLayoutPanel1) + Me.Name = "lov" + Me.Text = "lov" + Me.TableLayoutPanel1.ResumeLayout(False) + Me.TableLayoutPanel1.PerformLayout() + CType(Me.datagridview1, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.datagridview1_Sheet1, System.ComponentModel.ISupportInitialize).EndInit() + Me.ToolStrip1.ResumeLayout(False) + Me.ToolStrip1.PerformLayout() + CType(Me.BindingSource1, System.ComponentModel.ISupportInitialize).EndInit() + Me.ResumeLayout(False) + + End Sub + Friend WithEvents ToolStripButton1 As System.Windows.Forms.ToolStripButton + Friend WithEvents TableLayoutPanel1 As System.Windows.Forms.TableLayoutPanel + Friend WithEvents tb_searchtext As System.Windows.Forms.TextBox + Friend WithEvents datagridview1 As FarPoint.Win.Spread.FpSpread + Friend WithEvents datagridview1_Sheet1 As FarPoint.Win.Spread.SheetView + Friend WithEvents ToolStrip1 As System.Windows.Forms.ToolStrip + Friend WithEvents ToolStripButton2 As System.Windows.Forms.ToolStripButton + Friend WithEvents BindingSource1 As System.Windows.Forms.BindingSource +End Class diff --git a/ArinNewFpv4.Netfx2/lov.resx b/ArinNewFpv4.Netfx2/lov.resx new file mode 100644 index 0000000..adc5fab --- /dev/null +++ b/ArinNewFpv4.Netfx2/lov.resx @@ -0,0 +1,163 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + + + iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 + YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAhDSURBVFhHnVdrTJTZGdblsj8MbNLoxlV/GLQNGvBCtMZE + 40ata1dWCKKACiwiIoww3GEQGO6CXBRhVvBSFVS8ganrXphdKcjcBwW0Gja17naniWnSJv3VNNk0b5/n + zDeuWF3cTvLknO+c932ec97znsvMmPGGv9TU1F8YDIb48vLyjqqqquHa2lqP0Wj8N8E629hHG9q+Ie20 + ZjN1Ot284uLi0sbaWjkPmNvaZPzyZfl+cFD+Pj6uwDrb2Ecb2tKHvlCYOa3Kawz89Hr9zsaqKrnR0CAP + r12T72/flsmuLhmrqRFnXp5Y09MVWGcb+2hDW/rQlxzg9/u5g/DPzc2tOAUC94UL8ufeXrmPuiVtv1j2 + 75cRhbQX6t421Qeb+1WVyoe+XfAjFwbg/6aDCMjJyWm5WFcnk/39MtHYKCMHDoAYYIkZWw4eFKsGVU8/ + KLZDOrGgHDmQ5gXsH8B3sq9fyEVODCBgukH4Z2ZmVnUjnN9cuSIug0GRUmQEYDkE9GVlydm8fDleVKTw + u/w86cvOlqHMTLFmZKhBegeaLu5Sg3xz9YqQk9w/FQm/5OTkPabycpm8eVPch0vFAjJiBBgE+cWcHGku + LJTdu3c/27Rp0/iyZcvMBOtsY99V2Ci/TK8v4Tp8WHGSmxqvyomZ69at+1UZCJxYtwctLWLRIaTEoUPS + j9m1ItEiIyOfLF26tB8ERUAiEKUhFX2OevrX1cMnC76HvMDSWIEHrccUNzWo9fLueDs+Pv5od021PO27 + IVaE2JKVLdZsPUKrl4rcXFmxYsWXcMoCtgChwLvAOyz37t17vragQL4zm8VRUCiW7Cz4ZoODpV7xEU+v + X5fu6hqhFvzefp4PS5Ys+WWBXi8TN/pkrKFRrAijDaJ3UDaifeXKlbdhzO20GAgC3tKcA1NSUkzViI5n + eEgcxcXK1wcb2i25/MYg0H4f0ZnAIKhFTd8A/Ldu3ZrbitD85bPPxIqEsiLBrPn5cg6G6HuoifNQeXEr + BSYlJZmMIP7r8LA4kLBWCFKU/jbwfYV6Dzi8nOhD+e2tW9KCaFHTxxccHR19/Qa2zIP2duVog8EQBlCO + RMKat2kznyKOpDOVIayeu3fFUVYmVvhZEX5rYYHYiorla3DkYcdUgGOYnBoenjwpV2vrhJrgDWYU3ouN + jX14F6eYq6pabAijraREerEE27dvf6qtOcPu+wXGxcWZDNgVnpERcRqNXh/lRxjEjK2pT0uTNWvWPNq2 + bduzXs6+uET1j9YfkUFMlJrUJmkICP9x79w5sWMmttJShVbsgPXr13+uJdzzNY+JiTEV4kDyWCzixCln + V/aHxYZtSz8zBqJLSaG4C74GlMOt2Ek+Xldlpbg6O4Wa1OYAQvHxw32TSewVFWIrKxdbeZkUp6YK9jiz + ldnOXyAiYsrDceuxWsWFC4cDtsPWDh+7sULMiFx6UpKsXr2a4tyma8PCwlpL4KNscA5QYxzLQE1tcjPC + d+zY8YMdl4cdo/PCKIWYxfLlyythxK0WiFCastHmsdnEVV+vbH60rxQzZr9/z26JiIjwiXN2c8hRtG8f + Bgh7AveEC+cMNdEfzpmFg/yfZhLiuLRXVys0IIFwYFxgBLZs2WLSJSeLx24XF7apz8ah2ZoRiY/j4iQ8 + PPxFcZ7775CjCflix/5X/DW18jVKavoGEIq1ftKLtXPg0vChG1m8cePGsQ0bNpw/mLhXPA6HuJuaptjY + YT+AkCbGxr5KnJN7F/73rmHmXt5aVV6GFjV9SxCyatWqQSado+GIOI4QDYInj2QkJEgqZqbEETYHluk5 + YDOA5UqIjpbQ0NCXZ07xt3CAJeoRuYmeHq+f4j4izdCipi8J31u0aFFbFtbPefSoOJuOioMlcBpnwQRe + OqPHj6tvXzvrAwj/zo8+ep04BxC0du3a31+H76NLl5SvQ3E3SRYmRk3YqG0YPGvWrF1bN2+WXlydTsxU + oRkzZtnaOqWN7QOITsyHH8rixYtfNXNy+uPuyChC9j8ZGpJR7HtnS7Pi7EWyUoua1FbGQERISMhACcLl + PIbZHsfNdexleNsH6utk+wcf/KQ4Qr9vZ2Sk2Pr65I+IIP1cGl/Jx8lCLWpq2hzDjLkYkW7z++/L2aJC + cZ1oA06Isw1giW/niXb5EusY+ZvNJHjlmmPWv8U27M7FtrP198kjPmroCx4XHqxncRxTg1rUVMraj1fj + qjlz5vQmRUXJp8hUV3vHFDgQxhO42fZg3XG4PMYdYUK5C4dVDIRrgDv7sBuuYM2f4Ih+dPWauDravRwd + HfIpzn9yU4NawI/XMT74dJ4NRM2fP/+uDplvbm4W1yefTMG902dk8osv5M6li9KKtTwAO4L1P2C2Hrdb + /oT+e2fOwM/03Nfc3CTkJDc1NK3/ea7z6bwASJg3b547Y9cuuYUt4zrZ6QXOb3fnSRkF+WM8r77DFfxs + bAwYl2/xFnjcf1MJu2Hrhq3Xp0txkIuc5NY0XvtMZ0LyCE2cO3euNR6Z3lVcJO6uUwBuy1MASw3uU1o7 + vtmvwLbTAMpO3IrkIBc5Ne5pn+c8QjmIhODg4Fu/joiQbOzbngojiE9r5Cx90AQpqqEHJx996EsObebk + nPZZ7ktKjpLLERUQEHBs9uzZo8vDwtRsKnDPn8Ur93OcEVaEmmCdbeyjDW3pQ19tzck17cxf3BWsc52Y + mMzYJD8/v5agoKCvkMWPFyxY8LeFCxf+C6fZfwjW2cY+2tCWPpovOX72XzPfYJip3C7cszw4IoEUIB+o + Bho1sM429tGGtvSh7//95/TliDCEPDp5fnM9+TTnfU6wzjb20eaNw/1ffB1iO+5lm3QAAAAASUVORK5C + YII= + + + \ No newline at end of file diff --git a/ArinNewFpv4.Netfx2/lov.vb b/ArinNewFpv4.Netfx2/lov.vb new file mode 100644 index 0000000..e01a49d --- /dev/null +++ b/ArinNewFpv4.Netfx2/lov.vb @@ -0,0 +1,106 @@ +Public Class lov + Dim Dt As New DataTable + Dim A As New System.Text.StringBuilder + + Public Msg As String = "" '//lov가 반환한 메세지 : O일경우를 제외하고 반환된다. + Public Row As DataRowView = Nothing '//반환된 데이터로우 : O 이거나 1 일때만 반환된다. + Public StatusE As rStatus + Public Enum rStatus + NotFound = 1 '//검색어에대한 데이터가 없다 + OneRow = 2 '//하나밖에없었다(ok) + Multirow = 3 '//여러개의 데이터가 조재한다. + Canceld = 4 '//취소되었다. + End Enum +#Region "New Function" + Public Sub New() + InitializeComponent() + End Sub + Public Sub New(ByVal Dtable As DataTable, Optional ByVal ImeMode As System.Windows.Forms.ImeMode = Windows.Forms.ImeMode.Hangul) + ' 이 호출은 Windows Form 디자이너에 필요합니다. + Dt = Dtable + InitializeComponent() + Me.BindingSource1.DataSource = Dt + Me.DataGridView1.DataSource = Me.BindingSource1 + Me.tb_searchtext.ImeMode = ImeMode + End Sub +#End Region + +#Region "OK/CANCEL 버튼" + Private Sub Prc_OK() + Msg = "사용자선택" + Row = Me.BindingSource1.Current + StatusE = rStatus.OneRow + Me.DialogResult = System.Windows.Forms.DialogResult.OK + Me.Close() + End Sub + + Private Sub Prc_CalCel() + Msg = "사용자취소" + Row = Nothing + StatusE = rStatus.Canceld + Me.DialogResult = System.Windows.Forms.DialogResult.Cancel + Me.Close() + End Sub +#End Region + + + + ''' + ''' where 절을 생성한후 리턴(모든 열에대한 같은 where like 절 + ''' + ''' + ''' + Private Function WhereState() As String + A.Remove(0, A.Length) + For i As Integer = 0 To Me.Dt.Columns.Count - 1 + + If Dt.Columns(i).DataType.Name.ToUpper = "STRING" Then + A.Append(IIf(i = 0, "", Space(1) & "or ") & Dt.Columns(i).Caption & " like '" & Me.tb_searchtext.Text & "%'") + End If + Next + Return A.ToString + End Function + + Private Sub TextBox1_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles tb_searchtext.TextChanged + Me.BindingSource1.Filter = Me.WhereState + End Sub + Private Sub TextBox1_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles tb_searchtext.KeyDown + Select Case e.KeyCode + Case Keys.Down, Keys.Enter + Me.DataGridView1.Focus() + If Me.datagridview1.ActiveSheet.RowCount = 1 Then Me.Prc_OK() + Case Keys.Escape + Me.Prc_CalCel() + End Select + End Sub + + + Private Sub datagridview1_CellDoubleClick(ByVal sender As Object, ByVal e As FarPoint.Win.Spread.CellClickEventArgs) Handles datagridview1.CellDoubleClick + Me.Prc_OK() + End Sub + + Private Sub datagridview1_KeyDown1(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles datagridview1.KeyDown + Select Case e.KeyCode + Case Keys.F5 + Case Keys.Escape + Me.tb_searchtext.Focus() + Case Keys.Enter + Me.Prc_OK() + End Select + End Sub + + Private Sub datagridview1_KeyUp1(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles datagridview1.KeyUp + Select Case e.KeyCode + Case Keys.Escape + Me.tb_searchtext.Focus() + End Select + End Sub + + Private Sub ToolStripButton2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton2.Click + Me.Prc_OK() + End Sub + + Private Sub ToolStripButton1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton1.Click + Me.Prc_CalCel() + End Sub +End Class \ No newline at end of file diff --git a/ArinNewFpv4/ArinNewFp4.vbproj b/ArinNewFpv4/ArinNewFp4.vbproj new file mode 100644 index 0000000..1b87fc1 --- /dev/null +++ b/ArinNewFpv4/ArinNewFp4.vbproj @@ -0,0 +1,201 @@ + + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {1A24DEF6-0FD3-418F-95DC-0C0E5662ECEA} + Library + ArinNewFp + ArinNewFp + Windows + + + 3.5 + + + false + v4.0 + publish\ + true + Disk + false + Foreground + 7 + Days + false + false + true + 0 + 1.0.0.%2a + false + true + + + + true + full + true + true + bin\Debug\ + + + _MYFORMS=True + 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022,42353,42354,42355 + x86 + + + pdbonly + false + true + true + bin\debug\ + + + _MYFORMS=True + 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022,42353,42354,42355 + + + + + + + + + + + + + + + + + + + + + + + Form1.vb + + + Form + + + Form2.vb + + + Form + + + Form3.vb + + + Form + + + lov.vb + + + Form + + + True + Application.myapp + + + + Component + + + NewFp.vb + + + + True + True + Resources.resx + + + True + Settings.settings + True + + + + + Form1.vb + + + Form2.vb + + + Designer + lov.vb + + + + VbMyResourcesResXFileCodeGenerator + Resources.Designer.vb + My.Resources + Designer + + + Designer + NewFp.vb + + + + + MyApplicationCodeGenerator + Application.Designer.vb + + + SettingsSingleFileGenerator + My + Settings.Designer.vb + + + + + + + + False + .NET Framework 3.5 SP1 Client Profile + false + + + False + .NET Framework 2.0%28x86%29 + true + + + False + .NET Framework 3.0%28x86%29 + false + + + False + .NET Framework 3.5 + false + + + False + .NET Framework 3.5 SP1 + false + + + + + + + + \ No newline at end of file diff --git a/ArinNewFpv4/Form1.Designer.vb b/ArinNewFpv4/Form1.Designer.vb new file mode 100644 index 0000000..e500f21 --- /dev/null +++ b/ArinNewFpv4/Form1.Designer.vb @@ -0,0 +1,61 @@ + _ +Partial Class Form1 + Inherits System.Windows.Forms.Form + + 'Form은 Dispose를 재정의하여 구성 요소 목록을 정리합니다. + _ + Protected Overrides Sub Dispose(ByVal disposing As Boolean) + Try + If disposing AndAlso components IsNot Nothing Then + components.Dispose() + End If + Finally + MyBase.Dispose(disposing) + End Try + End Sub + + 'Windows Form 디자이너에 필요합니다. + Private components As System.ComponentModel.IContainer + + '참고: 다음 프로시저는 Windows Form 디자이너에 필요합니다. + '수정하려면 Windows Form 디자이너를 사용하십시오. + '코드 편집기에서는 수정하지 마세요. + _ + Private Sub InitializeComponent() + Me.FpSpread1 = New FarPoint.Win.Spread.FpSpread() + Me.FpSpread1_Sheet1 = New FarPoint.Win.Spread.SheetView() + CType(Me.FpSpread1, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.FpSpread1_Sheet1, System.ComponentModel.ISupportInitialize).BeginInit() + Me.SuspendLayout() + ' + 'FpSpread1 + ' + Me.FpSpread1.AccessibleDescription = "" + Me.FpSpread1.Location = New System.Drawing.Point(42, 148) + Me.FpSpread1.Name = "FpSpread1" + Me.FpSpread1.Sheets.AddRange(New FarPoint.Win.Spread.SheetView() {Me.FpSpread1_Sheet1}) + Me.FpSpread1.Size = New System.Drawing.Size(200, 100) + Me.FpSpread1.TabIndex = 0 + ' + 'FpSpread1_Sheet1 + ' + Me.FpSpread1_Sheet1.Reset() + FpSpread1_Sheet1.SheetName = "Sheet1" + ' + 'Form1 + ' + Me.AutoScaleDimensions = New System.Drawing.SizeF(7.0!, 12.0!) + Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.ClientSize = New System.Drawing.Size(284, 261) + Me.Controls.Add(Me.FpSpread1) + Me.Name = "Form1" + Me.Text = "Form1" + CType(Me.FpSpread1, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.FpSpread1_Sheet1, System.ComponentModel.ISupportInitialize).EndInit() + Me.ResumeLayout(False) + + End Sub + + Friend WithEvents FpSpread1 As FarPoint.Win.Spread.FpSpread + Friend WithEvents FpSpread1_Sheet1 As FarPoint.Win.Spread.SheetView +End Class diff --git a/ArinNewFpv4/Form1.resx b/ArinNewFpv4/Form1.resx new file mode 100644 index 0000000..7277865 --- /dev/null +++ b/ArinNewFpv4/Form1.resx @@ -0,0 +1,123 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 17, 17 + + \ No newline at end of file diff --git a/ArinNewFpv4/Form1.vb b/ArinNewFpv4/Form1.vb new file mode 100644 index 0000000..10d55d4 --- /dev/null +++ b/ArinNewFpv4/Form1.vb @@ -0,0 +1,3 @@ +Public Class Form1 + +End Class \ No newline at end of file diff --git a/ArinNewFpv4/Form2.Designer.vb b/ArinNewFpv4/Form2.Designer.vb new file mode 100644 index 0000000..8c8946f --- /dev/null +++ b/ArinNewFpv4/Form2.Designer.vb @@ -0,0 +1,61 @@ + _ +Partial Class Form2 + Inherits System.Windows.Forms.Form + + 'Form은 Dispose를 재정의하여 구성 요소 목록을 정리합니다. + _ + Protected Overrides Sub Dispose(ByVal disposing As Boolean) + Try + If disposing AndAlso components IsNot Nothing Then + components.Dispose() + End If + Finally + MyBase.Dispose(disposing) + End Try + End Sub + + 'Windows Form 디자이너에 필요합니다. + Private components As System.ComponentModel.IContainer + + '참고: 다음 프로시저는 Windows Form 디자이너에 필요합니다. + '수정하려면 Windows Form 디자이너를 사용하십시오. + '코드 편집기에서는 수정하지 마세요. + _ + Private Sub InitializeComponent() + Me.FpSpread1 = New FarPoint.Win.Spread.FpSpread() + Me.FpSpread1_Sheet1 = New FarPoint.Win.Spread.SheetView() + CType(Me.FpSpread1, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.FpSpread1_Sheet1, System.ComponentModel.ISupportInitialize).BeginInit() + Me.SuspendLayout() + ' + 'FpSpread1 + ' + Me.FpSpread1.AccessibleDescription = "" + Me.FpSpread1.Location = New System.Drawing.Point(128, 61) + Me.FpSpread1.Name = "FpSpread1" + Me.FpSpread1.Sheets.AddRange(New FarPoint.Win.Spread.SheetView() {Me.FpSpread1_Sheet1}) + Me.FpSpread1.Size = New System.Drawing.Size(200, 100) + Me.FpSpread1.TabIndex = 0 + ' + 'FpSpread1_Sheet1 + ' + Me.FpSpread1_Sheet1.Reset() + FpSpread1_Sheet1.SheetName = "Sheet1" + ' + 'Form2 + ' + Me.AutoScaleDimensions = New System.Drawing.SizeF(7.0!, 12.0!) + Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.ClientSize = New System.Drawing.Size(284, 261) + Me.Controls.Add(Me.FpSpread1) + Me.Name = "Form2" + Me.Text = "Form2" + CType(Me.FpSpread1, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.FpSpread1_Sheet1, System.ComponentModel.ISupportInitialize).EndInit() + Me.ResumeLayout(False) + + End Sub + + Friend WithEvents FpSpread1 As FarPoint.Win.Spread.FpSpread + Friend WithEvents FpSpread1_Sheet1 As FarPoint.Win.Spread.SheetView +End Class diff --git a/ArinNewFpv4/Form2.resx b/ArinNewFpv4/Form2.resx new file mode 100644 index 0000000..7277865 --- /dev/null +++ b/ArinNewFpv4/Form2.resx @@ -0,0 +1,123 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 17, 17 + + \ No newline at end of file diff --git a/ArinNewFpv4/Form2.vb b/ArinNewFpv4/Form2.vb new file mode 100644 index 0000000..361d614 --- /dev/null +++ b/ArinNewFpv4/Form2.vb @@ -0,0 +1,3 @@ +Public Class Form2 + +End Class \ No newline at end of file diff --git a/ArinNewFpv4/Form3.Designer.vb b/ArinNewFpv4/Form3.Designer.vb new file mode 100644 index 0000000..11469a6 --- /dev/null +++ b/ArinNewFpv4/Form3.Designer.vb @@ -0,0 +1,29 @@ + _ +Partial Class Form3 + Inherits System.Windows.Forms.Form + + 'Form은 Dispose를 재정의하여 구성 요소 목록을 정리합니다. + _ + Protected Overrides Sub Dispose(ByVal disposing As Boolean) + Try + If disposing AndAlso components IsNot Nothing Then + components.Dispose() + End If + Finally + MyBase.Dispose(disposing) + End Try + End Sub + + 'Windows Form 디자이너에 필요합니다. + Private components As System.ComponentModel.IContainer + + '참고: 다음 프로시저는 Windows Form 디자이너에 필요합니다. + '수정하려면 Windows Form 디자이너를 사용하십시오. + '코드 편집기를 사용하여 수정하지 마십시오. + _ + Private Sub InitializeComponent() + components = New System.ComponentModel.Container + Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.Text = "Form3" + End Sub +End Class diff --git a/ArinNewFpv4/Form3.vb b/ArinNewFpv4/Form3.vb new file mode 100644 index 0000000..a77cc2a --- /dev/null +++ b/ArinNewFpv4/Form3.vb @@ -0,0 +1,3 @@ +Public Class Form3 + +End Class \ No newline at end of file diff --git a/ArinNewFpv4/My Project/Application.Designer.vb b/ArinNewFpv4/My Project/Application.Designer.vb new file mode 100644 index 0000000..c33da88 --- /dev/null +++ b/ArinNewFpv4/My Project/Application.Designer.vb @@ -0,0 +1,13 @@ +'------------------------------------------------------------------------------ +' +' 이 코드는 도구를 사용하여 생성되었습니다. +' 런타임 버전:4.0.30319.42000 +' +' 파일 내용을 변경하면 잘못된 동작이 발생할 수 있으며, 코드를 다시 생성하면 +' 이러한 변경 내용이 손실됩니다. +' +'------------------------------------------------------------------------------ + +Option Strict On +Option Explicit On + diff --git a/ArinNewFpv4/My Project/Application.myapp b/ArinNewFpv4/My Project/Application.myapp new file mode 100644 index 0000000..758895d --- /dev/null +++ b/ArinNewFpv4/My Project/Application.myapp @@ -0,0 +1,10 @@ + + + false + false + 0 + true + 0 + 1 + true + diff --git a/ArinNewFpv4/My Project/AssemblyInfo.vb b/ArinNewFpv4/My Project/AssemblyInfo.vb new file mode 100644 index 0000000..c1c0a65 --- /dev/null +++ b/ArinNewFpv4/My Project/AssemblyInfo.vb @@ -0,0 +1,34 @@ +Imports System +Imports System.Reflection +Imports System.Runtime.InteropServices + +' 어셈블리의 일반 정보는 다음 특성 집합을 통해 제어됩니다. +' 어셈블리와 관련된 정보를 수정하려면 +' 이 특성 값을 변경하십시오. + +' 어셈블리 특성 값을 검토합니다. + + + + + + + + + + +'이 프로젝트가 COM에 노출되는 경우 다음 GUID는 typelib의 ID를 나타냅니다. + + +' 어셈블리의 버전 정보는 다음 네 가지 값으로 구성됩니다. +' +' 주 버전 +' 부 버전 +' 빌드 번호 +' 수정 버전 +' +' 모든 값을 지정하거나 아래와 같이 '*'를 사용하여 빌드 번호 및 수정 버전이 자동으로 +' 지정되도록 할 수 있습니다. + + + diff --git a/ArinNewFpv4/My Project/Resources.Designer.vb b/ArinNewFpv4/My Project/Resources.Designer.vb new file mode 100644 index 0000000..f4a3f63 --- /dev/null +++ b/ArinNewFpv4/My Project/Resources.Designer.vb @@ -0,0 +1,63 @@ +'------------------------------------------------------------------------------ +' +' 이 코드는 도구를 사용하여 생성되었습니다. +' 런타임 버전:4.0.30319.42000 +' +' 파일 내용을 변경하면 잘못된 동작이 발생할 수 있으며, 코드를 다시 생성하면 +' 이러한 변경 내용이 손실됩니다. +' +'------------------------------------------------------------------------------ + +Option Strict On +Option Explicit On + +Imports System + +Namespace My.Resources + + '이 클래스는 ResGen 또는 Visual Studio와 같은 도구를 통해 StronglyTypedResourceBuilder + '클래스에서 자동으로 생성되었습니다. + '멤버를 추가하거나 제거하려면 .ResX 파일을 편집한 다음 /str 옵션을 사용하여 ResGen을 + '다시 실행하거나 VS 프로젝트를 다시 빌드하십시오. + ''' + ''' 지역화된 문자열 등을 찾기 위한 강력한 형식의 리소스 클래스입니다. + ''' + _ + Friend Module Resources + + Private resourceMan As Global.System.Resources.ResourceManager + + Private resourceCulture As Global.System.Globalization.CultureInfo + + ''' + ''' 이 클래스에서 사용하는 캐시된 ResourceManager 인스턴스를 반환합니다. + ''' + _ + Friend ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager + Get + If Object.ReferenceEquals(resourceMan, Nothing) Then + Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("ArinNewFp.Resources", GetType(Resources).Assembly) + resourceMan = temp + End If + Return resourceMan + End Get + End Property + + ''' + ''' 이 강력한 형식의 리소스 클래스를 사용하여 모든 리소스 조회에 대한 현재 스레드의 CurrentUICulture + ''' 속성을 재정의합니다. + ''' + _ + Friend Property Culture() As Global.System.Globalization.CultureInfo + Get + Return resourceCulture + End Get + Set + resourceCulture = value + End Set + End Property + End Module +End Namespace diff --git a/ArinNewFpv4/My Project/Resources.resx b/ArinNewFpv4/My Project/Resources.resx new file mode 100644 index 0000000..af7dbeb --- /dev/null +++ b/ArinNewFpv4/My Project/Resources.resx @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/ArinNewFpv4/My Project/Settings.Designer.vb b/ArinNewFpv4/My Project/Settings.Designer.vb new file mode 100644 index 0000000..df2d163 --- /dev/null +++ b/ArinNewFpv4/My Project/Settings.Designer.vb @@ -0,0 +1,73 @@ +'------------------------------------------------------------------------------ +' +' 이 코드는 도구를 사용하여 생성되었습니다. +' 런타임 버전:4.0.30319.42000 +' +' 파일 내용을 변경하면 잘못된 동작이 발생할 수 있으며, 코드를 다시 생성하면 +' 이러한 변경 내용이 손실됩니다. +' +'------------------------------------------------------------------------------ + +Option Strict On +Option Explicit On + + +Namespace My + + _ + Partial Friend NotInheritable Class MySettings + Inherits Global.System.Configuration.ApplicationSettingsBase + + Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings()),MySettings) + +#Region "My.Settings 자동 저장 기능" +#If _MyType = "WindowsForms" Then + Private Shared addedHandler As Boolean + + Private Shared addedHandlerLockObject As New Object + + _ + Private Shared Sub AutoSaveSettings(ByVal sender As Global.System.Object, ByVal e As Global.System.EventArgs) + If My.Application.SaveMySettingsOnExit Then + My.Settings.Save() + End If + End Sub +#End If +#End Region + + Public Shared ReadOnly Property [Default]() As MySettings + Get + +#If _MyType = "WindowsForms" Then + If Not addedHandler Then + SyncLock addedHandlerLockObject + If Not addedHandler Then + AddHandler My.Application.Shutdown, AddressOf AutoSaveSettings + addedHandler = True + End If + End SyncLock + End If +#End If + Return defaultInstance + End Get + End Property + End Class +End Namespace + +Namespace My + + _ + Friend Module MySettingsProperty + + _ + Friend ReadOnly Property Settings() As Global.ArinNewFp.My.MySettings + Get + Return Global.ArinNewFp.My.MySettings.Default + End Get + End Property + End Module +End Namespace diff --git a/ArinNewFpv4/My Project/Settings.settings b/ArinNewFpv4/My Project/Settings.settings new file mode 100644 index 0000000..85b890b --- /dev/null +++ b/ArinNewFpv4/My Project/Settings.settings @@ -0,0 +1,7 @@ + + + + + + + diff --git a/ArinNewFpv4/My Project/licenses.licx b/ArinNewFpv4/My Project/licenses.licx new file mode 100644 index 0000000..b6d55c1 --- /dev/null +++ b/ArinNewFpv4/My Project/licenses.licx @@ -0,0 +1 @@ +FarPoint.Win.Spread.FpSpread, FarPoint.Win.Spread, Version=5.0.3518.2008, Culture=neutral, PublicKeyToken=327c3516b1b18457 diff --git a/ArinNewFpv4/MyINI.vb b/ArinNewFpv4/MyINI.vb new file mode 100644 index 0000000..e9ca3e4 --- /dev/null +++ b/ArinNewFpv4/MyINI.vb @@ -0,0 +1,287 @@ +Imports System.IO + +Public Class tinyIni + Declare Function GetPrivateProfileString Lib "kernel32" Alias "GetPrivateProfileStringA" (ByVal lpApplicationName As String, ByVal lpKeyName As String, ByVal lpDefault As String, ByVal lpReturnedString As String, ByVal nSize As Integer, ByVal lpFileName As String) As Integer + Declare Function WritePrivateProfileString Lib "kernel32" Alias "WritePrivateProfileStringA" (ByVal lpApplicationName As String, ByVal lpKeyName As String, ByVal lpString As String, ByVal lpDownFileName As String) As Integer + 'Private Aname As String + Public FileName As String = vbNullString + Private FileNameBuf As String + Private m_sPath As String + Private m_sKey As String + Private m_sSection As String + Private m_sDefault As String + Private m_lLastReturnCode As Integer + + Public Sub New(ByVal File As String) + FileName = File + FileNameBuf = File + Me.Create() + + 'MsgBox("New 1=" & FileName & vbCrLf & "2=" & FileNameBuf) + + ' If Not System.IO.File.Exists(File) Then System.IO.File.Create(File) + End Sub + Public Sub Create() + If Exist() = True Then Return + Dim A As New IO.FileInfo(FileName) + A.Directory.Create() + Dim FS As IO.FileStream = A.Create() + Dim SW As New IO.StreamWriter(FS, System.Text.Encoding.Default) + SW.WriteLine("//Myini 로부터 자동생성된 파일입니다") + SW.WriteLine("//생성일자 : " & Now.ToString) + SW.Flush() + SW.Close() + FS.Close() + SW = Nothing + FS = Nothing + FileName = FileNameBuf + End Sub + Public Function Exist() As Boolean + Return System.IO.File.Exists(FileName) + End Function + + Public Function Read(ByVal appkey As String, ByVal subkey As String, Optional ByVal DefaultValue As String = vbNullString) As String '//변수초기화 + 'MsgBox("Read 1=" & FileName & vbCrLf & "2=" & FileNameBuf) + + Dim tempstr As Integer 'ini파일에서 읽어온 값을 임시저장하는 변수 + Dim strtemp As String = New String(Chr(0), 2000) 'ini파일의 임시 변수 + Dim Tempbuf As String + + If Not Exist() Then + MsgBox("환경파일이 존재하지 않습니다" & vbCrLf & "APP=" & appkey & vbCrLf & "subkey=" & subkey & vbCrLf & "파일명=" & FileName, MsgBoxStyle.Critical, "Error") + Return vbNullString + End If + Try + tempstr = GetPrivateProfileString(appkey, subkey, "", strtemp, Len(strtemp), FileName) + Tempbuf = strtemp.Substring(0, tempstr) + Tempbuf = Tempbuf.Trim(Chr(0)) + + FileName = FileNameBuf + + If Tempbuf.Trim = vbNullString AndAlso DefaultValue <> vbNullString Then + Return DefaultValue + Else + Return Tempbuf + End If + Catch ex As Exception + FileName = FileNameBuf + Return vbNullString + End Try + + End Function + Public Function ReadFile(ByVal appkey As String, ByVal subkey As String, ByVal filename2 As String, Optional ByVal DefaultValue As String = vbNullString) As String '//변수초기화 + 'MsgBox("ReadFile 1=" & FileName & vbCrLf & "2=" & FileNameBuf) + Dim tempstr As Integer 'ini파일에서 읽어온 값을 임시저장하는 변수 + Dim strtemp As String = New String(Chr(0), 2000) 'ini파일의 임시 변수 + Dim Tempbuf As String + + If Not System.IO.File.Exists(filename2) Then + MsgBox("환경파일이 존재하지 않습니다" & vbCrLf & "파일명=" & FileName, MsgBoxStyle.Critical, "Error") + Return vbNullString + End If + + Try + tempstr = GetPrivateProfileString(appkey, subkey, "", strtemp, Len(strtemp), filename2) + Tempbuf = strtemp.Substring(0, tempstr) + If Tempbuf.Trim = vbNullString AndAlso DefaultValue <> vbNullString Then + Return DefaultValue + Else + Return Tempbuf + End If + Catch ex As Exception + Return vbNullString + End Try + FileName = FileNameBuf + End Function + + Public Function Write(ByVal appkey As String, ByVal subkey As String, ByVal WriteVal As Object) As Integer + Dim RetVal As Integer + 'MsgBox("Write1 1=" & FileName & vbCrLf & "2=" & FileNameBuf) + If Not Exist() Then + MsgBox("환경파일이 존재하지 않습니다" & vbCrLf & "파일을 생성합니다." & vbCrLf & "파일명=" & FileName, MsgBoxStyle.Information, "확인") + Me.Create() + End If + ' FileName = Aname + RetVal = (WritePrivateProfileString(appkey, subkey, WriteVal, FileName)) + FileName = FileNameBuf + Return RetVal + + End Function + Public Sub Write(ByVal appkey As String, ByVal subkey As String, ByVal WriteVal As Object, ByVal fileName2 As String) + 'MsgBox("Write2 1=" & FileName & vbCrLf & "2=" & FileNameBuf) + If Not System.IO.File.Exists(fileName2) Then + MsgBox("[D] 환경파일이 존재하지 않습니다" & vbCrLf & "파일을 생성합니다." & vbCrLf & "파일명=" & fileName2, MsgBoxStyle.Information, "확인") + System.IO.File.Create(fileName2) + End If + WritePrivateProfileString(appkey, subkey, WriteVal, fileName2) + FileName = FileNameBuf + End Sub + + + + Public Sub EnumerateCurrentSection(ByRef sKey() As String, ByRef iCount As Integer) + Dim sSection As String + Dim iPos As Integer + Dim iNextPos As Integer + Dim sCur As String + + iCount = 0 + Erase sKey + sSection = INISection + If (Len(sSection) > 0) Then + iPos = 1 + iNextPos = InStr(iPos, sSection, Chr(0)) + Do While iNextPos <> 0 + sCur = Mid(sSection, iPos, iNextPos - iPos) + If (sCur <> Chr(0)) Then + iCount = iCount + 1 + 'UPGRADE_WARNING: sKey 배열의 하한이 1에서 0(으)로 변경되었습니다. 자세한 내용은 다음을 참조하십시오. 'ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?keyword="0F1C9BE1-AF9D-476E-83B1-17D43BECFF20"' + ReDim Preserve sKey(iCount) + sKey(iCount) = Mid(sSection, iPos, iNextPos - iPos) + iPos = iNextPos + 1 + iNextPos = InStr(iPos, sSection, Chr(0)) + End If + Loop + End If + End Sub + + + Public Sub GetAllsection(ByVal key As String, ByRef Section As ArrayList, ByRef Value As ArrayList) + Dim FS As New System.IO.FileStream(FileName, FileMode.Open) + Dim SR As New StreamReader(FS, System.Text.Encoding.Default) + Dim Findkey As String = "[" & key & "]" + Dim Line As String + Dim KeyPos As Integer = -1 + Dim Seppos As Integer = -1 + While SR.Peek > -1 + Line = SR.ReadLine + If KeyPos = -1 Then '//키를 못찻았으면 + If Line.ToUpper.IndexOf(Findkey.ToUpper) > -1 Then KeyPos = Line.ToUpper.IndexOf(Findkey.ToUpper) + Else '//찾앗으면 + If Line.IndexOf("[") = -1 Then '//그다음 키가 오기전까지 모두 추가한다. + Seppos = Line.IndexOf("=") + Section.Add(Line.Substring(0, Seppos)) + Value.Add(Line.Substring(Seppos + 1)) + Else + Exit While + End If + End If + End While + + SR.Close() + FS.Close() + + + End Sub + + Public Sub EnumerateAllSections(ByRef sSections() As String, ByRef iCount As Integer) + Dim sIniFile As String + Dim iPos As Integer + Dim iNextPos As Integer + Dim sCur As String + + iCount = 0 + Erase sSections + sIniFile = Sections + If (Len(sIniFile) > 0) Then + iPos = 1 + iNextPos = InStr(iPos, sIniFile, Chr(0)) + Do While iNextPos <> 0 + If (iNextPos <> iPos) Then + sCur = Mid(sIniFile, iPos, iNextPos - iPos) + iCount = iCount + 1 + 'UPGRADE_WARNING: sSections 배열의 하한이 1에서 0(으)로 변경되었습니다. 자세한 내용은 다음을 참조하십시오. 'ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?keyword="0F1C9BE1-AF9D-476E-83B1-17D43BECFF20"' + ReDim Preserve sSections(iCount) + sSections(iCount) = sCur + End If + iPos = iNextPos + 1 + iNextPos = InStr(iPos, sIniFile, Chr(0)) + Loop + End If + + End Sub + + Property INISection() As String + Get + Dim sBuf As String + Dim iSize As String + Dim iRetCode As Short + + sBuf = Space(8192) + iSize = CStr(Len(sBuf)) + iRetCode = GetPrivateProfileString(m_sSection, 0, m_sDefault, sBuf, CInt(iSize), m_sPath) + If (CDbl(iSize) > 0) Then + INISection = Left(sBuf, iRetCode) + Else + INISection = "" + End If + + End Get + Set(ByVal Value As String) + m_lLastReturnCode = WritePrivateProfileString(m_sSection, 0, Value, m_sPath) + End Set + End Property + ReadOnly Property Sections() As String + Get + Dim sBuf As String + Dim iSize As String + Dim iRetCode As Short + + sBuf = Space(8192) + iSize = CStr(Len(sBuf)) + iRetCode = GetPrivateProfileString(0, 0, m_sDefault, sBuf, CInt(iSize), m_sPath) + If (CDbl(iSize) > 0) Then + Sections = Left(sBuf, iRetCode) + Else + Sections = "" + End If + + End Get + End Property + + ReadOnly Property LastReturnCode() As Integer + Get + LastReturnCode = m_lLastReturnCode + End Get + End Property + ReadOnly Property Success() As Boolean + Get + Success = (m_lLastReturnCode <> 0) + End Get + End Property + 'UPGRADE_NOTE: Default이(가) Default_Renamed(으)로 업그레이드되었습니다. 자세한 내용은 다음을 참조하십시오. 'ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?keyword="A9E4979A-37FA-4718-9994-97DD76ED70A7"' + Property Default_Renamed() As String + Get + Default_Renamed = m_sDefault + End Get + Set(ByVal Value As String) + m_sDefault = Value + End Set + End Property + Property Path() As String + Get + Path = m_sPath + End Get + Set(ByVal Value As String) + m_sPath = Value + End Set + End Property + Property Key() As String + Get + Key = m_sKey + End Get + Set(ByVal Value As String) + m_sKey = Value + End Set + End Property + Property Section() As String + Get + Section = m_sSection + End Get + Set(ByVal Value As String) + m_sSection = Value + End Set + End Property + + +End Class \ No newline at end of file diff --git a/ArinNewFpv4/NewFp.Designer.vb b/ArinNewFpv4/NewFp.Designer.vb new file mode 100644 index 0000000..1be86ba --- /dev/null +++ b/ArinNewFpv4/NewFp.Designer.vb @@ -0,0 +1,36 @@ + _ +Partial Class NewFp + Inherits FarPoint.Win.Spread.FpSpread + + 'UserControl1은 Dispose를 재정의하여 구성 요소 목록을 정리합니다. + _ + Protected Overrides Sub Dispose(ByVal disposing As Boolean) + Try + If disposing AndAlso components IsNot Nothing Then + components.Dispose() + End If + Finally + MyBase.Dispose(disposing) + End Try + End Sub + + 'Windows Form 디자이너에 필요합니다. + Private components As System.ComponentModel.IContainer + + '참고: 다음 프로시저는 Windows Form 디자이너에 필요합니다. + '수정하려면 Windows Form 디자이너를 사용하십시오. + '코드 편집기를 사용하여 수정하지 마십시오. + _ + Private Sub InitializeComponent() + CType(Me, System.ComponentModel.ISupportInitialize).BeginInit() + Me.SuspendLayout() + ' + 'NewFp + ' + Me.ActiveSheetIndex = -1 + CType(Me, System.ComponentModel.ISupportInitialize).EndInit() + Me.ResumeLayout(False) + + End Sub + +End Class diff --git a/ArinNewFpv4/NewFp.resx b/ArinNewFpv4/NewFp.resx new file mode 100644 index 0000000..52a9ad3 --- /dev/null +++ b/ArinNewFpv4/NewFp.resx @@ -0,0 +1,123 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + False + + \ No newline at end of file diff --git a/ArinNewFpv4/NewFp.vb b/ArinNewFpv4/NewFp.vb new file mode 100644 index 0000000..f1db5e8 --- /dev/null +++ b/ArinNewFpv4/NewFp.vb @@ -0,0 +1,1427 @@ +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 + Dim Section As String = Me.Parent.Name & "-" & (Me.Name & tag) + a.Write(Section, "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 + Dim Section As String = Me.Parent.Name & "-" & (Me.Name & tag) + col.Width = a.Read(Section, "COLSIZE" & col.Index.ToString) + Catch ex As Exception '//쿡 Ƿ ׳ + MsgBox("ColoSize_Load Error", MsgBoxStyle.Critical, "Ȯ") + 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 + Try + 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 + Catch ex As Exception + + End Try + + 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 = Windows.Forms.ImeMode.Hangul + Else + If Not Me.ActiveColumn.Tag Is Nothing Then + If Array.IndexOf(Me.ѱʵ, Me.ActiveColumn.Tag) >= 0 Then + Me.ImeMode = Windows.Forms.ImeMode.Hangul + Else + Me.ImeMode = 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 = Windows.Forms.ImeMode.Hangul + Else + Me.ImeMode = Windows.Forms.ImeMode.Alpha + End If + Else + Me.ImeMode = 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 = 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 = 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 = 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 diff --git a/ArinNewFpv4/TextFile1.txt b/ArinNewFpv4/TextFile1.txt new file mode 100644 index 0000000..17fb464 --- /dev/null +++ b/ArinNewFpv4/TextFile1.txt @@ -0,0 +1,1303 @@ +Public Class NEwfp07 + + Private V_enterToTab As Boolean = True + Private V_DeleteKey As Boolean = True + Private V_CurrentDel As Boolean = True + 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 + Public 전줄값복사() As String + Public 한글필드() As String + Public 다음줄필드명 As String + + 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 Event Arin_LovCodeEntry(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 AEnterToNextItem() As Boolean + Get + Return Me.V_enterToTab + End Get + Set(ByVal value As Boolean) + Me.V_enterToTab = 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 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 + + _ + 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 + + + ''' + ''' 중복검사루틴에서 사용하는 함수 + ''' + ''' + ''' + ''' + ''' + ''' + 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 + + 'NOTICE("중복되는 [전주번호]를 찾는중입니다...", Me.lb_msg) + 'Me.Invalidate() + 'MsgBox(Me.ActiveSheet.RowCount) + + + + 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 & "/" & B & "]" & 설명 '//설명하도록햇을시에 + Me.ActiveSheet.Cells(B, 설명열).Value &= "[" & A & "/" & B & "]" & 설명 '//설명하도록햇을시에 + 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 이면 그 다음으로 이동한다. + SendKeys.Send(vbTab) + Return + + ' Dim index As Integer = 0 + 'Start: + ' index += 1 + ' If Me.ActiveColumnindex = Me.ActiveSheet.ColumnCount - 1 Then Return '//현재열이 마지막열이라면 빠진다. + ' If Me.ActiveColumnindex + index > Me.ActiveSheet.Columns.Count Then Return + + ' If Me.ActiveSheet.Columns(Me.ActiveColumnindex + index).Width = 0 Or Me.ActiveSheet.Columns(Me.ActiveColumnindex + index).TabStop = False Then + ' GoTo Start + ' End If + + ' Me.ActiveSheet.SetActiveCell(Me.ActiveRowindex, Me.ActiveColumnindex + index) + + ' Dim Ee As New FarPoint.Win.Spread.EnterCellEventArgs(Nothing, Me.ActiveSheet.ActiveRowIndex, Me.ActiveSheet.ActiveColumnIndex) + ' NewFp_EnterCell(Nothing, Ee) '//이후에 엔터셀이 발생하지않으므로 발생시켜준다. + + 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 '//지정된열제목이 잇는지 + 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 '//지정된열제목이 잇는지 + 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 '//지정된열제목이 잇는지 + 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 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.DataField.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 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 + +#Region "설정저장부분" + + + 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 MyINI(File.FullName) + + If a.Exist = False Then Me.AViewSetting_Save(전줄값복사, 한글필드, 다음줄열이름, Tag, FN) + + Dim 전줄, 한글, 다음줄 As String + 전줄 = 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", 다음줄열이름) + + Me.전줄값복사 = 전줄.Split(",") + Me.한글필드 = 한글.Split(",") + Me.다음줄필드명 = 다음줄 + + End Sub + Public Sub AViewSetting_Save(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 MyINI(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", 다음줄열이름) + + 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) + 'MsgBox("뷰의 상태가 저장되었습니다", MsgBoxStyle.Information, "확인") + 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 MyINI(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 MyINI(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 MyINI(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 MyINI(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 MyINI(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 MyINI(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 MyINI(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 FILEname As String = My.Application.Info.DirectoryPath & "\" & fn & "spread.INI" + If Not System.IO.File.Exists(FILEname) Then + MsgBox("열너비 파일이 존재하지 않습니다", MsgBoxStyle.Critical, "열너비설정-오류") + CurrentState_Save(tag, fn) + Return + End If + Dim a As New MyINI(My.Application.Info.DirectoryPath & "\" & fn & "spread.INI") + Me.ActiveSheet.Rows.Default.Height = a.Read(Me.Parent.Name & "-" & Me.Name & tag, "RowHeight", 20) + End Sub + +#End Region + 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_EditModeOff(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.EditModeOff + RaiseEvent Arin_Before_EditModeOff(sender, e) '//원래뷰가 after 발생이므로 before 발생용 이벤트하나 맹글어준다. + RaiseEvent Arin_LovCodeEntry(sender, e) '//빠져나오는순간의 Lov코드용이다. + + If Not Me.v_ACellposLabel Is Nothing Then + Me.v_ACellposLabel.ForeColor = Color.Black + End If + '//빠져나올때 이 셀번호가 종료열번호라면 다음줄로 넘긴다 + If Me.V_enterToTab Then + If (Me.ANextRow_ColIndex = Me.ActiveSheet.ActiveColumnIndex) OrElse (Me.ActiveSheet.ActiveColumnIndex = (Me.ActiveSheet.ColumnCount - 1)) Then '//다음줄로가아햘 경우라면 + 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 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_ACellposLabel Is Nothing Then + Me.v_ACellposLabel.ForeColor = Color.Red + End If + 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.ActiveColumn.Label & ":" & 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 = Windows.Forms.ImeMode.Hangul + Else + Me.ImeMode = Windows.Forms.ImeMode.Alpha + 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 = 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 + + + ''' + ''' 뷰에서 키보드가 눌렷을대의 반응 + ''' + ''' + ''' + ''' + 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.V_enterToTab Then + If Me.ActiveSheet.ActiveRowIndex = Me.ActiveSheet.RowCount - 1 Then '//마지막줄일경우 + If (Me.ANextRow_ColIndex = Me.ActiveSheet.ActiveColumnIndex) OrElse (Me.ActiveSheet.ActiveColumnIndex = (Me.ActiveSheet.ColumnCount - 1)) Then '//다음줄로가아햘 경우라면 + RaiseEvent Arin_AddLog(Me, "keydown 마지막줄이며 한줄생성해야함 " & Me.ANextRow_ColIndex & "/" & Me.ActiveSheet.ActiveColumnIndex) + If Not Me.v_AAutoAddrowInLast Is Nothing Then + Me.v_AAutoAddrowInLast.PerformClick() '//한줄추가 + Me.ActiveSheet.ActiveColumnIndex = Me.V_FIRSTINDEX + NewFp_EnterCell(sender, Nothing) + 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 '//다음줄로가아햘 경우라면 + 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 + 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 '//Lov용이다. 위치에서 누르는 F5키는 모두검색하는 lOv로 변경한다. + RaiseEvent Arin_LovCodeEntry(sender, Nothing) + 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 = 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 = 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 +End Class diff --git a/ArinNewFpv4/lov.Designer.vb b/ArinNewFpv4/lov.Designer.vb new file mode 100644 index 0000000..bc5a6f3 --- /dev/null +++ b/ArinNewFpv4/lov.Designer.vb @@ -0,0 +1,159 @@ + _ +Partial Class lov + Inherits System.Windows.Forms.Form + + 'Form은 Dispose를 재정의하여 구성 요소 목록을 정리합니다. + _ + Protected Overrides Sub Dispose(ByVal disposing As Boolean) + Try + If disposing AndAlso components IsNot Nothing Then + components.Dispose() + End If + Finally + MyBase.Dispose(disposing) + End Try + End Sub + + 'Windows Form 디자이너에 필요합니다. + Private components As System.ComponentModel.IContainer + + '참고: 다음 프로시저는 Windows Form 디자이너에 필요합니다. + '수정하려면 Windows Form 디자이너를 사용하십시오. + '코드 편집기를 사용하여 수정하지 마십시오. + _ + Private Sub InitializeComponent() + Me.components = New System.ComponentModel.Container + Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(lov)) + Dim TipAppearance1 As FarPoint.Win.Spread.TipAppearance = New FarPoint.Win.Spread.TipAppearance + Me.ToolStripButton1 = New System.Windows.Forms.ToolStripButton + Me.TableLayoutPanel1 = New System.Windows.Forms.TableLayoutPanel + Me.tb_searchtext = New System.Windows.Forms.TextBox + Me.datagridview1 = New FarPoint.Win.Spread.FpSpread + Me.datagridview1_Sheet1 = New FarPoint.Win.Spread.SheetView + Me.ToolStrip1 = New System.Windows.Forms.ToolStrip + Me.ToolStripButton2 = New System.Windows.Forms.ToolStripButton + Me.BindingSource1 = New System.Windows.Forms.BindingSource(Me.components) + Me.TableLayoutPanel1.SuspendLayout() + CType(Me.datagridview1, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.datagridview1_Sheet1, System.ComponentModel.ISupportInitialize).BeginInit() + Me.ToolStrip1.SuspendLayout() + CType(Me.BindingSource1, System.ComponentModel.ISupportInitialize).BeginInit() + Me.SuspendLayout() + ' + 'ToolStripButton1 + ' + Me.ToolStripButton1.Alignment = System.Windows.Forms.ToolStripItemAlignment.Right + Me.ToolStripButton1.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image + Me.ToolStripButton1.Image = CType(resources.GetObject("ToolStripButton1.Image"), System.Drawing.Image) + Me.ToolStripButton1.ImageTransparentColor = System.Drawing.Color.Magenta + Me.ToolStripButton1.Name = "ToolStripButton1" + Me.ToolStripButton1.Size = New System.Drawing.Size(36, 37) + Me.ToolStripButton1.Text = "ToolStripButton1" + ' + 'TableLayoutPanel1 + ' + Me.TableLayoutPanel1.ColumnCount = 1 + Me.TableLayoutPanel1.ColumnStyles.Add(New System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 521.0!)) + Me.TableLayoutPanel1.Controls.Add(Me.tb_searchtext, 0, 0) + Me.TableLayoutPanel1.Controls.Add(Me.datagridview1, 0, 1) + Me.TableLayoutPanel1.Controls.Add(Me.ToolStrip1, 0, 2) + Me.TableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill + Me.TableLayoutPanel1.Location = New System.Drawing.Point(0, 0) + Me.TableLayoutPanel1.Margin = New System.Windows.Forms.Padding(3, 4, 3, 4) + Me.TableLayoutPanel1.Name = "TableLayoutPanel1" + Me.TableLayoutPanel1.RowCount = 3 + Me.TableLayoutPanel1.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 40.0!)) + Me.TableLayoutPanel1.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100.0!)) + Me.TableLayoutPanel1.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 40.0!)) + Me.TableLayoutPanel1.Size = New System.Drawing.Size(521, 499) + Me.TableLayoutPanel1.TabIndex = 4 + ' + 'tb_searchtext + ' + Me.tb_searchtext.CharacterCasing = System.Windows.Forms.CharacterCasing.Upper + Me.tb_searchtext.Dock = System.Windows.Forms.DockStyle.Fill + Me.tb_searchtext.Font = New System.Drawing.Font("맑은 고딕", 15.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(129, Byte)) + Me.tb_searchtext.Location = New System.Drawing.Point(3, 4) + Me.tb_searchtext.Margin = New System.Windows.Forms.Padding(3, 4, 3, 4) + Me.tb_searchtext.Name = "tb_searchtext" + Me.tb_searchtext.Size = New System.Drawing.Size(515, 35) + Me.tb_searchtext.TabIndex = 3 + Me.tb_searchtext.TextAlign = System.Windows.Forms.HorizontalAlignment.Center + ' + 'datagridview1 + ' + Me.datagridview1.About = "3.0.2003.2005" + Me.datagridview1.AccessibleDescription = "datagridview1, Sheet1, Row 0, Column 0, " + Me.datagridview1.BackColor = System.Drawing.SystemColors.Control + Me.datagridview1.Dock = System.Windows.Forms.DockStyle.Fill + Me.datagridview1.Location = New System.Drawing.Point(3, 43) + Me.datagridview1.Name = "datagridview1" + Me.datagridview1.RightToLeft = System.Windows.Forms.RightToLeft.No + Me.datagridview1.Sheets.AddRange(New FarPoint.Win.Spread.SheetView() {Me.datagridview1_Sheet1}) + Me.datagridview1.Size = New System.Drawing.Size(515, 413) + Me.datagridview1.TabIndex = 4 + TipAppearance1.BackColor = System.Drawing.SystemColors.Info + TipAppearance1.Font = New System.Drawing.Font("굴림", 9.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(129, Byte)) + TipAppearance1.ForeColor = System.Drawing.SystemColors.InfoText + Me.datagridview1.TextTipAppearance = TipAppearance1 + ' + 'datagridview1_Sheet1 + ' + Me.datagridview1_Sheet1.Reset() + Me.datagridview1_Sheet1.SheetName = "Sheet1" + 'Formulas and custom names must be loaded with R1C1 reference style + Me.datagridview1_Sheet1.ReferenceStyle = FarPoint.Win.Spread.Model.ReferenceStyle.R1C1 + Me.datagridview1_Sheet1.ColumnHeader.Rows.Get(0).Height = 30.0! + Me.datagridview1_Sheet1.RowHeader.Columns.Default.Resizable = False + Me.datagridview1_Sheet1.SelectionUnit = FarPoint.Win.Spread.Model.SelectionUnit.Row + Me.datagridview1_Sheet1.ReferenceStyle = FarPoint.Win.Spread.Model.ReferenceStyle.A1 + ' + 'ToolStrip1 + ' + Me.ToolStrip1.AutoSize = False + Me.ToolStrip1.Dock = System.Windows.Forms.DockStyle.Fill + Me.ToolStrip1.ImageScalingSize = New System.Drawing.Size(32, 32) + Me.ToolStrip1.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.ToolStripButton1, Me.ToolStripButton2}) + Me.ToolStrip1.Location = New System.Drawing.Point(0, 459) + Me.ToolStrip1.Name = "ToolStrip1" + Me.ToolStrip1.Size = New System.Drawing.Size(521, 40) + Me.ToolStrip1.TabIndex = 5 + Me.ToolStrip1.Text = "ToolStrip1" + ' + 'ToolStripButton2 + ' + Me.ToolStripButton2.Alignment = System.Windows.Forms.ToolStripItemAlignment.Right + Me.ToolStripButton2.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image + Me.ToolStripButton2.Image = CType(resources.GetObject("ToolStripButton2.Image"), System.Drawing.Image) + Me.ToolStripButton2.ImageTransparentColor = System.Drawing.Color.Magenta + Me.ToolStripButton2.Name = "ToolStripButton2" + Me.ToolStripButton2.Size = New System.Drawing.Size(36, 37) + Me.ToolStripButton2.Text = "ToolStripButton2" + ' + 'lov + ' + Me.AutoScaleDimensions = New System.Drawing.SizeF(7.0!, 12.0!) + Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.ClientSize = New System.Drawing.Size(521, 499) + Me.Controls.Add(Me.TableLayoutPanel1) + Me.Name = "lov" + Me.Text = "lov" + Me.TableLayoutPanel1.ResumeLayout(False) + Me.TableLayoutPanel1.PerformLayout() + CType(Me.datagridview1, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.datagridview1_Sheet1, System.ComponentModel.ISupportInitialize).EndInit() + Me.ToolStrip1.ResumeLayout(False) + Me.ToolStrip1.PerformLayout() + CType(Me.BindingSource1, System.ComponentModel.ISupportInitialize).EndInit() + Me.ResumeLayout(False) + + End Sub + Friend WithEvents ToolStripButton1 As System.Windows.Forms.ToolStripButton + Friend WithEvents TableLayoutPanel1 As System.Windows.Forms.TableLayoutPanel + Friend WithEvents tb_searchtext As System.Windows.Forms.TextBox + Friend WithEvents datagridview1 As FarPoint.Win.Spread.FpSpread + Friend WithEvents datagridview1_Sheet1 As FarPoint.Win.Spread.SheetView + Friend WithEvents ToolStrip1 As System.Windows.Forms.ToolStrip + Friend WithEvents ToolStripButton2 As System.Windows.Forms.ToolStripButton + Friend WithEvents BindingSource1 As System.Windows.Forms.BindingSource +End Class diff --git a/ArinNewFpv4/lov.resx b/ArinNewFpv4/lov.resx new file mode 100644 index 0000000..adc5fab --- /dev/null +++ b/ArinNewFpv4/lov.resx @@ -0,0 +1,163 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + + + iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 + YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAhDSURBVFhHnVdrTJTZGdblsj8MbNLoxlV/GLQNGvBCtMZE + 40ata1dWCKKACiwiIoww3GEQGO6CXBRhVvBSFVS8ganrXphdKcjcBwW0Gja17naniWnSJv3VNNk0b5/n + zDeuWF3cTvLknO+c932ec97znsvMmPGGv9TU1F8YDIb48vLyjqqqquHa2lqP0Wj8N8E629hHG9q+Ie20 + ZjN1Ot284uLi0sbaWjkPmNvaZPzyZfl+cFD+Pj6uwDrb2Ecb2tKHvlCYOa3Kawz89Hr9zsaqKrnR0CAP + r12T72/flsmuLhmrqRFnXp5Y09MVWGcb+2hDW/rQlxzg9/u5g/DPzc2tOAUC94UL8ufeXrmPuiVtv1j2 + 75cRhbQX6t421Qeb+1WVyoe+XfAjFwbg/6aDCMjJyWm5WFcnk/39MtHYKCMHDoAYYIkZWw4eFKsGVU8/ + KLZDOrGgHDmQ5gXsH8B3sq9fyEVODCBgukH4Z2ZmVnUjnN9cuSIug0GRUmQEYDkE9GVlydm8fDleVKTw + u/w86cvOlqHMTLFmZKhBegeaLu5Sg3xz9YqQk9w/FQm/5OTkPabycpm8eVPch0vFAjJiBBgE+cWcHGku + LJTdu3c/27Rp0/iyZcvMBOtsY99V2Ci/TK8v4Tp8WHGSmxqvyomZ69at+1UZCJxYtwctLWLRIaTEoUPS + j9m1ItEiIyOfLF26tB8ERUAiEKUhFX2OevrX1cMnC76HvMDSWIEHrccUNzWo9fLueDs+Pv5od021PO27 + IVaE2JKVLdZsPUKrl4rcXFmxYsWXcMoCtgChwLvAOyz37t17vragQL4zm8VRUCiW7Cz4ZoODpV7xEU+v + X5fu6hqhFvzefp4PS5Ys+WWBXi8TN/pkrKFRrAijDaJ3UDaifeXKlbdhzO20GAgC3tKcA1NSUkzViI5n + eEgcxcXK1wcb2i25/MYg0H4f0ZnAIKhFTd8A/Ldu3ZrbitD85bPPxIqEsiLBrPn5cg6G6HuoifNQeXEr + BSYlJZmMIP7r8LA4kLBWCFKU/jbwfYV6Dzi8nOhD+e2tW9KCaFHTxxccHR19/Qa2zIP2duVog8EQBlCO + RMKat2kznyKOpDOVIayeu3fFUVYmVvhZEX5rYYHYiorla3DkYcdUgGOYnBoenjwpV2vrhJrgDWYU3ouN + jX14F6eYq6pabAijraREerEE27dvf6qtOcPu+wXGxcWZDNgVnpERcRqNXh/lRxjEjK2pT0uTNWvWPNq2 + bduzXs6+uET1j9YfkUFMlJrUJmkICP9x79w5sWMmttJShVbsgPXr13+uJdzzNY+JiTEV4kDyWCzixCln + V/aHxYZtSz8zBqJLSaG4C74GlMOt2Ek+Xldlpbg6O4Wa1OYAQvHxw32TSewVFWIrKxdbeZkUp6YK9jiz + ldnOXyAiYsrDceuxWsWFC4cDtsPWDh+7sULMiFx6UpKsXr2a4tyma8PCwlpL4KNscA5QYxzLQE1tcjPC + d+zY8YMdl4cdo/PCKIWYxfLlyythxK0WiFCastHmsdnEVV+vbH60rxQzZr9/z26JiIjwiXN2c8hRtG8f + Bgh7AveEC+cMNdEfzpmFg/yfZhLiuLRXVys0IIFwYFxgBLZs2WLSJSeLx24XF7apz8ah2ZoRiY/j4iQ8 + PPxFcZ7775CjCflix/5X/DW18jVKavoGEIq1ftKLtXPg0vChG1m8cePGsQ0bNpw/mLhXPA6HuJuaptjY + YT+AkCbGxr5KnJN7F/73rmHmXt5aVV6GFjV9SxCyatWqQSado+GIOI4QDYInj2QkJEgqZqbEETYHluk5 + YDOA5UqIjpbQ0NCXZ07xt3CAJeoRuYmeHq+f4j4izdCipi8J31u0aFFbFtbPefSoOJuOioMlcBpnwQRe + OqPHj6tvXzvrAwj/zo8+ep04BxC0du3a31+H76NLl5SvQ3E3SRYmRk3YqG0YPGvWrF1bN2+WXlydTsxU + oRkzZtnaOqWN7QOITsyHH8rixYtfNXNy+uPuyChC9j8ZGpJR7HtnS7Pi7EWyUoua1FbGQERISMhACcLl + PIbZHsfNdexleNsH6utk+wcf/KQ4Qr9vZ2Sk2Pr65I+IIP1cGl/Jx8lCLWpq2hzDjLkYkW7z++/L2aJC + cZ1oA06Isw1giW/niXb5EusY+ZvNJHjlmmPWv8U27M7FtrP198kjPmroCx4XHqxncRxTg1rUVMraj1fj + qjlz5vQmRUXJp8hUV3vHFDgQxhO42fZg3XG4PMYdYUK5C4dVDIRrgDv7sBuuYM2f4Ih+dPWauDravRwd + HfIpzn9yU4NawI/XMT74dJ4NRM2fP/+uDplvbm4W1yefTMG902dk8osv5M6li9KKtTwAO4L1P2C2Hrdb + /oT+e2fOwM/03Nfc3CTkJDc1NK3/ea7z6bwASJg3b547Y9cuuYUt4zrZ6QXOb3fnSRkF+WM8r77DFfxs + bAwYl2/xFnjcf1MJu2Hrhq3Xp0txkIuc5NY0XvtMZ0LyCE2cO3euNR6Z3lVcJO6uUwBuy1MASw3uU1o7 + vtmvwLbTAMpO3IrkIBc5Ne5pn+c8QjmIhODg4Fu/joiQbOzbngojiE9r5Cx90AQpqqEHJx996EsObebk + nPZZ7ktKjpLLERUQEHBs9uzZo8vDwtRsKnDPn8Ur93OcEVaEmmCdbeyjDW3pQ19tzck17cxf3BWsc52Y + mMzYJD8/v5agoKCvkMWPFyxY8LeFCxf+C6fZfwjW2cY+2tCWPpovOX72XzPfYJip3C7cszw4IoEUIB+o + Bho1sM429tGGtvSh7//95/TliDCEPDp5fnM9+TTnfU6wzjb20eaNw/1ffB1iO+5lm3QAAAAASUVORK5C + YII= + + + \ No newline at end of file diff --git a/ArinNewFpv4/lov.vb b/ArinNewFpv4/lov.vb new file mode 100644 index 0000000..e01a49d --- /dev/null +++ b/ArinNewFpv4/lov.vb @@ -0,0 +1,106 @@ +Public Class lov + Dim Dt As New DataTable + Dim A As New System.Text.StringBuilder + + Public Msg As String = "" '//lov가 반환한 메세지 : O일경우를 제외하고 반환된다. + Public Row As DataRowView = Nothing '//반환된 데이터로우 : O 이거나 1 일때만 반환된다. + Public StatusE As rStatus + Public Enum rStatus + NotFound = 1 '//검색어에대한 데이터가 없다 + OneRow = 2 '//하나밖에없었다(ok) + Multirow = 3 '//여러개의 데이터가 조재한다. + Canceld = 4 '//취소되었다. + End Enum +#Region "New Function" + Public Sub New() + InitializeComponent() + End Sub + Public Sub New(ByVal Dtable As DataTable, Optional ByVal ImeMode As System.Windows.Forms.ImeMode = Windows.Forms.ImeMode.Hangul) + ' 이 호출은 Windows Form 디자이너에 필요합니다. + Dt = Dtable + InitializeComponent() + Me.BindingSource1.DataSource = Dt + Me.DataGridView1.DataSource = Me.BindingSource1 + Me.tb_searchtext.ImeMode = ImeMode + End Sub +#End Region + +#Region "OK/CANCEL 버튼" + Private Sub Prc_OK() + Msg = "사용자선택" + Row = Me.BindingSource1.Current + StatusE = rStatus.OneRow + Me.DialogResult = System.Windows.Forms.DialogResult.OK + Me.Close() + End Sub + + Private Sub Prc_CalCel() + Msg = "사용자취소" + Row = Nothing + StatusE = rStatus.Canceld + Me.DialogResult = System.Windows.Forms.DialogResult.Cancel + Me.Close() + End Sub +#End Region + + + + ''' + ''' where 절을 생성한후 리턴(모든 열에대한 같은 where like 절 + ''' + ''' + ''' + Private Function WhereState() As String + A.Remove(0, A.Length) + For i As Integer = 0 To Me.Dt.Columns.Count - 1 + + If Dt.Columns(i).DataType.Name.ToUpper = "STRING" Then + A.Append(IIf(i = 0, "", Space(1) & "or ") & Dt.Columns(i).Caption & " like '" & Me.tb_searchtext.Text & "%'") + End If + Next + Return A.ToString + End Function + + Private Sub TextBox1_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles tb_searchtext.TextChanged + Me.BindingSource1.Filter = Me.WhereState + End Sub + Private Sub TextBox1_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles tb_searchtext.KeyDown + Select Case e.KeyCode + Case Keys.Down, Keys.Enter + Me.DataGridView1.Focus() + If Me.datagridview1.ActiveSheet.RowCount = 1 Then Me.Prc_OK() + Case Keys.Escape + Me.Prc_CalCel() + End Select + End Sub + + + Private Sub datagridview1_CellDoubleClick(ByVal sender As Object, ByVal e As FarPoint.Win.Spread.CellClickEventArgs) Handles datagridview1.CellDoubleClick + Me.Prc_OK() + End Sub + + Private Sub datagridview1_KeyDown1(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles datagridview1.KeyDown + Select Case e.KeyCode + Case Keys.F5 + Case Keys.Escape + Me.tb_searchtext.Focus() + Case Keys.Enter + Me.Prc_OK() + End Select + End Sub + + Private Sub datagridview1_KeyUp1(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles datagridview1.KeyUp + Select Case e.KeyCode + Case Keys.Escape + Me.tb_searchtext.Focus() + End Select + End Sub + + Private Sub ToolStripButton2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton2.Click + Me.Prc_OK() + End Sub + + Private Sub ToolStripButton1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton1.Click + Me.Prc_CalCel() + End Sub +End Class \ No newline at end of file diff --git a/ArinNewFpv5/ArinNewFp5.vbproj b/ArinNewFpv5/ArinNewFp5.vbproj new file mode 100644 index 0000000..2372487 --- /dev/null +++ b/ArinNewFpv5/ArinNewFp5.vbproj @@ -0,0 +1,182 @@ + + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {B0371B1F-8657-47A6-979E-4AEB970559D2} + Library + ArinNewFp + ArinNewFp + Windows + + + 3.5 + + + false + v4.0 + publish\ + true + Disk + false + Foreground + 7 + Days + false + false + true + 0 + 1.0.0.%2a + false + true + + + + true + full + true + true + bin\Debug\ + + + _MYFORMS=True + 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022,42353,42354,42355 + x86 + + + pdbonly + false + true + true + bin\debug\ + + + _MYFORMS=True + 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022,42353,42354,42355 + x86 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + lov.vb + + + Form + + + True + Application.myapp + + + + Component + + + NewFp.vb + + + + True + True + Resources.resx + + + True + Settings.settings + True + + + + + Designer + lov.vb + + + + VbMyResourcesResXFileCodeGenerator + Resources.Designer.vb + My.Resources + Designer + + + Designer + NewFp.vb + + + + + MyApplicationCodeGenerator + Application.Designer.vb + + + SettingsSingleFileGenerator + My + Settings.Designer.vb + + + + + + + + False + .NET Framework 3.5 SP1 Client Profile + false + + + False + .NET Framework 2.0%28x86%29 + true + + + False + .NET Framework 3.0%28x86%29 + false + + + False + .NET Framework 3.5 + false + + + False + .NET Framework 3.5 SP1 + false + + + + + \ No newline at end of file diff --git a/ArinNewFpv5/Form1.Designer.vb b/ArinNewFpv5/Form1.Designer.vb new file mode 100644 index 0000000..a024097 --- /dev/null +++ b/ArinNewFpv5/Form1.Designer.vb @@ -0,0 +1,29 @@ + _ +Partial Class Form1 + Inherits System.Windows.Forms.Form + + 'Form은 Dispose를 재정의하여 구성 요소 목록을 정리합니다. + _ + Protected Overrides Sub Dispose(ByVal disposing As Boolean) + Try + If disposing AndAlso components IsNot Nothing Then + components.Dispose() + End If + Finally + MyBase.Dispose(disposing) + End Try + End Sub + + 'Windows Form 디자이너에 필요합니다. + Private components As System.ComponentModel.IContainer + + '참고: 다음 프로시저는 Windows Form 디자이너에 필요합니다. + '수정하려면 Windows Form 디자이너를 사용하십시오. + '코드 편집기를 사용하여 수정하지 마십시오. + _ + Private Sub InitializeComponent() + components = New System.ComponentModel.Container + Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.Text = "Form1" + End Sub +End Class diff --git a/ArinNewFpv5/Form1.vb b/ArinNewFpv5/Form1.vb new file mode 100644 index 0000000..10d55d4 --- /dev/null +++ b/ArinNewFpv5/Form1.vb @@ -0,0 +1,3 @@ +Public Class Form1 + +End Class \ No newline at end of file diff --git a/ArinNewFpv5/My Project/Application.Designer.vb b/ArinNewFpv5/My Project/Application.Designer.vb new file mode 100644 index 0000000..c33da88 --- /dev/null +++ b/ArinNewFpv5/My Project/Application.Designer.vb @@ -0,0 +1,13 @@ +'------------------------------------------------------------------------------ +' +' 이 코드는 도구를 사용하여 생성되었습니다. +' 런타임 버전:4.0.30319.42000 +' +' 파일 내용을 변경하면 잘못된 동작이 발생할 수 있으며, 코드를 다시 생성하면 +' 이러한 변경 내용이 손실됩니다. +' +'------------------------------------------------------------------------------ + +Option Strict On +Option Explicit On + diff --git a/ArinNewFpv5/My Project/Application.myapp b/ArinNewFpv5/My Project/Application.myapp new file mode 100644 index 0000000..758895d --- /dev/null +++ b/ArinNewFpv5/My Project/Application.myapp @@ -0,0 +1,10 @@ + + + false + false + 0 + true + 0 + 1 + true + diff --git a/ArinNewFpv5/My Project/AssemblyInfo.vb b/ArinNewFpv5/My Project/AssemblyInfo.vb new file mode 100644 index 0000000..c1c0a65 --- /dev/null +++ b/ArinNewFpv5/My Project/AssemblyInfo.vb @@ -0,0 +1,34 @@ +Imports System +Imports System.Reflection +Imports System.Runtime.InteropServices + +' 어셈블리의 일반 정보는 다음 특성 집합을 통해 제어됩니다. +' 어셈블리와 관련된 정보를 수정하려면 +' 이 특성 값을 변경하십시오. + +' 어셈블리 특성 값을 검토합니다. + + + + + + + + + + +'이 프로젝트가 COM에 노출되는 경우 다음 GUID는 typelib의 ID를 나타냅니다. + + +' 어셈블리의 버전 정보는 다음 네 가지 값으로 구성됩니다. +' +' 주 버전 +' 부 버전 +' 빌드 번호 +' 수정 버전 +' +' 모든 값을 지정하거나 아래와 같이 '*'를 사용하여 빌드 번호 및 수정 버전이 자동으로 +' 지정되도록 할 수 있습니다. + + + diff --git a/ArinNewFpv5/My Project/Resources.Designer.vb b/ArinNewFpv5/My Project/Resources.Designer.vb new file mode 100644 index 0000000..f4a3f63 --- /dev/null +++ b/ArinNewFpv5/My Project/Resources.Designer.vb @@ -0,0 +1,63 @@ +'------------------------------------------------------------------------------ +' +' 이 코드는 도구를 사용하여 생성되었습니다. +' 런타임 버전:4.0.30319.42000 +' +' 파일 내용을 변경하면 잘못된 동작이 발생할 수 있으며, 코드를 다시 생성하면 +' 이러한 변경 내용이 손실됩니다. +' +'------------------------------------------------------------------------------ + +Option Strict On +Option Explicit On + +Imports System + +Namespace My.Resources + + '이 클래스는 ResGen 또는 Visual Studio와 같은 도구를 통해 StronglyTypedResourceBuilder + '클래스에서 자동으로 생성되었습니다. + '멤버를 추가하거나 제거하려면 .ResX 파일을 편집한 다음 /str 옵션을 사용하여 ResGen을 + '다시 실행하거나 VS 프로젝트를 다시 빌드하십시오. + ''' + ''' 지역화된 문자열 등을 찾기 위한 강력한 형식의 리소스 클래스입니다. + ''' + _ + Friend Module Resources + + Private resourceMan As Global.System.Resources.ResourceManager + + Private resourceCulture As Global.System.Globalization.CultureInfo + + ''' + ''' 이 클래스에서 사용하는 캐시된 ResourceManager 인스턴스를 반환합니다. + ''' + _ + Friend ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager + Get + If Object.ReferenceEquals(resourceMan, Nothing) Then + Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("ArinNewFp.Resources", GetType(Resources).Assembly) + resourceMan = temp + End If + Return resourceMan + End Get + End Property + + ''' + ''' 이 강력한 형식의 리소스 클래스를 사용하여 모든 리소스 조회에 대한 현재 스레드의 CurrentUICulture + ''' 속성을 재정의합니다. + ''' + _ + Friend Property Culture() As Global.System.Globalization.CultureInfo + Get + Return resourceCulture + End Get + Set + resourceCulture = value + End Set + End Property + End Module +End Namespace diff --git a/ArinNewFpv5/My Project/Resources.resx b/ArinNewFpv5/My Project/Resources.resx new file mode 100644 index 0000000..af7dbeb --- /dev/null +++ b/ArinNewFpv5/My Project/Resources.resx @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/ArinNewFpv5/My Project/Settings.Designer.vb b/ArinNewFpv5/My Project/Settings.Designer.vb new file mode 100644 index 0000000..1010f54 --- /dev/null +++ b/ArinNewFpv5/My Project/Settings.Designer.vb @@ -0,0 +1,73 @@ +'------------------------------------------------------------------------------ +' +' 이 코드는 도구를 사용하여 생성되었습니다. +' 런타임 버전:4.0.30319.42000 +' +' 파일 내용을 변경하면 잘못된 동작이 발생할 수 있으며, 코드를 다시 생성하면 +' 이러한 변경 내용이 손실됩니다. +' +'------------------------------------------------------------------------------ + +Option Strict On +Option Explicit On + + +Namespace My + + _ + Partial Friend NotInheritable Class MySettings + Inherits Global.System.Configuration.ApplicationSettingsBase + + Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings()),MySettings) + +#Region "My.Settings 자동 저장 기능" +#If _MyType = "WindowsForms" Then + Private Shared addedHandler As Boolean + + Private Shared addedHandlerLockObject As New Object + + _ + Private Shared Sub AutoSaveSettings(ByVal sender As Global.System.Object, ByVal e As Global.System.EventArgs) + If My.Application.SaveMySettingsOnExit Then + My.Settings.Save() + End If + End Sub +#End If +#End Region + + Public Shared ReadOnly Property [Default]() As MySettings + Get + +#If _MyType = "WindowsForms" Then + If Not addedHandler Then + SyncLock addedHandlerLockObject + If Not addedHandler Then + AddHandler My.Application.Shutdown, AddressOf AutoSaveSettings + addedHandler = True + End If + End SyncLock + End If +#End If + Return defaultInstance + End Get + End Property + End Class +End Namespace + +Namespace My + + _ + Friend Module MySettingsProperty + + _ + Friend ReadOnly Property Settings() As Global.ArinNewFp.My.MySettings + Get + Return Global.ArinNewFp.My.MySettings.Default + End Get + End Property + End Module +End Namespace diff --git a/ArinNewFpv5/My Project/Settings.settings b/ArinNewFpv5/My Project/Settings.settings new file mode 100644 index 0000000..85b890b --- /dev/null +++ b/ArinNewFpv5/My Project/Settings.settings @@ -0,0 +1,7 @@ + + + + + + + diff --git a/ArinNewFpv5/My Project/licenses.licx b/ArinNewFpv5/My Project/licenses.licx new file mode 100644 index 0000000..3cc5b63 --- /dev/null +++ b/ArinNewFpv5/My Project/licenses.licx @@ -0,0 +1 @@ +FarPoint.Win.Spread.FpSpread, FarPoint.Win.Spread, Version=5.0.3505.2008, Culture=neutral, PublicKeyToken=327c3516b1b18457 diff --git a/ArinNewFpv5/MyINI.vb b/ArinNewFpv5/MyINI.vb new file mode 100644 index 0000000..e9ca3e4 --- /dev/null +++ b/ArinNewFpv5/MyINI.vb @@ -0,0 +1,287 @@ +Imports System.IO + +Public Class tinyIni + Declare Function GetPrivateProfileString Lib "kernel32" Alias "GetPrivateProfileStringA" (ByVal lpApplicationName As String, ByVal lpKeyName As String, ByVal lpDefault As String, ByVal lpReturnedString As String, ByVal nSize As Integer, ByVal lpFileName As String) As Integer + Declare Function WritePrivateProfileString Lib "kernel32" Alias "WritePrivateProfileStringA" (ByVal lpApplicationName As String, ByVal lpKeyName As String, ByVal lpString As String, ByVal lpDownFileName As String) As Integer + 'Private Aname As String + Public FileName As String = vbNullString + Private FileNameBuf As String + Private m_sPath As String + Private m_sKey As String + Private m_sSection As String + Private m_sDefault As String + Private m_lLastReturnCode As Integer + + Public Sub New(ByVal File As String) + FileName = File + FileNameBuf = File + Me.Create() + + 'MsgBox("New 1=" & FileName & vbCrLf & "2=" & FileNameBuf) + + ' If Not System.IO.File.Exists(File) Then System.IO.File.Create(File) + End Sub + Public Sub Create() + If Exist() = True Then Return + Dim A As New IO.FileInfo(FileName) + A.Directory.Create() + Dim FS As IO.FileStream = A.Create() + Dim SW As New IO.StreamWriter(FS, System.Text.Encoding.Default) + SW.WriteLine("//Myini 로부터 자동생성된 파일입니다") + SW.WriteLine("//생성일자 : " & Now.ToString) + SW.Flush() + SW.Close() + FS.Close() + SW = Nothing + FS = Nothing + FileName = FileNameBuf + End Sub + Public Function Exist() As Boolean + Return System.IO.File.Exists(FileName) + End Function + + Public Function Read(ByVal appkey As String, ByVal subkey As String, Optional ByVal DefaultValue As String = vbNullString) As String '//변수초기화 + 'MsgBox("Read 1=" & FileName & vbCrLf & "2=" & FileNameBuf) + + Dim tempstr As Integer 'ini파일에서 읽어온 값을 임시저장하는 변수 + Dim strtemp As String = New String(Chr(0), 2000) 'ini파일의 임시 변수 + Dim Tempbuf As String + + If Not Exist() Then + MsgBox("환경파일이 존재하지 않습니다" & vbCrLf & "APP=" & appkey & vbCrLf & "subkey=" & subkey & vbCrLf & "파일명=" & FileName, MsgBoxStyle.Critical, "Error") + Return vbNullString + End If + Try + tempstr = GetPrivateProfileString(appkey, subkey, "", strtemp, Len(strtemp), FileName) + Tempbuf = strtemp.Substring(0, tempstr) + Tempbuf = Tempbuf.Trim(Chr(0)) + + FileName = FileNameBuf + + If Tempbuf.Trim = vbNullString AndAlso DefaultValue <> vbNullString Then + Return DefaultValue + Else + Return Tempbuf + End If + Catch ex As Exception + FileName = FileNameBuf + Return vbNullString + End Try + + End Function + Public Function ReadFile(ByVal appkey As String, ByVal subkey As String, ByVal filename2 As String, Optional ByVal DefaultValue As String = vbNullString) As String '//변수초기화 + 'MsgBox("ReadFile 1=" & FileName & vbCrLf & "2=" & FileNameBuf) + Dim tempstr As Integer 'ini파일에서 읽어온 값을 임시저장하는 변수 + Dim strtemp As String = New String(Chr(0), 2000) 'ini파일의 임시 변수 + Dim Tempbuf As String + + If Not System.IO.File.Exists(filename2) Then + MsgBox("환경파일이 존재하지 않습니다" & vbCrLf & "파일명=" & FileName, MsgBoxStyle.Critical, "Error") + Return vbNullString + End If + + Try + tempstr = GetPrivateProfileString(appkey, subkey, "", strtemp, Len(strtemp), filename2) + Tempbuf = strtemp.Substring(0, tempstr) + If Tempbuf.Trim = vbNullString AndAlso DefaultValue <> vbNullString Then + Return DefaultValue + Else + Return Tempbuf + End If + Catch ex As Exception + Return vbNullString + End Try + FileName = FileNameBuf + End Function + + Public Function Write(ByVal appkey As String, ByVal subkey As String, ByVal WriteVal As Object) As Integer + Dim RetVal As Integer + 'MsgBox("Write1 1=" & FileName & vbCrLf & "2=" & FileNameBuf) + If Not Exist() Then + MsgBox("환경파일이 존재하지 않습니다" & vbCrLf & "파일을 생성합니다." & vbCrLf & "파일명=" & FileName, MsgBoxStyle.Information, "확인") + Me.Create() + End If + ' FileName = Aname + RetVal = (WritePrivateProfileString(appkey, subkey, WriteVal, FileName)) + FileName = FileNameBuf + Return RetVal + + End Function + Public Sub Write(ByVal appkey As String, ByVal subkey As String, ByVal WriteVal As Object, ByVal fileName2 As String) + 'MsgBox("Write2 1=" & FileName & vbCrLf & "2=" & FileNameBuf) + If Not System.IO.File.Exists(fileName2) Then + MsgBox("[D] 환경파일이 존재하지 않습니다" & vbCrLf & "파일을 생성합니다." & vbCrLf & "파일명=" & fileName2, MsgBoxStyle.Information, "확인") + System.IO.File.Create(fileName2) + End If + WritePrivateProfileString(appkey, subkey, WriteVal, fileName2) + FileName = FileNameBuf + End Sub + + + + Public Sub EnumerateCurrentSection(ByRef sKey() As String, ByRef iCount As Integer) + Dim sSection As String + Dim iPos As Integer + Dim iNextPos As Integer + Dim sCur As String + + iCount = 0 + Erase sKey + sSection = INISection + If (Len(sSection) > 0) Then + iPos = 1 + iNextPos = InStr(iPos, sSection, Chr(0)) + Do While iNextPos <> 0 + sCur = Mid(sSection, iPos, iNextPos - iPos) + If (sCur <> Chr(0)) Then + iCount = iCount + 1 + 'UPGRADE_WARNING: sKey 배열의 하한이 1에서 0(으)로 변경되었습니다. 자세한 내용은 다음을 참조하십시오. 'ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?keyword="0F1C9BE1-AF9D-476E-83B1-17D43BECFF20"' + ReDim Preserve sKey(iCount) + sKey(iCount) = Mid(sSection, iPos, iNextPos - iPos) + iPos = iNextPos + 1 + iNextPos = InStr(iPos, sSection, Chr(0)) + End If + Loop + End If + End Sub + + + Public Sub GetAllsection(ByVal key As String, ByRef Section As ArrayList, ByRef Value As ArrayList) + Dim FS As New System.IO.FileStream(FileName, FileMode.Open) + Dim SR As New StreamReader(FS, System.Text.Encoding.Default) + Dim Findkey As String = "[" & key & "]" + Dim Line As String + Dim KeyPos As Integer = -1 + Dim Seppos As Integer = -1 + While SR.Peek > -1 + Line = SR.ReadLine + If KeyPos = -1 Then '//키를 못찻았으면 + If Line.ToUpper.IndexOf(Findkey.ToUpper) > -1 Then KeyPos = Line.ToUpper.IndexOf(Findkey.ToUpper) + Else '//찾앗으면 + If Line.IndexOf("[") = -1 Then '//그다음 키가 오기전까지 모두 추가한다. + Seppos = Line.IndexOf("=") + Section.Add(Line.Substring(0, Seppos)) + Value.Add(Line.Substring(Seppos + 1)) + Else + Exit While + End If + End If + End While + + SR.Close() + FS.Close() + + + End Sub + + Public Sub EnumerateAllSections(ByRef sSections() As String, ByRef iCount As Integer) + Dim sIniFile As String + Dim iPos As Integer + Dim iNextPos As Integer + Dim sCur As String + + iCount = 0 + Erase sSections + sIniFile = Sections + If (Len(sIniFile) > 0) Then + iPos = 1 + iNextPos = InStr(iPos, sIniFile, Chr(0)) + Do While iNextPos <> 0 + If (iNextPos <> iPos) Then + sCur = Mid(sIniFile, iPos, iNextPos - iPos) + iCount = iCount + 1 + 'UPGRADE_WARNING: sSections 배열의 하한이 1에서 0(으)로 변경되었습니다. 자세한 내용은 다음을 참조하십시오. 'ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?keyword="0F1C9BE1-AF9D-476E-83B1-17D43BECFF20"' + ReDim Preserve sSections(iCount) + sSections(iCount) = sCur + End If + iPos = iNextPos + 1 + iNextPos = InStr(iPos, sIniFile, Chr(0)) + Loop + End If + + End Sub + + Property INISection() As String + Get + Dim sBuf As String + Dim iSize As String + Dim iRetCode As Short + + sBuf = Space(8192) + iSize = CStr(Len(sBuf)) + iRetCode = GetPrivateProfileString(m_sSection, 0, m_sDefault, sBuf, CInt(iSize), m_sPath) + If (CDbl(iSize) > 0) Then + INISection = Left(sBuf, iRetCode) + Else + INISection = "" + End If + + End Get + Set(ByVal Value As String) + m_lLastReturnCode = WritePrivateProfileString(m_sSection, 0, Value, m_sPath) + End Set + End Property + ReadOnly Property Sections() As String + Get + Dim sBuf As String + Dim iSize As String + Dim iRetCode As Short + + sBuf = Space(8192) + iSize = CStr(Len(sBuf)) + iRetCode = GetPrivateProfileString(0, 0, m_sDefault, sBuf, CInt(iSize), m_sPath) + If (CDbl(iSize) > 0) Then + Sections = Left(sBuf, iRetCode) + Else + Sections = "" + End If + + End Get + End Property + + ReadOnly Property LastReturnCode() As Integer + Get + LastReturnCode = m_lLastReturnCode + End Get + End Property + ReadOnly Property Success() As Boolean + Get + Success = (m_lLastReturnCode <> 0) + End Get + End Property + 'UPGRADE_NOTE: Default이(가) Default_Renamed(으)로 업그레이드되었습니다. 자세한 내용은 다음을 참조하십시오. 'ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?keyword="A9E4979A-37FA-4718-9994-97DD76ED70A7"' + Property Default_Renamed() As String + Get + Default_Renamed = m_sDefault + End Get + Set(ByVal Value As String) + m_sDefault = Value + End Set + End Property + Property Path() As String + Get + Path = m_sPath + End Get + Set(ByVal Value As String) + m_sPath = Value + End Set + End Property + Property Key() As String + Get + Key = m_sKey + End Get + Set(ByVal Value As String) + m_sKey = Value + End Set + End Property + Property Section() As String + Get + Section = m_sSection + End Get + Set(ByVal Value As String) + m_sSection = Value + End Set + End Property + + +End Class \ No newline at end of file diff --git a/ArinNewFpv5/NewFp.Designer.vb b/ArinNewFpv5/NewFp.Designer.vb new file mode 100644 index 0000000..1be86ba --- /dev/null +++ b/ArinNewFpv5/NewFp.Designer.vb @@ -0,0 +1,36 @@ + _ +Partial Class NewFp + Inherits FarPoint.Win.Spread.FpSpread + + 'UserControl1은 Dispose를 재정의하여 구성 요소 목록을 정리합니다. + _ + Protected Overrides Sub Dispose(ByVal disposing As Boolean) + Try + If disposing AndAlso components IsNot Nothing Then + components.Dispose() + End If + Finally + MyBase.Dispose(disposing) + End Try + End Sub + + 'Windows Form 디자이너에 필요합니다. + Private components As System.ComponentModel.IContainer + + '참고: 다음 프로시저는 Windows Form 디자이너에 필요합니다. + '수정하려면 Windows Form 디자이너를 사용하십시오. + '코드 편집기를 사용하여 수정하지 마십시오. + _ + Private Sub InitializeComponent() + CType(Me, System.ComponentModel.ISupportInitialize).BeginInit() + Me.SuspendLayout() + ' + 'NewFp + ' + Me.ActiveSheetIndex = -1 + CType(Me, System.ComponentModel.ISupportInitialize).EndInit() + Me.ResumeLayout(False) + + End Sub + +End Class diff --git a/ArinNewFpv5/NewFp.resx b/ArinNewFpv5/NewFp.resx new file mode 100644 index 0000000..52a9ad3 --- /dev/null +++ b/ArinNewFpv5/NewFp.resx @@ -0,0 +1,123 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + False + + \ No newline at end of file diff --git a/ArinNewFpv5/NewFp.vb b/ArinNewFpv5/NewFp.vb new file mode 100644 index 0000000..f764fee --- /dev/null +++ b/ArinNewFpv5/NewFp.vb @@ -0,0 +1,1420 @@ +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 = Windows.Forms.ImeMode.Hangul + Else + If Not Me.ActiveColumn.Tag Is Nothing Then + If Array.IndexOf(Me.ѱʵ, Me.ActiveColumn.Tag) >= 0 Then + Me.ImeMode = Windows.Forms.ImeMode.Hangul + Else + Me.ImeMode = 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 = Windows.Forms.ImeMode.Hangul + Else + Me.ImeMode = Windows.Forms.ImeMode.Alpha + End If + Else + Me.ImeMode = 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 = 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 = 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 = 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 diff --git a/ArinNewFpv5/lov.Designer.vb b/ArinNewFpv5/lov.Designer.vb new file mode 100644 index 0000000..c3016d4 --- /dev/null +++ b/ArinNewFpv5/lov.Designer.vb @@ -0,0 +1,152 @@ + _ +Partial Class lov + Inherits System.Windows.Forms.Form + + 'Form은 Dispose를 재정의하여 구성 요소 목록을 정리합니다. + _ + Protected Overrides Sub Dispose(ByVal disposing As Boolean) + Try + If disposing AndAlso components IsNot Nothing Then + components.Dispose() + End If + Finally + MyBase.Dispose(disposing) + End Try + End Sub + + 'Windows Form 디자이너에 필요합니다. + Private components As System.ComponentModel.IContainer + + '참고: 다음 프로시저는 Windows Form 디자이너에 필요합니다. + '수정하려면 Windows Form 디자이너를 사용하십시오. + '코드 편집기를 사용하여 수정하지 마십시오. + _ + Private Sub InitializeComponent() + Me.components = New System.ComponentModel.Container() + Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(lov)) + Me.ToolStripButton1 = New System.Windows.Forms.ToolStripButton() + Me.TableLayoutPanel1 = New System.Windows.Forms.TableLayoutPanel() + Me.tb_searchtext = New System.Windows.Forms.TextBox() + Me.datagridview1 = New FarPoint.Win.Spread.FpSpread() + Me.datagridview1_Sheet1 = New FarPoint.Win.Spread.SheetView() + Me.ToolStrip1 = New System.Windows.Forms.ToolStrip() + Me.ToolStripButton2 = New System.Windows.Forms.ToolStripButton() + Me.BindingSource1 = New System.Windows.Forms.BindingSource(Me.components) + Me.TableLayoutPanel1.SuspendLayout() + CType(Me.datagridview1, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.datagridview1_Sheet1, System.ComponentModel.ISupportInitialize).BeginInit() + Me.ToolStrip1.SuspendLayout() + CType(Me.BindingSource1, System.ComponentModel.ISupportInitialize).BeginInit() + Me.SuspendLayout() + ' + 'ToolStripButton1 + ' + Me.ToolStripButton1.Alignment = System.Windows.Forms.ToolStripItemAlignment.Right + Me.ToolStripButton1.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image + Me.ToolStripButton1.Image = CType(resources.GetObject("ToolStripButton1.Image"), System.Drawing.Image) + Me.ToolStripButton1.ImageTransparentColor = System.Drawing.Color.Magenta + Me.ToolStripButton1.Name = "ToolStripButton1" + Me.ToolStripButton1.Size = New System.Drawing.Size(36, 37) + Me.ToolStripButton1.Text = "ToolStripButton1" + ' + 'TableLayoutPanel1 + ' + Me.TableLayoutPanel1.ColumnCount = 1 + Me.TableLayoutPanel1.ColumnStyles.Add(New System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 521.0!)) + Me.TableLayoutPanel1.Controls.Add(Me.tb_searchtext, 0, 0) + Me.TableLayoutPanel1.Controls.Add(Me.datagridview1, 0, 1) + Me.TableLayoutPanel1.Controls.Add(Me.ToolStrip1, 0, 2) + Me.TableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill + Me.TableLayoutPanel1.Location = New System.Drawing.Point(0, 0) + Me.TableLayoutPanel1.Margin = New System.Windows.Forms.Padding(3, 4, 3, 4) + Me.TableLayoutPanel1.Name = "TableLayoutPanel1" + Me.TableLayoutPanel1.RowCount = 3 + Me.TableLayoutPanel1.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 40.0!)) + Me.TableLayoutPanel1.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100.0!)) + Me.TableLayoutPanel1.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 40.0!)) + Me.TableLayoutPanel1.Size = New System.Drawing.Size(521, 499) + Me.TableLayoutPanel1.TabIndex = 4 + ' + 'tb_searchtext + ' + Me.tb_searchtext.CharacterCasing = System.Windows.Forms.CharacterCasing.Upper + Me.tb_searchtext.Dock = System.Windows.Forms.DockStyle.Fill + Me.tb_searchtext.Font = New System.Drawing.Font("맑은 고딕", 15.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(129, Byte)) + Me.tb_searchtext.Location = New System.Drawing.Point(3, 4) + Me.tb_searchtext.Margin = New System.Windows.Forms.Padding(3, 4, 3, 4) + Me.tb_searchtext.Name = "tb_searchtext" + Me.tb_searchtext.Size = New System.Drawing.Size(515, 35) + Me.tb_searchtext.TabIndex = 3 + Me.tb_searchtext.TextAlign = System.Windows.Forms.HorizontalAlignment.Center + ' + 'datagridview1 + ' + Me.datagridview1.AccessibleDescription = "datagridview1, Sheet1, Row 0, Column 0, " + Me.datagridview1.BackColor = System.Drawing.SystemColors.Control + Me.datagridview1.Dock = System.Windows.Forms.DockStyle.Fill + Me.datagridview1.Location = New System.Drawing.Point(3, 43) + Me.datagridview1.Name = "datagridview1" + Me.datagridview1.RightToLeft = System.Windows.Forms.RightToLeft.No + Me.datagridview1.Sheets.AddRange(New FarPoint.Win.Spread.SheetView() {Me.datagridview1_Sheet1}) + Me.datagridview1.Size = New System.Drawing.Size(515, 413) + Me.datagridview1.TabIndex = 4 + ' + 'datagridview1_Sheet1 + ' + Me.datagridview1_Sheet1.Reset() + Me.datagridview1_Sheet1.SheetName = "Sheet1" + 'Formulas and custom names must be loaded with R1C1 reference style + Me.datagridview1_Sheet1.ReferenceStyle = FarPoint.Win.Spread.Model.ReferenceStyle.R1C1 + Me.datagridview1_Sheet1.ColumnHeader.Rows.Get(0).Height = 30.0! + Me.datagridview1_Sheet1.RowHeader.Columns.Default.Resizable = False + Me.datagridview1_Sheet1.SelectionUnit = FarPoint.Win.Spread.Model.SelectionUnit.Row + Me.datagridview1_Sheet1.ReferenceStyle = FarPoint.Win.Spread.Model.ReferenceStyle.A1 + ' + 'ToolStrip1 + ' + Me.ToolStrip1.AutoSize = False + Me.ToolStrip1.Dock = System.Windows.Forms.DockStyle.Fill + Me.ToolStrip1.ImageScalingSize = New System.Drawing.Size(32, 32) + Me.ToolStrip1.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.ToolStripButton1, Me.ToolStripButton2}) + Me.ToolStrip1.Location = New System.Drawing.Point(0, 459) + Me.ToolStrip1.Name = "ToolStrip1" + Me.ToolStrip1.Size = New System.Drawing.Size(521, 40) + Me.ToolStrip1.TabIndex = 5 + Me.ToolStrip1.Text = "ToolStrip1" + ' + 'ToolStripButton2 + ' + Me.ToolStripButton2.Alignment = System.Windows.Forms.ToolStripItemAlignment.Right + Me.ToolStripButton2.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image + Me.ToolStripButton2.ImageTransparentColor = System.Drawing.Color.Magenta + Me.ToolStripButton2.Name = "ToolStripButton2" + Me.ToolStripButton2.Size = New System.Drawing.Size(23, 37) + Me.ToolStripButton2.Text = "ToolStripButton2" + ' + 'lov + ' + Me.AutoScaleDimensions = New System.Drawing.SizeF(7.0!, 12.0!) + Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.ClientSize = New System.Drawing.Size(521, 499) + Me.Controls.Add(Me.TableLayoutPanel1) + Me.Name = "lov" + Me.Text = "lov" + Me.TableLayoutPanel1.ResumeLayout(False) + Me.TableLayoutPanel1.PerformLayout() + CType(Me.datagridview1, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.datagridview1_Sheet1, System.ComponentModel.ISupportInitialize).EndInit() + Me.ToolStrip1.ResumeLayout(False) + Me.ToolStrip1.PerformLayout() + CType(Me.BindingSource1, System.ComponentModel.ISupportInitialize).EndInit() + Me.ResumeLayout(False) + + End Sub + Friend WithEvents ToolStripButton1 As System.Windows.Forms.ToolStripButton + Friend WithEvents TableLayoutPanel1 As System.Windows.Forms.TableLayoutPanel + Friend WithEvents tb_searchtext As System.Windows.Forms.TextBox + Friend WithEvents datagridview1 As FarPoint.Win.Spread.FpSpread + Friend WithEvents datagridview1_Sheet1 As FarPoint.Win.Spread.SheetView + Friend WithEvents ToolStrip1 As System.Windows.Forms.ToolStrip + Friend WithEvents ToolStripButton2 As System.Windows.Forms.ToolStripButton + Friend WithEvents BindingSource1 As System.Windows.Forms.BindingSource +End Class diff --git a/ArinNewFpv5/lov.resx b/ArinNewFpv5/lov.resx new file mode 100644 index 0000000..77338b3 --- /dev/null +++ b/ArinNewFpv5/lov.resx @@ -0,0 +1,172 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + + + iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 + YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAhFSURBVFhHpVdrTJVHGqZF6Q8DTTZq8PLDoN2gAS9Ea0w0 + NupaW6kQRAEVKCIiIBzuN7nfBLkowqngZVVQ8QZmrb1wWinIuR8U0NXQrGu7PZuYTXaT/bXZpGnePs98 + 37FgtbW7kzyZOTPv+zwz77wz8x2vVy2JiYm/Kyoqii4tLW2vrKwcqqmpcZeXl/+XYJt9HKMNbXW3/7u8 + lpaWNregoKC4oaZGzgGm1lYZu3RJvhsYkH+OjSmwzT6O0Ya29KEvOTSq3168DQbDjobKSrleXy8Prl6V + 727dkonOThmtrhZHdrZYkpMV2GYfx2hDW/rQlxzk0ihfvUzLysoqOwkC1/nz8teeHrmHtjlpn5j37ZNh + haRJbQ3qN2zuVVYoH/p2wo9c5NSof71Mz8zMbL5QWysTfX0y3tAgw/v3gxhgjRWbDxwQiw7VTj4g1oNp + YkY9vD9JA+zvw3eit0/IRU5yaxIvL9NSU1MruxDOry9fFmdRkSKlyLAuNgj0pqfLmewcOZafr/DHnGzp + zciQwdRUsaSkqElqE00WV3GRfH3lspCT3NTQpH5evOPj43cbS0tl4sYNcR0qFjPIiGFgAOQXMjOlKS9P + du3a9XTjxo1jS5cuNRFss49jV2Cj/FI1X8J56JDiJDc1qKVJ/lReW7t27e9LQODAvt1vbhZzGkJKHDwo + fVhdCxItNDT08ZIlS/pgnw/EAmE6EjFmr6N/bR180uF7UAO2xgLcbzmquKlBLfhMOR1vREdHH+mqrpIn + vdfFghCb0zPEkmFAaA1SlpUly5cv/xx26cBmIBCYDbzJes+ePedqcnPlW5NJ7Ll5Ys5Ih28GOFgbFB/x + 5No16aqqFmrB7w1AK4sXL34r12CQ8eu9MlrfIBaE0QrR26gb0L9ixYpbMONxWgT4Aq8DLD4JCQnGKkTH + PTQo9oIC5euBFf3mLLYxCfy+h+iMYxLUoqbO4TVty5YtWS0Izd8++UQsSCgLEsySkyNnYYixB7ChOC+V + yQnkExcXZywH8d+HhsSOhLVAkKL0t4LvC7S7waFxYgz1NzdvSjOiRU1wKD6/8PDwa9dxZO63tSlHKwwG + MYFSJBL2vBU2XPkUcSSdsQRhdd+5I/aSErHAz4LwW/JyxZpfIF+CIxsnpgwcQ+TU8eDECblSUyvUBI8f + yeZERkY+uINbzFlZJVaE0VpYKD3Ygm3btj3BOPecYfcUn6ioKGMRToV7eFgc5eWaj/IjisSEo2lISpLV + q1c/3Lp169Merr6gUI2P1B2WASyUmuCaQ8IAEP7r7tmzYsNKrMXFCi04AevWrfsU40y4Z3seERFhzMOF + 5DabxYFbzqbsD4kVx5Z+JkwkLSGB4k7YF6EeasFJ8vA6KyrE2dEh1MR4AEkD8eP7e0aj2MrKxFpSKtbS + EilITBSccWYrs53FBxExZuO6dVss4sSDwwnbYGuDj628TEyIXHJcnKxatYriPKZrgoKCWgrho2xwD1Bj + DNtATYxzcV7B27dv/96Gx8OG2WkolzysYtmyZRUY51HzQSiNGehzW63irKtTNj/ZV4gJq9u3e5eEhIR4 + xLm6WeTI37sXE4Q9gXfCiXuGmhgPBryCQf5vEwlxXdqqqhTqkUC4MM5jfPbmzZuNafHx4rbZxIlj6rGx + 67UJkfgwKkqCg4Mni/Pef5McjcgXG86/4q+ukS9RUxPjagKB2OvHPdg7Ox4ND7qQxRs2bBhdv379uQOx + e8Rtt4ursXGKjQ3oR0hjIyNfJM4yG/53r2Llmk+Nqi9Bi5oYV1sQsHLlygEmnb3+sNgPE/WCTx5JiYmR + RKxMiSNsdmzTM8CmH6GPCQ+XwMDAF4m/jgss1oDIjXd36z4afxO0qAkblYRzFi5c2JqO/XMcOSKOxiNi + Zw2cwl0wji+dkWPH1G9PP9GP0O/44IOXibP4rlmz5k/X4Pvw4kXla1fcjZKOhVETNuoY+s2YMWPnlk2b + pAdPpwMrVWjCilm3tEzpI/oRnYj335dFixa9THwa3o6UfGT/48FBGcG5dzQ3Kd8eJCu1qAk7dRHxhgsJ + CAjoL0S4HEex2mN4uY4+D62/v65Wtr377i+KI/R7d4SGirW3V/6MCNLPqfMUfhgv1IJdCG2VB4o/ZpS2 + 6Z135Ex+njiPtwLHxdEKsMZvx/E2+Rz7GPqHTSR44Z5j1e/hGHZl4dhZ+3rlIT9q6AseJz5Yz+Aqpga1 + YO+vuWmFT+PKWbNm9cSFhcnHyFRnW/sU2BHG43jZdmPfcbk8whthRL0Tl1UEhKuB23txGi5jzx/jin54 + 5ao429s0//Z2+Rj3P7mpQS1d81nhx8FMIGzevHl30pD5pqYmcX700RTcPXVaJj77TG5fvCAt2Mv9sCPY + /gqrdbtc8heM3z19GvbGZ36mpkYhJ7mpoWv97HOdn0nzgZi5c+e6UnbulJs4Ms4THRpwf7s6TsgIyB/h + 8+pbPMFPR0eBMfkG3wKP+m4oYRdsXbDVfDoVB7nISW5d46Wf6UwK7musv7+/JRqZ3lmQL67OkwBey5MA + ax2uk3o/2x6w7xSAugOvIjnIRU6de/Kz/sLCpKJhjJ+f3823Q0IkA+e2u6wcxKd0ctYe6IKT0I2bjz70 + JQe5dM7Jp+UXC2fJUIVNnz796MyZM0eWBQWp1ZThnT+Dr9xPcS9YEGqCbfZxjDa0pQ99yaFz/erKny/c + JyYLMzbO29u72dfX9wtk8aP58+f/Y8GCBf/BbfYDwTb7OEYb2tJH9yXHb/5r5inMVB4XnlleHKFAApAD + VAENOthmH8doQ1v60Pd//nP6fGEIeXXy/uZ+8iXjc0qwzT6O0eYVw+3l9SN8HWI7NvTF+gAAAABJRU5E + rkJggg== + + + + 17, 17 + + + 190, 17 + + + 299, 17 + + \ No newline at end of file diff --git a/ArinNewFpv5/lov.vb b/ArinNewFpv5/lov.vb new file mode 100644 index 0000000..e01a49d --- /dev/null +++ b/ArinNewFpv5/lov.vb @@ -0,0 +1,106 @@ +Public Class lov + Dim Dt As New DataTable + Dim A As New System.Text.StringBuilder + + Public Msg As String = "" '//lov가 반환한 메세지 : O일경우를 제외하고 반환된다. + Public Row As DataRowView = Nothing '//반환된 데이터로우 : O 이거나 1 일때만 반환된다. + Public StatusE As rStatus + Public Enum rStatus + NotFound = 1 '//검색어에대한 데이터가 없다 + OneRow = 2 '//하나밖에없었다(ok) + Multirow = 3 '//여러개의 데이터가 조재한다. + Canceld = 4 '//취소되었다. + End Enum +#Region "New Function" + Public Sub New() + InitializeComponent() + End Sub + Public Sub New(ByVal Dtable As DataTable, Optional ByVal ImeMode As System.Windows.Forms.ImeMode = Windows.Forms.ImeMode.Hangul) + ' 이 호출은 Windows Form 디자이너에 필요합니다. + Dt = Dtable + InitializeComponent() + Me.BindingSource1.DataSource = Dt + Me.DataGridView1.DataSource = Me.BindingSource1 + Me.tb_searchtext.ImeMode = ImeMode + End Sub +#End Region + +#Region "OK/CANCEL 버튼" + Private Sub Prc_OK() + Msg = "사용자선택" + Row = Me.BindingSource1.Current + StatusE = rStatus.OneRow + Me.DialogResult = System.Windows.Forms.DialogResult.OK + Me.Close() + End Sub + + Private Sub Prc_CalCel() + Msg = "사용자취소" + Row = Nothing + StatusE = rStatus.Canceld + Me.DialogResult = System.Windows.Forms.DialogResult.Cancel + Me.Close() + End Sub +#End Region + + + + ''' + ''' where 절을 생성한후 리턴(모든 열에대한 같은 where like 절 + ''' + ''' + ''' + Private Function WhereState() As String + A.Remove(0, A.Length) + For i As Integer = 0 To Me.Dt.Columns.Count - 1 + + If Dt.Columns(i).DataType.Name.ToUpper = "STRING" Then + A.Append(IIf(i = 0, "", Space(1) & "or ") & Dt.Columns(i).Caption & " like '" & Me.tb_searchtext.Text & "%'") + End If + Next + Return A.ToString + End Function + + Private Sub TextBox1_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles tb_searchtext.TextChanged + Me.BindingSource1.Filter = Me.WhereState + End Sub + Private Sub TextBox1_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles tb_searchtext.KeyDown + Select Case e.KeyCode + Case Keys.Down, Keys.Enter + Me.DataGridView1.Focus() + If Me.datagridview1.ActiveSheet.RowCount = 1 Then Me.Prc_OK() + Case Keys.Escape + Me.Prc_CalCel() + End Select + End Sub + + + Private Sub datagridview1_CellDoubleClick(ByVal sender As Object, ByVal e As FarPoint.Win.Spread.CellClickEventArgs) Handles datagridview1.CellDoubleClick + Me.Prc_OK() + End Sub + + Private Sub datagridview1_KeyDown1(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles datagridview1.KeyDown + Select Case e.KeyCode + Case Keys.F5 + Case Keys.Escape + Me.tb_searchtext.Focus() + Case Keys.Enter + Me.Prc_OK() + End Select + End Sub + + Private Sub datagridview1_KeyUp1(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles datagridview1.KeyUp + Select Case e.KeyCode + Case Keys.Escape + Me.tb_searchtext.Focus() + End Select + End Sub + + Private Sub ToolStripButton2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton2.Click + Me.Prc_OK() + End Sub + + Private Sub ToolStripButton1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton1.Click + Me.Prc_CalCel() + End Sub +End Class \ No newline at end of file