Initialize
This commit is contained in:
commit
3b5cdc6429
BIN
.vs/Test_TabAndDataGridViewControls/v17/.suo
Normal file
BIN
.vs/Test_TabAndDataGridViewControls/v17/.suo
Normal file
Binary file not shown.
31
.vs/Test_TabAndDataGridViewControls/v17/DocumentLayout.json
Normal file
31
.vs/Test_TabAndDataGridViewControls/v17/DocumentLayout.json
Normal file
@ -0,0 +1,31 @@
|
||||
{
|
||||
"Version": 1,
|
||||
"WorkspaceRootPath": "C:\\CAD\\Git-WorkRepository\\VisualStudio\\_TEST\\Test_TabAndDataGridViewControls.git\\",
|
||||
"Documents": [],
|
||||
"DocumentGroupContainers": [
|
||||
{
|
||||
"Orientation": 0,
|
||||
"VerticalTabListWidth": 256,
|
||||
"DocumentGroups": [
|
||||
{
|
||||
"DockedWidth": 200,
|
||||
"SelectedChildIndex": -1,
|
||||
"Children": [
|
||||
{
|
||||
"$type": "Bookmark",
|
||||
"Name": "ST:128:0:{1fc202d4-d401-403c-9834-5b218574bb67}"
|
||||
},
|
||||
{
|
||||
"$type": "Bookmark",
|
||||
"Name": "ST:129:0:{1fc202d4-d401-403c-9834-5b218574bb67}"
|
||||
},
|
||||
{
|
||||
"$type": "Bookmark",
|
||||
"Name": "ST:0:0:{e506b91c-c606-466a-90a9-123d1d1e12b3}"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
Binary file not shown.
BIN
.vs/Test_TabAndDataGridViewsControls/v17/.suo
Normal file
BIN
.vs/Test_TabAndDataGridViewsControls/v17/.suo
Normal file
Binary file not shown.
65
.vs/Test_TabAndDataGridViewsControls/v17/DocumentLayout.json
Normal file
65
.vs/Test_TabAndDataGridViewsControls/v17/DocumentLayout.json
Normal file
@ -0,0 +1,65 @@
|
||||
{
|
||||
"Version": 1,
|
||||
"WorkspaceRootPath": "C:\\CAD\\Git-WorkRepository\\VisualStudio\\_TEST\\Test_TabAndDataGridViewsControls.git\\",
|
||||
"Documents": [
|
||||
{
|
||||
"AbsoluteMoniker": "D:0:0:{5780CB23-8ABE-4DCE-95FC-BC35F4ECC14B}|Test_TabAndDataGridViewsControls\\Test_TabAndDataGridViewsControls.csproj|c:\\cad\\git-workrepository\\visualstudio\\_test\\test_tabanddatagridviewscontrols.git\\test_tabanddatagridviewscontrols\\form1.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
|
||||
"RelativeMoniker": "D:0:0:{5780CB23-8ABE-4DCE-95FC-BC35F4ECC14B}|Test_TabAndDataGridViewsControls\\Test_TabAndDataGridViewsControls.csproj|solutionrelative:test_tabanddatagridviewscontrols\\form1.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
|
||||
},
|
||||
{
|
||||
"AbsoluteMoniker": "D:0:0:{5780CB23-8ABE-4DCE-95FC-BC35F4ECC14B}|Test_TabAndDataGridViewsControls\\Test_TabAndDataGridViewsControls.csproj|c:\\cad\\git-workrepository\\visualstudio\\_test\\test_tabanddatagridviewscontrols.git\\test_tabanddatagridviewscontrols\\form1.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}|Form",
|
||||
"RelativeMoniker": "D:0:0:{5780CB23-8ABE-4DCE-95FC-BC35F4ECC14B}|Test_TabAndDataGridViewsControls\\Test_TabAndDataGridViewsControls.csproj|solutionrelative:test_tabanddatagridviewscontrols\\form1.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}|Form"
|
||||
}
|
||||
],
|
||||
"DocumentGroupContainers": [
|
||||
{
|
||||
"Orientation": 0,
|
||||
"VerticalTabListWidth": 256,
|
||||
"DocumentGroups": [
|
||||
{
|
||||
"DockedWidth": 200,
|
||||
"SelectedChildIndex": 3,
|
||||
"Children": [
|
||||
{
|
||||
"$type": "Bookmark",
|
||||
"Name": "ST:128:0:{1fc202d4-d401-403c-9834-5b218574bb67}"
|
||||
},
|
||||
{
|
||||
"$type": "Bookmark",
|
||||
"Name": "ST:129:0:{1fc202d4-d401-403c-9834-5b218574bb67}"
|
||||
},
|
||||
{
|
||||
"$type": "Bookmark",
|
||||
"Name": "ST:0:0:{e506b91c-c606-466a-90a9-123d1d1e12b3}"
|
||||
},
|
||||
{
|
||||
"$type": "Document",
|
||||
"DocumentIndex": 0,
|
||||
"Title": "Form1.cs",
|
||||
"DocumentMoniker": "C:\\CAD\\Git-WorkRepository\\VisualStudio\\_TEST\\Test_TabAndDataGridViewsControls.git\\Test_TabAndDataGridViewsControls\\Form1.cs",
|
||||
"RelativeDocumentMoniker": "Test_TabAndDataGridViewsControls\\Form1.cs",
|
||||
"ToolTip": "C:\\CAD\\Git-WorkRepository\\VisualStudio\\_TEST\\Test_TabAndDataGridViewsControls.git\\Test_TabAndDataGridViewsControls\\Form1.cs",
|
||||
"RelativeToolTip": "Test_TabAndDataGridViewsControls\\Form1.cs",
|
||||
"ViewState": "AQIAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
|
||||
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
|
||||
"WhenOpened": "2024-04-18T07:49:44.857Z",
|
||||
"EditorCaption": ""
|
||||
},
|
||||
{
|
||||
"$type": "Document",
|
||||
"DocumentIndex": 1,
|
||||
"Title": "Form1.cs [Entwurf]",
|
||||
"DocumentMoniker": "C:\\CAD\\Git-WorkRepository\\VisualStudio\\_TEST\\Test_TabAndDataGridViewsControls.git\\Test_TabAndDataGridViewsControls\\Form1.cs",
|
||||
"RelativeDocumentMoniker": "Test_TabAndDataGridViewsControls\\Form1.cs",
|
||||
"ToolTip": "C:\\CAD\\Git-WorkRepository\\VisualStudio\\_TEST\\Test_TabAndDataGridViewsControls.git\\Test_TabAndDataGridViewsControls\\Form1.cs [Entwurf]",
|
||||
"RelativeToolTip": "Test_TabAndDataGridViewsControls\\Form1.cs [Entwurf]",
|
||||
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
|
||||
"WhenOpened": "2024-04-18T07:49:41.892Z",
|
||||
"EditorCaption": " [Entwurf]"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
Binary file not shown.
Binary file not shown.
BIN
.vs/Test_TabControlWithDataGridView/v17/.suo
Normal file
BIN
.vs/Test_TabControlWithDataGridView/v17/.suo
Normal file
Binary file not shown.
80
.vs/Test_TabControlWithDataGridView/v17/DocumentLayout.json
Normal file
80
.vs/Test_TabControlWithDataGridView/v17/DocumentLayout.json
Normal file
@ -0,0 +1,80 @@
|
||||
{
|
||||
"Version": 1,
|
||||
"WorkspaceRootPath": "C:\\CAD\\Git-WorkRepository\\VisualStudio\\_TEST\\Test_TabControlWithDataGridView.git\\",
|
||||
"Documents": [
|
||||
{
|
||||
"AbsoluteMoniker": "D:0:0:{5780CB23-8ABE-4DCE-95FC-BC35F4ECC14B}|Test_TabControlWithDataGridView\\Test_TabControlWithDataGridView.csproj|c:\\cad\\git-workrepository\\visualstudio\\_test\\test_tabcontrolwithdatagridview.git\\test_tabcontrolwithdatagridview\\tabcontrolwithdatagridview.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
|
||||
"RelativeMoniker": "D:0:0:{5780CB23-8ABE-4DCE-95FC-BC35F4ECC14B}|Test_TabControlWithDataGridView\\Test_TabControlWithDataGridView.csproj|solutionrelative:test_tabcontrolwithdatagridview\\tabcontrolwithdatagridview.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
|
||||
},
|
||||
{
|
||||
"AbsoluteMoniker": "D:0:0:{5780CB23-8ABE-4DCE-95FC-BC35F4ECC14B}|Test_TabControlWithDataGridView\\Test_TabControlWithDataGridView.csproj|C:\\CAD\\Git-WorkRepository\\VisualStudio\\_TEST\\Test_TabControlWithDataGridView.git\\test_tabcontrolwithdatagridview\\form1.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
|
||||
"RelativeMoniker": "D:0:0:{5780CB23-8ABE-4DCE-95FC-BC35F4ECC14B}|Test_TabControlWithDataGridView\\Test_TabControlWithDataGridView.csproj|solutionrelative:test_tabcontrolwithdatagridview\\form1.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
|
||||
},
|
||||
{
|
||||
"AbsoluteMoniker": "D:0:0:{5780CB23-8ABE-4DCE-95FC-BC35F4ECC14B}|Test_TabControlWithDataGridView\\Test_TabControlWithDataGridView.csproj|C:\\CAD\\Git-WorkRepository\\VisualStudio\\_TEST\\Test_TabControlWithDataGridView.git\\test_tabcontrolwithdatagridview\\form1.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}|Form",
|
||||
"RelativeMoniker": "D:0:0:{5780CB23-8ABE-4DCE-95FC-BC35F4ECC14B}|Test_TabControlWithDataGridView\\Test_TabControlWithDataGridView.csproj|solutionrelative:test_tabcontrolwithdatagridview\\form1.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}|Form"
|
||||
}
|
||||
],
|
||||
"DocumentGroupContainers": [
|
||||
{
|
||||
"Orientation": 0,
|
||||
"VerticalTabListWidth": 256,
|
||||
"DocumentGroups": [
|
||||
{
|
||||
"DockedWidth": 200,
|
||||
"SelectedChildIndex": 3,
|
||||
"Children": [
|
||||
{
|
||||
"$type": "Bookmark",
|
||||
"Name": "ST:128:0:{1fc202d4-d401-403c-9834-5b218574bb67}"
|
||||
},
|
||||
{
|
||||
"$type": "Bookmark",
|
||||
"Name": "ST:129:0:{1fc202d4-d401-403c-9834-5b218574bb67}"
|
||||
},
|
||||
{
|
||||
"$type": "Bookmark",
|
||||
"Name": "ST:0:0:{e506b91c-c606-466a-90a9-123d1d1e12b3}"
|
||||
},
|
||||
{
|
||||
"$type": "Document",
|
||||
"DocumentIndex": 0,
|
||||
"Title": "TabControlWithDataGridView.cs",
|
||||
"DocumentMoniker": "C:\\CAD\\Git-WorkRepository\\VisualStudio\\_TEST\\Test_TabControlWithDataGridView.git\\Test_TabControlWithDataGridView\\TabControlWithDataGridView.cs",
|
||||
"RelativeDocumentMoniker": "Test_TabControlWithDataGridView\\TabControlWithDataGridView.cs",
|
||||
"ToolTip": "C:\\CAD\\Git-WorkRepository\\VisualStudio\\_TEST\\Test_TabControlWithDataGridView.git\\Test_TabControlWithDataGridView\\TabControlWithDataGridView.cs",
|
||||
"RelativeToolTip": "Test_TabControlWithDataGridView\\TabControlWithDataGridView.cs",
|
||||
"ViewState": "AQIAAAAAAAAAAAAAAAAAAOgAAAAIAAAA",
|
||||
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
|
||||
"WhenOpened": "2024-04-18T08:39:34.558Z",
|
||||
"EditorCaption": ""
|
||||
},
|
||||
{
|
||||
"$type": "Document",
|
||||
"DocumentIndex": 1,
|
||||
"Title": "Form1.cs",
|
||||
"DocumentMoniker": "C:\\CAD\\Git-WorkRepository\\VisualStudio\\_TEST\\Test_TabControlWithDataGridView.git\\Test_TabControlWithDataGridView\\Form1.cs",
|
||||
"RelativeDocumentMoniker": "Test_TabControlWithDataGridView\\Form1.cs",
|
||||
"ToolTip": "C:\\CAD\\Git-WorkRepository\\VisualStudio\\_TEST\\Test_TabControlWithDataGridView.git\\Test_TabControlWithDataGridView\\Form1.cs",
|
||||
"RelativeToolTip": "Test_TabControlWithDataGridView\\Form1.cs",
|
||||
"ViewState": "AQIAAAAAAAAAAAAAAAAAAHwAAAA3AAAA",
|
||||
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
|
||||
"WhenOpened": "2024-04-18T08:39:55.195Z"
|
||||
},
|
||||
{
|
||||
"$type": "Document",
|
||||
"DocumentIndex": 2,
|
||||
"Title": "Form1.cs [Entwurf]",
|
||||
"DocumentMoniker": "C:\\CAD\\Git-WorkRepository\\VisualStudio\\_TEST\\Test_TabControlWithDataGridView.git\\Test_TabControlWithDataGridView\\Form1.cs",
|
||||
"RelativeDocumentMoniker": "Test_TabControlWithDataGridView\\Form1.cs",
|
||||
"ToolTip": "C:\\CAD\\Git-WorkRepository\\VisualStudio\\_TEST\\Test_TabControlWithDataGridView.git\\Test_TabControlWithDataGridView\\Form1.cs [Entwurf]",
|
||||
"RelativeToolTip": "Test_TabControlWithDataGridView\\Form1.cs [Entwurf]",
|
||||
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
|
||||
"WhenOpened": "2024-04-18T08:39:51.912Z"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
Binary file not shown.
BIN
.vs/Test_TabControlsAndDataGridViews.git/v17/.suo
Normal file
BIN
.vs/Test_TabControlsAndDataGridViews.git/v17/.suo
Normal file
Binary file not shown.
@ -0,0 +1,65 @@
|
||||
{
|
||||
"Version": 1,
|
||||
"WorkspaceRootPath": "C:\\CAD\\Git-WorkRepository\\VisualStudio\\_TEST\\Test_TabControlsAndDataGridViews.git\\",
|
||||
"Documents": [
|
||||
{
|
||||
"AbsoluteMoniker": "D:0:0:{5780CB23-8ABE-4DCE-95FC-BC35F4ECC14B}|Test_TabControlsAndDataGridViews\\Test_TabControlsAndDataGridViews.csproj|c:\\cad\\git-workrepository\\visualstudio\\_test\\test_tabcontrolsanddatagridviews.git\\test_tabcontrolsanddatagridviews\\form1.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
|
||||
"RelativeMoniker": "D:0:0:{5780CB23-8ABE-4DCE-95FC-BC35F4ECC14B}|Test_TabControlsAndDataGridViews\\Test_TabControlsAndDataGridViews.csproj|solutionrelative:test_tabcontrolsanddatagridviews\\form1.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
|
||||
},
|
||||
{
|
||||
"AbsoluteMoniker": "D:0:0:{5780CB23-8ABE-4DCE-95FC-BC35F4ECC14B}|Test_TabControlsAndDataGridViews\\Test_TabControlsAndDataGridViews.csproj|C:\\CAD\\Git-WorkRepository\\VisualStudio\\_TEST\\Test_TabControlsAndDataGridViews.git\\test_tabcontrolsanddatagridviews\\form1.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}|Form",
|
||||
"RelativeMoniker": "D:0:0:{5780CB23-8ABE-4DCE-95FC-BC35F4ECC14B}|Test_TabControlsAndDataGridViews\\Test_TabControlsAndDataGridViews.csproj|solutionrelative:test_tabcontrolsanddatagridviews\\form1.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}|Form"
|
||||
}
|
||||
],
|
||||
"DocumentGroupContainers": [
|
||||
{
|
||||
"Orientation": 0,
|
||||
"VerticalTabListWidth": 256,
|
||||
"DocumentGroups": [
|
||||
{
|
||||
"DockedWidth": 200,
|
||||
"SelectedChildIndex": 3,
|
||||
"Children": [
|
||||
{
|
||||
"$type": "Bookmark",
|
||||
"Name": "ST:128:0:{1fc202d4-d401-403c-9834-5b218574bb67}"
|
||||
},
|
||||
{
|
||||
"$type": "Bookmark",
|
||||
"Name": "ST:129:0:{1fc202d4-d401-403c-9834-5b218574bb67}"
|
||||
},
|
||||
{
|
||||
"$type": "Bookmark",
|
||||
"Name": "ST:0:0:{e506b91c-c606-466a-90a9-123d1d1e12b3}"
|
||||
},
|
||||
{
|
||||
"$type": "Document",
|
||||
"DocumentIndex": 0,
|
||||
"Title": "Form1.cs",
|
||||
"DocumentMoniker": "C:\\CAD\\Git-WorkRepository\\VisualStudio\\_TEST\\Test_TabControlsAndDataGridViews.git\\Test_TabControlsAndDataGridViews\\Form1.cs",
|
||||
"RelativeDocumentMoniker": "Test_TabControlsAndDataGridViews\\Form1.cs",
|
||||
"ToolTip": "C:\\CAD\\Git-WorkRepository\\VisualStudio\\_TEST\\Test_TabControlsAndDataGridViews.git\\Test_TabControlsAndDataGridViews\\Form1.cs",
|
||||
"RelativeToolTip": "Test_TabControlsAndDataGridViews\\Form1.cs",
|
||||
"ViewState": "AQIAABQAAAAAAAAAAAAtwIIAAABIAAAA",
|
||||
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
|
||||
"WhenOpened": "2024-04-16T12:52:38.812Z",
|
||||
"EditorCaption": ""
|
||||
},
|
||||
{
|
||||
"$type": "Document",
|
||||
"DocumentIndex": 1,
|
||||
"Title": "Form1.cs [Entwurf]",
|
||||
"DocumentMoniker": "C:\\CAD\\Git-WorkRepository\\VisualStudio\\_TEST\\Test_TabControlsAndDataGridViews.git\\Test_TabControlsAndDataGridViews\\Form1.cs",
|
||||
"RelativeDocumentMoniker": "Test_TabControlsAndDataGridViews\\Form1.cs",
|
||||
"ToolTip": "C:\\CAD\\Git-WorkRepository\\VisualStudio\\_TEST\\Test_TabControlsAndDataGridViews.git\\Test_TabControlsAndDataGridViews\\Form1.cs [Entwurf]",
|
||||
"RelativeToolTip": "Test_TabControlsAndDataGridViews\\Form1.cs [Entwurf]",
|
||||
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
|
||||
"WhenOpened": "2024-04-16T12:52:35.365Z",
|
||||
"EditorCaption": " [Entwurf]"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
25
Test_TabControlWithDataGridView.sln
Normal file
25
Test_TabControlWithDataGridView.sln
Normal file
@ -0,0 +1,25 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 17
|
||||
VisualStudioVersion = 17.9.34723.18
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Test_TabControlWithDataGridView", "Test_TabControlWithDataGridView\Test_TabControlWithDataGridView.csproj", "{5780CB23-8ABE-4DCE-95FC-BC35F4ECC14B}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{5780CB23-8ABE-4DCE-95FC-BC35F4ECC14B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{5780CB23-8ABE-4DCE-95FC-BC35F4ECC14B}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{5780CB23-8ABE-4DCE-95FC-BC35F4ECC14B}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{5780CB23-8ABE-4DCE-95FC-BC35F4ECC14B}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {EE0AAE3B-24EC-4C45-B100-83F466A368BB}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
@ -0,0 +1 @@
|
||||
{"RootPath":"C:\\CAD\\Git-WorkRepository\\VisualStudio\\_TEST\\Test_TabControlWithDataGridView.git\\Test_TabControlWithDataGridView","ProjectFileName":"Test_TabControlWithDataGridView.csproj","Configuration":"Debug|AnyCPU","FrameworkPath":"","Sources":[{"SourceFile":"Form1.cs"},{"SourceFile":"Form1.Designer.cs"},{"SourceFile":"Program.cs"},{"SourceFile":"Properties\\AssemblyInfo.cs"},{"SourceFile":"Properties\\Resources.Designer.cs"},{"SourceFile":"Properties\\Settings.Designer.cs"},{"SourceFile":"obj\\Debug\\.NETFramework,Version=v4.7.2.AssemblyAttributes.cs"}],"References":[{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.7.2\\Microsoft.CSharp.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.7.2\\mscorlib.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.7.2\\System.Core.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.7.2\\System.Data.DataSetExtensions.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.7.2\\System.Data.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.7.2\\System.Deployment.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.7.2\\System.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.7.2\\System.Drawing.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.7.2\\System.Net.Http.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.7.2\\System.Windows.Forms.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.7.2\\System.Xml.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.7.2\\System.Xml.Linq.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""}],"Analyzers":[],"Outputs":[{"OutputItemFullPath":"C:\\CAD\\Git-WorkRepository\\VisualStudio\\_TEST\\Test_TabControlWithDataGridView.git\\Test_TabControlWithDataGridView\\bin\\Debug\\Test_TabControlWithDataGridView.exe","OutputItemRelativePath":"Test_TabControlWithDataGridView.exe"},{"OutputItemFullPath":"C:\\CAD\\Git-WorkRepository\\VisualStudio\\_TEST\\Test_TabControlWithDataGridView.git\\Test_TabControlWithDataGridView\\bin\\Debug\\Test_TabControlWithDataGridView.pdb","OutputItemRelativePath":"Test_TabControlWithDataGridView.pdb"}],"CopyToOutputEntries":[]}
|
||||
6
Test_TabControlWithDataGridView/App.config
Normal file
6
Test_TabControlWithDataGridView/App.config
Normal file
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<configuration>
|
||||
<startup>
|
||||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
|
||||
</startup>
|
||||
</configuration>
|
||||
114
Test_TabControlWithDataGridView/Form1.Designer.cs
generated
Normal file
114
Test_TabControlWithDataGridView/Form1.Designer.cs
generated
Normal file
@ -0,0 +1,114 @@
|
||||
namespace Test_TabControlWithDataGridView
|
||||
{
|
||||
partial class Form1
|
||||
{
|
||||
/// <summary>
|
||||
/// Erforderliche Designervariable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Verwendete Ressourcen bereinigen.
|
||||
/// </summary>
|
||||
/// <param name="disposing">True, wenn verwaltete Ressourcen gelöscht werden sollen; andernfalls False.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Vom Windows Form-Designer generierter Code
|
||||
|
||||
/// <summary>
|
||||
/// Erforderliche Methode für die Designerunterstützung.
|
||||
/// Der Inhalt der Methode darf nicht mit dem Code-Editor geändert werden.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.buttonAddTab = new System.Windows.Forms.Button();
|
||||
this.buttonRemoveTab = new System.Windows.Forms.Button();
|
||||
this.buttonRemoveSelectedTab = new System.Windows.Forms.Button();
|
||||
this.buttonMoveTabToLeft = new System.Windows.Forms.Button();
|
||||
this.buttonMoveTabToRight = new System.Windows.Forms.Button();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// buttonAddTab
|
||||
//
|
||||
this.buttonAddTab.Location = new System.Drawing.Point(13, 415);
|
||||
this.buttonAddTab.Name = "buttonAddTab";
|
||||
this.buttonAddTab.Size = new System.Drawing.Size(129, 23);
|
||||
this.buttonAddTab.TabIndex = 0;
|
||||
this.buttonAddTab.Text = "Add Tab";
|
||||
this.buttonAddTab.UseVisualStyleBackColor = true;
|
||||
this.buttonAddTab.Click += new System.EventHandler(this.buttonAddTab_Click);
|
||||
//
|
||||
// buttonRemoveTab
|
||||
//
|
||||
this.buttonRemoveTab.Location = new System.Drawing.Point(174, 415);
|
||||
this.buttonRemoveTab.Name = "buttonRemoveTab";
|
||||
this.buttonRemoveTab.Size = new System.Drawing.Size(129, 23);
|
||||
this.buttonRemoveTab.TabIndex = 1;
|
||||
this.buttonRemoveTab.Text = "Remove Tab";
|
||||
this.buttonRemoveTab.UseVisualStyleBackColor = true;
|
||||
this.buttonRemoveTab.Click += new System.EventHandler(this.buttonRemoveTab_Click);
|
||||
//
|
||||
// buttonRemoveSelectedTab
|
||||
//
|
||||
this.buttonRemoveSelectedTab.Location = new System.Drawing.Point(335, 415);
|
||||
this.buttonRemoveSelectedTab.Name = "buttonRemoveSelectedTab";
|
||||
this.buttonRemoveSelectedTab.Size = new System.Drawing.Size(129, 23);
|
||||
this.buttonRemoveSelectedTab.TabIndex = 2;
|
||||
this.buttonRemoveSelectedTab.Text = "Remove Selected Tab";
|
||||
this.buttonRemoveSelectedTab.UseVisualStyleBackColor = true;
|
||||
this.buttonRemoveSelectedTab.Click += new System.EventHandler(this.buttonRemoveSelectedTab_Click);
|
||||
//
|
||||
// buttonMoveTabToLeft
|
||||
//
|
||||
this.buttonMoveTabToLeft.Location = new System.Drawing.Point(496, 415);
|
||||
this.buttonMoveTabToLeft.Name = "buttonMoveTabToLeft";
|
||||
this.buttonMoveTabToLeft.Size = new System.Drawing.Size(129, 23);
|
||||
this.buttonMoveTabToLeft.TabIndex = 3;
|
||||
this.buttonMoveTabToLeft.Text = "Tab nach links";
|
||||
this.buttonMoveTabToLeft.UseVisualStyleBackColor = true;
|
||||
this.buttonMoveTabToLeft.Click += new System.EventHandler(this.buttonMoveTabToLeft_Click);
|
||||
//
|
||||
// buttonMoveTabToRight
|
||||
//
|
||||
this.buttonMoveTabToRight.Location = new System.Drawing.Point(657, 415);
|
||||
this.buttonMoveTabToRight.Name = "buttonMoveTabToRight";
|
||||
this.buttonMoveTabToRight.Size = new System.Drawing.Size(129, 23);
|
||||
this.buttonMoveTabToRight.TabIndex = 4;
|
||||
this.buttonMoveTabToRight.Text = "Tab nach rechts";
|
||||
this.buttonMoveTabToRight.UseVisualStyleBackColor = true;
|
||||
this.buttonMoveTabToRight.Click += new System.EventHandler(this.buttonMoveTabToRight_Click);
|
||||
//
|
||||
// Form1
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(800, 450);
|
||||
this.Controls.Add(this.buttonMoveTabToRight);
|
||||
this.Controls.Add(this.buttonMoveTabToLeft);
|
||||
this.Controls.Add(this.buttonRemoveSelectedTab);
|
||||
this.Controls.Add(this.buttonRemoveTab);
|
||||
this.Controls.Add(this.buttonAddTab);
|
||||
this.Name = "Form1";
|
||||
this.Text = "Form1";
|
||||
this.Load += new System.EventHandler(this.Form1_Load);
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.Button buttonAddTab;
|
||||
private System.Windows.Forms.Button buttonRemoveTab;
|
||||
private System.Windows.Forms.Button buttonRemoveSelectedTab;
|
||||
private System.Windows.Forms.Button buttonMoveTabToLeft;
|
||||
private System.Windows.Forms.Button buttonMoveTabToRight;
|
||||
}
|
||||
}
|
||||
|
||||
166
Test_TabControlWithDataGridView/Form1.cs
Normal file
166
Test_TabControlWithDataGridView/Form1.cs
Normal file
@ -0,0 +1,166 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Drawing.Drawing2D;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
using static System.Net.WebRequestMethods;
|
||||
using static System.Windows.Forms.VisualStyles.VisualStyleElement;
|
||||
using static System.Windows.Forms.VisualStyles.VisualStyleElement.ProgressBar;
|
||||
|
||||
namespace Test_TabControlWithDataGridView
|
||||
{
|
||||
public partial class Form1 : Form
|
||||
{
|
||||
#region Version und Copyright
|
||||
// Version und Copyright
|
||||
string programName = Path.GetFileNameWithoutExtension(System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase); //Den Programmnamen auslesen
|
||||
string programVersion = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString();
|
||||
static object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyCopyrightAttribute), false);
|
||||
string copyright = GenerateCopyright();
|
||||
string icon = Application.StartupPath + "\\Info.bmp";
|
||||
|
||||
//Assembly Datum und Zeit
|
||||
static DateTime value = AssemblyDateTime();
|
||||
string date = value.ToShortDateString();
|
||||
string time = value.ToLongTimeString();
|
||||
|
||||
private static DateTime AssemblyDateTime()
|
||||
{
|
||||
var version = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version;
|
||||
var buildDateTime = new DateTime(2000, 1, 1).Add(new TimeSpan(TimeSpan.TicksPerDay * version.Build + TimeSpan.TicksPerSecond * 2 * version.Revision));
|
||||
//Tage seit dem 1. Januar 2000 und Sekunden seit Mitternacht, (multiplizier mit 2 ergibt das Original)
|
||||
return buildDateTime;
|
||||
}
|
||||
|
||||
private static string CurrentYear()
|
||||
{
|
||||
DateTime dtn = DateTime.Now;
|
||||
return dtn.Year.ToString();
|
||||
}
|
||||
|
||||
private static string StartYear()
|
||||
{
|
||||
string startYear = "";
|
||||
if (((AssemblyCopyrightAttribute)attributes[0]).Copyright.Contains("Copyright © "))
|
||||
{
|
||||
startYear = ((AssemblyCopyrightAttribute)attributes[0]).Copyright.Replace("Copyright © ", "");
|
||||
while (startYear.StartsWith(" "))
|
||||
{
|
||||
startYear = startYear.Remove(0, 1);
|
||||
}
|
||||
|
||||
if (startYear.Contains("-"))
|
||||
{
|
||||
startYear = startYear.Remove(startYear.IndexOf("-"));
|
||||
}
|
||||
else
|
||||
{
|
||||
startYear = startYear.Remove(startYear.IndexOf(" "));
|
||||
}
|
||||
return startYear;
|
||||
}
|
||||
else
|
||||
{
|
||||
DateTime dtn = DateTime.Now;
|
||||
return dtn.Year.ToString();
|
||||
}
|
||||
}
|
||||
|
||||
private static string GenerateCopyright()
|
||||
{
|
||||
string startYear = StartYear();
|
||||
string currentYear = CurrentYear();
|
||||
|
||||
if (startYear == currentYear)
|
||||
{
|
||||
return ((AssemblyCopyrightAttribute)attributes[0]).Copyright;
|
||||
}
|
||||
else
|
||||
{
|
||||
string temp = ((AssemblyCopyrightAttribute)attributes[0]).Copyright;
|
||||
string start = temp.Remove(temp.IndexOf(startYear) - 1);
|
||||
string end = (temp.Remove(0, temp.IndexOf(" by")));
|
||||
|
||||
return String.Concat(start, " ", startYear, "-", currentYear, end);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Programm-Info
|
||||
/// <summary>
|
||||
/// Contains the name of the program file
|
||||
/// </summary>
|
||||
public static string ProgramName { set; get; }
|
||||
|
||||
/// <summary>
|
||||
/// Contains the version of the program file
|
||||
/// </summary>
|
||||
public static string ProgramVersion { set; get; }
|
||||
|
||||
/// <summary>
|
||||
/// Contains the copyright notice
|
||||
/// </summary>
|
||||
public static string Copyright { set; get; }
|
||||
|
||||
private void SetProgramInfo()
|
||||
{
|
||||
//Name, Version und Copyright setzen
|
||||
ProgramName = programName;
|
||||
ProgramVersion = programVersion;
|
||||
Copyright = copyright;
|
||||
}
|
||||
#endregion
|
||||
public Form1()
|
||||
{
|
||||
SetProgramInfo();
|
||||
InitializeComponent();
|
||||
|
||||
tcwdgv.TabName = "CD "; // Sets the name which is displayd on a tab
|
||||
}
|
||||
|
||||
private void Form1_Load(object sender, EventArgs e)
|
||||
{
|
||||
tcwdgv.TabControlWidth = 700; // The 'TabControl' width
|
||||
tcwdgv.TabControlHeight = 400; // The 'TabControl' hight
|
||||
//tcwdgv.DataGridViewBackColor = Color.White; // The 'DataGridView' back color
|
||||
//tcwdgv.DataGridViewForeColor = Color.Black // The 'DataGridView' fore color
|
||||
//tcwdgv.DataGridViewFont = new Font("Microsoft San Serif", 8); // The 'DataGridView' font
|
||||
tcwdgv.CreatingTabControl(Controls); // Create a 'TabControl' and a 'TabPage' with a 'DataGridView'
|
||||
tcwdgv.DataPath = "C:\\CAD\\Git-WorkRepository\\VisualStudio\\_TEST\\Test_TabControlsAndDataGridViews.git\\Daten";
|
||||
}
|
||||
|
||||
TabControlWithDataGridView tcwdgv = new TabControlWithDataGridView();
|
||||
|
||||
private void buttonAddTab_Click(object sender, EventArgs e)
|
||||
{
|
||||
tcwdgv.AddTabPageWithDataGridView(); // Add an additional 'TabPage' with a 'DataGridView'
|
||||
}
|
||||
|
||||
private void buttonRemoveTab_Click(object sender, EventArgs e)
|
||||
{
|
||||
tcwdgv.RemoveTabPage(); // Removes the last 'TabPage'
|
||||
}
|
||||
|
||||
private void buttonRemoveSelectedTab_Click(object sender, EventArgs e)
|
||||
{
|
||||
tcwdgv.RemoveSelectedTabPage(); // Removes the selected 'TabPage' and renumber/rename the others
|
||||
}
|
||||
|
||||
private void buttonMoveTabToLeft_Click(object sender, EventArgs e)
|
||||
{
|
||||
tcwdgv.MoveTabPageToLeft(); // Moves the selected 'TabPage' to the left and renumber/rename the others
|
||||
}
|
||||
|
||||
private void buttonMoveTabToRight_Click(object sender, EventArgs e)
|
||||
{
|
||||
tcwdgv.MoveTabPageToRight(); // Moves the selected 'TabPage' to the rigth and renumber/rename the others
|
||||
}
|
||||
}
|
||||
}
|
||||
120
Test_TabControlWithDataGridView/Form1.resx
Normal file
120
Test_TabControlWithDataGridView/Form1.resx
Normal file
@ -0,0 +1,120 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
||||
22
Test_TabControlWithDataGridView/Program.cs
Normal file
22
Test_TabControlWithDataGridView/Program.cs
Normal file
@ -0,0 +1,22 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace Test_TabControlWithDataGridView
|
||||
{
|
||||
internal static class Program
|
||||
{
|
||||
/// <summary>
|
||||
/// Der Haupteinstiegspunkt für die Anwendung.
|
||||
/// </summary>
|
||||
[STAThread]
|
||||
static void Main()
|
||||
{
|
||||
Application.EnableVisualStyles();
|
||||
Application.SetCompatibleTextRenderingDefault(false);
|
||||
Application.Run(new Form1());
|
||||
}
|
||||
}
|
||||
}
|
||||
36
Test_TabControlWithDataGridView/Properties/AssemblyInfo.cs
Normal file
36
Test_TabControlWithDataGridView/Properties/AssemblyInfo.cs
Normal file
@ -0,0 +1,36 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// Allgemeine Informationen über eine Assembly werden über die folgenden
|
||||
// Attribute gesteuert. Ändern Sie diese Attributwerte, um die Informationen zu ändern,
|
||||
// die einer Assembly zugeordnet sind.
|
||||
[assembly: AssemblyTitle("Test_TabControlWithDataGridView")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("Test_TabControlWithDataGridView")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2024 by Eugen Höglinger")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// Durch Festlegen von ComVisible auf FALSE werden die Typen in dieser Assembly
|
||||
// für COM-Komponenten unsichtbar. Wenn Sie auf einen Typ in dieser Assembly von
|
||||
// COM aus zugreifen müssen, sollten Sie das ComVisible-Attribut für diesen Typ auf "True" festlegen.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// Die folgende GUID bestimmt die ID der Typbibliothek, wenn dieses Projekt für COM verfügbar gemacht wird
|
||||
[assembly: Guid("5780cb23-8abe-4dce-95fc-bc35f4ecc14b")]
|
||||
|
||||
// Versionsinformationen für eine Assembly bestehen aus den folgenden vier Werten:
|
||||
//
|
||||
// Hauptversion
|
||||
// Nebenversion
|
||||
// Buildnummer
|
||||
// Revision
|
||||
//
|
||||
// Sie können alle Werte angeben oder Standardwerte für die Build- und Revisionsnummern verwenden,
|
||||
// indem Sie "*" wie unten gezeigt eingeben:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.*")]
|
||||
//[assembly: AssemblyFileVersion("1.0.0.0")] //Wenn auskommentiert, dann gleich wie AssemblyVersion!
|
||||
71
Test_TabControlWithDataGridView/Properties/Resources.Designer.cs
generated
Normal file
71
Test_TabControlWithDataGridView/Properties/Resources.Designer.cs
generated
Normal file
@ -0,0 +1,71 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// Dieser Code wurde von einem Tool generiert.
|
||||
// Laufzeitversion: 4.0.30319.42000
|
||||
//
|
||||
// Änderungen an dieser Datei können fehlerhaftes Verhalten verursachen und gehen verloren, wenn
|
||||
// der Code neu generiert wird.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace Test_TabControlWithDataGridView.Properties
|
||||
{
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Eine stark typisierte Ressourcenklasse zum Suchen von lokalisierten Zeichenfolgen usw.
|
||||
/// </summary>
|
||||
// Diese Klasse wurde von der StronglyTypedResourceBuilder-Klasse
|
||||
// über ein Tool wie ResGen oder Visual Studio automatisch generiert.
|
||||
// Um einen Member hinzuzufügen oder zu entfernen, bearbeiten Sie die .ResX-Datei und führen dann ResGen
|
||||
// mit der Option /str erneut aus, oder erstellen Sie Ihr VS-Projekt neu.
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
internal class Resources
|
||||
{
|
||||
|
||||
private static global::System.Resources.ResourceManager resourceMan;
|
||||
|
||||
private static global::System.Globalization.CultureInfo resourceCulture;
|
||||
|
||||
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
||||
internal Resources()
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gibt die zwischengespeicherte ResourceManager-Instanz zurück, die von dieser Klasse verwendet wird.
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Resources.ResourceManager ResourceManager
|
||||
{
|
||||
get
|
||||
{
|
||||
if ((resourceMan == null))
|
||||
{
|
||||
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Test_TabControsAndDataGridViews.Properties.Resources", typeof(Resources).Assembly);
|
||||
resourceMan = temp;
|
||||
}
|
||||
return resourceMan;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Überschreibt die CurrentUICulture-Eigenschaft des aktuellen Threads für alle
|
||||
/// Ressourcenlookups, die diese stark typisierte Ressourcenklasse verwenden.
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Globalization.CultureInfo Culture
|
||||
{
|
||||
get
|
||||
{
|
||||
return resourceCulture;
|
||||
}
|
||||
set
|
||||
{
|
||||
resourceCulture = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
117
Test_TabControlWithDataGridView/Properties/Resources.resx
Normal file
117
Test_TabControlWithDataGridView/Properties/Resources.resx
Normal file
@ -0,0 +1,117 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
||||
30
Test_TabControlWithDataGridView/Properties/Settings.Designer.cs
generated
Normal file
30
Test_TabControlWithDataGridView/Properties/Settings.Designer.cs
generated
Normal file
@ -0,0 +1,30 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.42000
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace Test_TabControlWithDataGridView.Properties
|
||||
{
|
||||
|
||||
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
|
||||
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
|
||||
{
|
||||
|
||||
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
|
||||
|
||||
public static Settings Default
|
||||
{
|
||||
get
|
||||
{
|
||||
return defaultInstance;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,7 @@
|
||||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
|
||||
<Profiles>
|
||||
<Profile Name="(Default)" />
|
||||
</Profiles>
|
||||
<Settings />
|
||||
</SettingsFile>
|
||||
374
Test_TabControlWithDataGridView/TabControlWithDataGridView.cs
Normal file
374
Test_TabControlWithDataGridView/TabControlWithDataGridView.cs
Normal file
@ -0,0 +1,374 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace Test_TabControlWithDataGridView
|
||||
{
|
||||
internal class TabControlWithDataGridView
|
||||
{
|
||||
//TODO: Version einfügen
|
||||
|
||||
/// <summary>
|
||||
/// Set or get the Data directory path
|
||||
/// </summary>
|
||||
public string DataPath { get; set; } // Data directory
|
||||
|
||||
/// <summary>
|
||||
/// Set or get the 'Tab' name
|
||||
/// </summary>
|
||||
public string TabName { get; set; } // Basic tab name (name without number)
|
||||
|
||||
/// <summary>
|
||||
/// Set or get the current 'TabControl'
|
||||
/// </summary>
|
||||
public TabControl DynamicTabControl { set; get; } // Current TabControl
|
||||
|
||||
/// <summary>
|
||||
/// Set or get the 'TabControl' width
|
||||
/// </summary>
|
||||
public int TabControlWidth { set; get; } // The 'TabControl' width
|
||||
|
||||
/// <summary>
|
||||
/// Set or get the 'TabControl' hight
|
||||
/// </summary>
|
||||
public int TabControlHeight { set; get; } // The 'TabControl' hight
|
||||
|
||||
/// <summary>
|
||||
/// Set or get the 'DataGridView' back color
|
||||
/// </summary>
|
||||
public Color DataGridViewBackColor { set; get; } // The 'DataGridView' back color
|
||||
|
||||
/// <summary>
|
||||
/// Set or get the 'DataGridView' fore color
|
||||
/// </summary>
|
||||
public Color DataGridViewForeColor { set; get; } // The 'DataGridView' fore color
|
||||
|
||||
/// <summary>
|
||||
/// Set or get the 'DataGridView' font
|
||||
/// </summary>
|
||||
public Font DataGridViewFont { set; get; } // The 'DataGridView' font
|
||||
|
||||
private Control.ControlCollection Controls { get; set; }
|
||||
private List<string[]> DataGridViewValues { get; set; }
|
||||
private List<string[]> PreviousDataGridViewValues { get; set; }
|
||||
private List<string[]> NextDataGridViewValues { get; set; }
|
||||
|
||||
int maxNumbersOfTabPages = 12;
|
||||
|
||||
#region Public Methodes
|
||||
/// <summary>
|
||||
/// Creates a new 'TabControl' and set its properties
|
||||
/// </summary>
|
||||
/// <param name="controls">A form control</param>
|
||||
public void CreatingTabControl(Control.ControlCollection controls)
|
||||
{
|
||||
TabControl dynamicTabControl = new TabControl();
|
||||
dynamicTabControl.Name = "DynamicTabControl";
|
||||
dynamicTabControl.Width = TabControlWidth;
|
||||
dynamicTabControl.Height = TabControlHeight;
|
||||
dynamicTabControl.BackColor = DataGridViewBackColor;
|
||||
dynamicTabControl.ForeColor = DataGridViewForeColor;
|
||||
dynamicTabControl.Font = DataGridViewFont;
|
||||
controls.Add(dynamicTabControl); // Add TabControl to Form
|
||||
|
||||
// Speichert das Control
|
||||
Controls = controls;
|
||||
|
||||
// Speichert das aktuelle TabControl
|
||||
DynamicTabControl = dynamicTabControl;
|
||||
|
||||
// Add TabPage with DataGridView to TabControl
|
||||
AddTabPageWithDataGridView();
|
||||
|
||||
//// Speichert das aktuelle TabControl
|
||||
//DynamicTabControl = dynamicTabControl;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Add a 'TabPage' with a 'DataGridView'
|
||||
/// </summary>
|
||||
public void AddTabPageWithDataGridView()
|
||||
{
|
||||
int numberOfTabs = DynamicTabControl.TabCount;
|
||||
|
||||
if (numberOfTabs < maxNumbersOfTabPages)
|
||||
{
|
||||
AddTabPage(DynamicTabControl, numberOfTabs); // Add TabPage to TabControl
|
||||
AddDataGridViewTable(Controls, DynamicTabControl, numberOfTabs); // Add a separate DataGridView for each TabPage
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Removes the last 'TabPage'
|
||||
/// </summary>
|
||||
public void RemoveTabPage()
|
||||
{
|
||||
// Removes the last 'TabControl'
|
||||
|
||||
// There must be at least 2 'TabControl', so that one can be removed
|
||||
if (DynamicTabControl.TabCount > 1)
|
||||
{
|
||||
TabPage tab = DynamicTabControl.TabPages[DynamicTabControl.TabCount - 1];
|
||||
|
||||
// There must be at least 2 'TabControl', so that one can be removed
|
||||
if (DynamicTabControl.TabCount > 1)
|
||||
{
|
||||
// As long as the 'TabControl' (DataGridView) contains data, it cannot be deleted
|
||||
if (IsDataGridViewEmpty(tab.Controls.OfType<DataGridView>().FirstOrDefault()))
|
||||
{
|
||||
DynamicTabControl.TabPages.Remove(tab);
|
||||
}
|
||||
else
|
||||
{
|
||||
MessageBox.Show("Löschen nicht möglich!\n\r\n\rTab kann nicht gelöscht werden,\n\rweil die Tabelle noch Daten enthälten!\n\r");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Removes the selectet 'TabPage'
|
||||
/// </summary>
|
||||
public void RemoveSelectedTabPage()
|
||||
{
|
||||
// Removes the selected 'TabControl'
|
||||
|
||||
// There must be at least 2 'TabControl', so that one can be removed
|
||||
if (DynamicTabControl.TabCount > 1)
|
||||
{
|
||||
// As long as the 'TabControl' (DataGridView) contains data, it cannot be deleted
|
||||
if (IsDataGridViewEmpty(DynamicTabControl.SelectedTab.Controls.OfType<DataGridView>().FirstOrDefault()))
|
||||
{
|
||||
DynamicTabControl.TabPages.Remove(DynamicTabControl.SelectedTab);
|
||||
}
|
||||
else
|
||||
{
|
||||
MessageBox.Show("Löschen nicht möglich!\n\r\n\rTab kann nicht gelöscht werden,\n\rweil die Tabelle noch Daten enthälten!\n\r");
|
||||
}
|
||||
|
||||
RenameTabs(DynamicTabControl); // Rename all 'TabControl' so that they are numbered consecutively again
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Moves the selected 'TabPage' to the left and renumber/rename the others
|
||||
/// </summary>
|
||||
public void MoveTabPageToLeft()
|
||||
{
|
||||
// Moves the selected 'TabPage' to the left and renumber/rename the others
|
||||
|
||||
string folder1 = "";
|
||||
string folder2 = "";
|
||||
|
||||
int index = DynamicTabControl.SelectedIndex; // The index of the selected 'TabPage'
|
||||
DataGridView dataGridView = DynamicTabControl.SelectedTab.Controls.OfType<DataGridView>().FirstOrDefault();
|
||||
|
||||
// If there is more than one 'TabPage', then move to the left
|
||||
if (index > 0)
|
||||
{
|
||||
DataGridViewValues = DetermineDataGridViewValues(DynamicTabControl, dataGridView); // Write all values from the selected dataGridView to a list
|
||||
|
||||
folder1 = DynamicTabControl.SelectedTab.Text; // Set the name of the current foder
|
||||
|
||||
TabControl PreviousTabControl = DeterminePreviousControl(this.DynamicTabControl); // Change the control to the previous 'TabPage'
|
||||
|
||||
folder2 = DynamicTabControl.SelectedTab.Text; // Set the name of the previous foder
|
||||
|
||||
DataGridView previousDataGridView = PreviousTabControl.SelectedTab.Controls.OfType<DataGridView>().FirstOrDefault(); // Chang the control to the previous dataGridView
|
||||
PreviousDataGridViewValues = DetermineDataGridViewValues(PreviousTabControl, previousDataGridView); // Write all values from the previous dataGridView to a list
|
||||
|
||||
WriteDataGridView(previousDataGridView, DataGridViewValues); // Write the data from the selected dataGridView back to the previous dataGridView
|
||||
|
||||
DynamicTabControl.SelectedIndex = index; //Set the selected 'TabPage' as current 'TabPage'
|
||||
WriteDataGridView(dataGridView, PreviousDataGridViewValues); // Write the data from the previous dataGridView back to the selected dataGridView
|
||||
|
||||
PreviousTabControl = DeterminePreviousControl(this.DynamicTabControl); // Change the control to the previous 'TabPage'
|
||||
|
||||
RenameFolders(folder1, folder2); // Rename folders
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Moves the selected 'TabPage' to the rigth and renumber/rename the others
|
||||
/// </summary>
|
||||
public void MoveTabPageToRight()
|
||||
{
|
||||
// Moves the selected 'TabPage' to the right and renumber/rename the others
|
||||
|
||||
string folder1 = "";
|
||||
string folder2 = "";
|
||||
|
||||
int index = DynamicTabControl.SelectedIndex; // The index of the selected 'TabPage'
|
||||
DataGridView dataGridView = DynamicTabControl.SelectedTab.Controls.OfType<DataGridView>().FirstOrDefault();
|
||||
|
||||
// If the selected tab is not the last tab, then move it to the right
|
||||
if (index < DynamicTabControl.TabCount)
|
||||
{
|
||||
DataGridViewValues = DetermineDataGridViewValues(DynamicTabControl, dataGridView); // Write all values from the selected dataGridView to a list
|
||||
|
||||
folder1 = DynamicTabControl.SelectedTab.Text; // Set the name of the current foder
|
||||
|
||||
TabControl NextTabControl = DetermineNextControl(this.DynamicTabControl); // Change the control to the next 'TabPage'
|
||||
|
||||
folder2 = DynamicTabControl.SelectedTab.Text; // Set the name of the next foder
|
||||
|
||||
DataGridView nextDataGridView = NextTabControl.SelectedTab.Controls.OfType<DataGridView>().FirstOrDefault(); // Chang the control to the next dataGridView
|
||||
NextDataGridViewValues = DetermineDataGridViewValues(NextTabControl, nextDataGridView); // Write all values from the next dataGridView to a list
|
||||
|
||||
WriteDataGridView(nextDataGridView, DataGridViewValues); // Write the data from the selected dataGridView back to the next dataGridView
|
||||
|
||||
DynamicTabControl.SelectedIndex = index; //Set the selected 'TabPage' as current 'TabPage'
|
||||
WriteDataGridView(dataGridView, NextDataGridViewValues); // Write the data from the next dataGridView back to the selected dataGridView
|
||||
|
||||
NextTabControl = DetermineNextControl(this.DynamicTabControl); // Change the control to the next 'TabPage'
|
||||
|
||||
RenameFolders(folder1, folder2); // Rename folders
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Private Methodes
|
||||
private void AddTabPage(TabControl dynamicTabControl, int count)
|
||||
{
|
||||
TabPage tabPage = new TabPage();
|
||||
tabPage.Name = "tabPage" + count.ToString();
|
||||
if (String.IsNullOrEmpty(TabName))
|
||||
{
|
||||
tabPage.Text = "Tab " + count.ToString();
|
||||
}
|
||||
else
|
||||
{
|
||||
tabPage.Text = TabName + count.ToString();
|
||||
}
|
||||
|
||||
dynamicTabControl.TabPages.Add(tabPage);
|
||||
}
|
||||
|
||||
private void AddDataGridViewTable(Control.ControlCollection Controls, TabControl dynamicTabControl, int number)
|
||||
{
|
||||
DataGridView dataGridView = new DataGridView();
|
||||
|
||||
Controls.Add(dataGridView);
|
||||
|
||||
dataGridView.ColumnCount = 2;
|
||||
dataGridView.Name = "dataGridView" + number.ToString();
|
||||
dataGridView.Columns[0].Name = "Number";
|
||||
dataGridView.Columns[1].Name = "Title";
|
||||
dataGridView.Columns[0].Width = 50;
|
||||
dataGridView.Columns[1].Width = 599;
|
||||
dataGridView.ScrollBars = ScrollBars.Both;
|
||||
dataGridView.Dock = DockStyle.Fill;
|
||||
dataGridView.Rows.Add();
|
||||
|
||||
dataGridView.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
|
||||
dataGridView.MultiSelect = false;
|
||||
|
||||
dynamicTabControl.TabPages[number].Controls.Add(dataGridView);
|
||||
}
|
||||
|
||||
private void RenameTabs(TabControl dynamicTabControl)
|
||||
{
|
||||
// Rename all 'TabControl' so that they are numbered consecutively again
|
||||
for (int i = 0; i < dynamicTabControl.TabCount; i++)
|
||||
{
|
||||
dynamicTabControl.TabPages[i].Name = "tabPage" + i.ToString();
|
||||
dynamicTabControl.TabPages[i].Text = "Tab " + i.ToString();
|
||||
}
|
||||
}
|
||||
|
||||
private bool IsDataGridViewEmpty(DataGridView dataGridView)
|
||||
{
|
||||
bool isEmpty = true;
|
||||
|
||||
if (dataGridView.Rows.Count == 0)
|
||||
{
|
||||
isEmpty = true; //Wenn es keine Zeilen gibt, dann ist die Tabelle leer
|
||||
}
|
||||
else
|
||||
{
|
||||
//Wenn es Zeilen gibt ...
|
||||
for (int i = 0; i < dataGridView.Rows.Count; i++)
|
||||
{
|
||||
for (int j = 0; j < dataGridView.Columns.Count; j++)
|
||||
{
|
||||
if (dataGridView[j, i].Value != null)
|
||||
{
|
||||
isEmpty = false; //... und die Zelle nicht leer ist, dann ist die Tabelle nicht leer
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return isEmpty;
|
||||
}
|
||||
|
||||
private TabControl DeterminePreviousControl(TabControl dynamicTabControl)
|
||||
{
|
||||
dynamicTabControl.SelectedIndex = dynamicTabControl.SelectedIndex - 1;
|
||||
return dynamicTabControl;
|
||||
}
|
||||
|
||||
private TabControl DetermineNextControl(TabControl dynamicTabControl)
|
||||
{
|
||||
dynamicTabControl.SelectedIndex = dynamicTabControl.SelectedIndex + 1;
|
||||
return dynamicTabControl;
|
||||
}
|
||||
|
||||
private List<string[]> DetermineDataGridViewValues(TabControl dynamicTabControl, DataGridView dataGridView)
|
||||
{
|
||||
string[] rowValues = new string[2];
|
||||
List<string[]> dataGridViewValues = new List<string[]>();
|
||||
|
||||
// Werte der DataGridview einlesen
|
||||
for (int i = 0; i < dataGridView.Rows.Count - 1; i++)
|
||||
{
|
||||
if (dataGridView[0, i].Value == null)
|
||||
{
|
||||
rowValues[0] = "";
|
||||
}
|
||||
else
|
||||
{
|
||||
rowValues[0] = dataGridView[0, i].Value.ToString();
|
||||
}
|
||||
|
||||
if (dataGridView[0, i].Value == null)
|
||||
{
|
||||
rowValues[1] = "";
|
||||
}
|
||||
else
|
||||
{
|
||||
rowValues[1] = dataGridView[1, i].Value.ToString();
|
||||
}
|
||||
|
||||
dataGridViewValues.Add(rowValues);
|
||||
}
|
||||
|
||||
return dataGridViewValues;
|
||||
}
|
||||
|
||||
private void WriteDataGridView(DataGridView dataGridView, List<string[]> dataGridViewValues)
|
||||
{
|
||||
dataGridView.Rows.Clear(); // Delete all existing values
|
||||
|
||||
for (int i = 0; i < dataGridViewValues.Count; i++)
|
||||
{
|
||||
dataGridView.Rows.Add();
|
||||
dataGridView[0, i].Value = dataGridViewValues[i].GetValue(0);
|
||||
dataGridView[1, i].Value = dataGridViewValues[i].GetValue(1);
|
||||
}
|
||||
|
||||
dataGridView.Refresh();
|
||||
}
|
||||
|
||||
private void RenameFolders(string folder1, string folder2)
|
||||
{
|
||||
Directory.Move(DataPath + "\\" + folder1, DataPath + "\\" + folder1 + "_temp"); // Rename the 'folder1' to a temporary folder, so the name is free
|
||||
Directory.Move(DataPath + "\\" + folder2, DataPath + "\\" + folder1); // Rename 'folder2' in 'folder1'
|
||||
Directory.Move(DataPath + "\\" + folder1 + "_temp", DataPath + "\\" + folder2); // Rename the temporary folder to 'folder2'
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,84 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{5780CB23-8ABE-4DCE-95FC-BC35F4ECC14B}</ProjectGuid>
|
||||
<OutputType>WinExe</OutputType>
|
||||
<RootNamespace>Test_TabControlWithDataGridView</RootNamespace>
|
||||
<AssemblyName>Test_TabControlWithDataGridView</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
|
||||
<Deterministic>false</Deterministic>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Deployment" />
|
||||
<Reference Include="System.Drawing" />
|
||||
<Reference Include="System.Net.Http" />
|
||||
<Reference Include="System.Windows.Forms" />
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Form1.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Form1.Designer.cs">
|
||||
<DependentUpon>Form1.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Program.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="TabControlWithDataGridView.cs" />
|
||||
<EmbeddedResource Include="Form1.resx">
|
||||
<DependentUpon>Form1.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Properties\Resources.resx">
|
||||
<Generator>ResXFileCodeGenerator</Generator>
|
||||
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
|
||||
<SubType>Designer</SubType>
|
||||
</EmbeddedResource>
|
||||
<Compile Include="Properties\Resources.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Resources.resx</DependentUpon>
|
||||
</Compile>
|
||||
<None Include="Properties\Settings.settings">
|
||||
<Generator>SettingsSingleFileGenerator</Generator>
|
||||
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
|
||||
</None>
|
||||
<Compile Include="Properties\Settings.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Settings.settings</DependentUpon>
|
||||
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="App.config" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
</Project>
|
||||
Binary file not shown.
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<configuration>
|
||||
<startup>
|
||||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
|
||||
</startup>
|
||||
</configuration>
|
||||
Binary file not shown.
@ -0,0 +1,4 @@
|
||||
// <autogenerated />
|
||||
using System;
|
||||
using System.Reflection;
|
||||
[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -0,0 +1 @@
|
||||
11fee5a0d2fb0416800e8220fcecfc08b6048d7f6e8f38c8fb93dc13f3d3f5ce
|
||||
@ -0,0 +1,10 @@
|
||||
C:\CAD\Git-WorkRepository\VisualStudio\_TEST\Test_TabControlWithDataGridView.git\Test_TabControlWithDataGridView\obj\Debug\Test_TabControlWithDataGridView.csproj.AssemblyReference.cache
|
||||
C:\CAD\Git-WorkRepository\VisualStudio\_TEST\Test_TabControlWithDataGridView.git\Test_TabControlWithDataGridView\obj\Debug\Test_TabControlWithDataGridView.Form1.resources
|
||||
C:\CAD\Git-WorkRepository\VisualStudio\_TEST\Test_TabControlWithDataGridView.git\Test_TabControlWithDataGridView\obj\Debug\Test_TabControlWithDataGridView.Properties.Resources.resources
|
||||
C:\CAD\Git-WorkRepository\VisualStudio\_TEST\Test_TabControlWithDataGridView.git\Test_TabControlWithDataGridView\obj\Debug\Test_TabControlWithDataGridView.csproj.GenerateResource.cache
|
||||
C:\CAD\Git-WorkRepository\VisualStudio\_TEST\Test_TabControlWithDataGridView.git\Test_TabControlWithDataGridView\obj\Debug\Test_TabControlWithDataGridView.csproj.CoreCompileInputs.cache
|
||||
C:\CAD\Git-WorkRepository\VisualStudio\_TEST\Test_TabControlWithDataGridView.git\Test_TabControlWithDataGridView\bin\Debug\Test_TabControlWithDataGridView.exe.config
|
||||
C:\CAD\Git-WorkRepository\VisualStudio\_TEST\Test_TabControlWithDataGridView.git\Test_TabControlWithDataGridView\bin\Debug\Test_TabControlWithDataGridView.exe
|
||||
C:\CAD\Git-WorkRepository\VisualStudio\_TEST\Test_TabControlWithDataGridView.git\Test_TabControlWithDataGridView\bin\Debug\Test_TabControlWithDataGridView.pdb
|
||||
C:\CAD\Git-WorkRepository\VisualStudio\_TEST\Test_TabControlWithDataGridView.git\Test_TabControlWithDataGridView\obj\Debug\Test_TabControlWithDataGridView.exe
|
||||
C:\CAD\Git-WorkRepository\VisualStudio\_TEST\Test_TabControlWithDataGridView.git\Test_TabControlWithDataGridView\obj\Debug\Test_TabControlWithDataGridView.pdb
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue
Block a user