Initial Commit of the PDM project (ready for DWS migration)
This commit is contained in:
@@ -0,0 +1,311 @@
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<title>Add Custom File Reference Example (VB.NET)</title>
|
||||
<meta http-equiv="Content-Language" content="en-us">
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
|
||||
<link rel="stylesheet" type="text/css" href="ApiHelp.css">
|
||||
</head>
|
||||
<meta name=MS-HKWD content="VB.NET examples,custom file references">
|
||||
|
||||
<body>
|
||||
<h1><font size="1"><span style="font-weight: 400">SOLIDWORKS PDM Professional API Help</span></h1>
|
||||
<h1>Add Custom File Reference Example (VB.NET)</h1>
|
||||
<p><a name="top"></a>This example shows how to add a custom file reference to a
|
||||
file in the vault.</p>
|
||||
<p><b>NOTE</b>: If using the primary interop assembly
|
||||
provided with SOLIDWORKS PDM Professional, see
|
||||
<a href="Using_NET_Framework_in_Applications.htm">Using .NET Framework 4.0 in
|
||||
Stand-alone Applications</a>.</p>
|
||||
<p><img border="0" src="AddCustomRefs.gif" width="333" height="346"></p>
|
||||
|
||||
<p style="font-family: Courier New; font-size: 13; color: black; background: white" class="APICODE">
|
||||
<span style="color:green;">
|
||||
'----------------------------------------------------------------------------</span><br>
|
||||
<span style="color:green;">' Preconditions:</span><br>
|
||||
<span style="color:green;">' 1. Start Microsoft Visual Studio.</span><br>
|
||||
<span style="color:green;">' a. Click <b>File > New > Project > Visual Basic > Windows Forms Application</b>.</span><br>
|
||||
<span style="color:green;">' b. Type <b>CustRef</b> in <b>Name</b>.</span><br>
|
||||
<span style="color:green;">' c. Click <b>Browse</b> and navigate to the folder where to create </span><br>
|
||||
<span style="color:green;">' the project.</span><br>
|
||||
<span style="color:green;">' d. Click <b>OK</b>. </span><br>
|
||||
<span style="color:green;">' e. Click <b>Show All Files</b> in the Solution Explorer toolbar and expand </span><br>
|
||||
<span style="color:green;">' <b>Form1.vb</b> in the Solution Explorer.</span><br>
|
||||
<span style="color:green;">
|
||||
' f. Create a form similar to the form shown above and change:</span><br>
|
||||
<span style="color:green;">' 1. Top label to <b>VaultsLabel</b>.</span><br>
|
||||
<span style="color:green;">' 2. Combo box to <b>VaultsComboBox</b>.</span><br>
|
||||
<span style="color:green;">' 3. List box to <b>CustRefListBox</b>.</span><br>
|
||||
<span style="color:green;">' 4. Browse button to <b>BrowseButton</b>.</span><br>
|
||||
<span style="color:green;">' 5. <b>Add custom file reference</b> button to <b>AddCustomFileReference</b>.</span><br>
|
||||
<span style="color:green;">' g. Replace the code in <b>Form1.vb</b> with <a href="#form1">this code</a>.</span><br>
|
||||
<span style="color:green;">' h. Replace the code in <b>Form1.Designer.vb</b> with <a href="#form1designer">this code</a>.</span><br>
|
||||
<span style="color:green;">' 2. Add <b>EPDM.Interop.epdm.dll</b> as a reference (right-click the project</span><br>
|
||||
<span style="color:green;">' name in the Solution Explorer, click <b>Add Reference</b>, click </span><br>
|
||||
<span style="color:green;">' <b>Assemblies > Framework</b> in the left-side panel, browse to the top folder of </span><br>
|
||||
<span style="color:green;">' your SOLIDWORKS PDM Professional installation, locate and click </span><br>
|
||||
<span style="color:green;">' <b>EPDM.Interop.epdm.dll</b>, click <b>Open</b>, click <b>Add</b>, and click <b>Close</b>).</span><br>
|
||||
<span style="color:green;">' 3. Right-click <b>EPDM.Interop.epdm</b> in References, click <b>Properties</b>, and set </span><br>
|
||||
<span style="color:green;">' <b>Embed Interop Types</b> to <b>False</b> to handle methods that pass arrays of </span><br>
|
||||
<span style="color:green;">' structures.</span><br>
|
||||
<span style="color:green;">' 4. Click <b>Debug > Start Debugging</b> or press F5.</span><br>
|
||||
<span style="color:green;">'</span><br>
|
||||
<span style="color:green;">' Postconditions: </span><br>
|
||||
<span style="color:green;">' 1. The Add custom references dialog displays.</span><br>
|
||||
<span style="color:green;">' 2. Select a vault.</span><br>
|
||||
<span style="color:green;">' 3. Click <b>Browse for file to which to add custom reference</b>, </span><br>
|
||||
<span style="color:green;">
|
||||
' locate and click a file in the vault, and click <b>Open</b>.</span><br>
|
||||
<span style="color:green;">' The file is checked out.<br>
|
||||
' 4. In a view of the selected vault, right-click a file and click <b>Copy</b>.</span><br>
|
||||
<span style="color:green;">' 5. In the Add custom references dialog, click <b>Add custom file reference</b>.</span><br>
|
||||
<span style="color:green;">
|
||||
' The file that was copied to the clipboard is added as a custom </span><br>
|
||||
<span style="color:green;">' reference to the checked-out file.</span><br>
|
||||
<span style="color:green;">' 6. In the Create File References dialog, click <b>OK</b>.</span><br>
|
||||
<span style="color:green;">' The file is checked in.</span><br>
|
||||
<span style="color:green;">
|
||||
' 7. In the Edit User-Defined File References dialog, click <b>OK</b>.</span><br>
|
||||
<span style="color:green;">
|
||||
' 8. Close the Add custom references dialog. </span><br>
|
||||
<span style="color:green;">
|
||||
'----------------------------------------------------------------------------</span><br>
|
||||
<br>
|
||||
<span style="color:green;"><a name="form1"></a>'Form1.vb</span><br>
|
||||
<span style="color:blue;">Imports</span> System.IO<br>
|
||||
<span style="color:blue;">Imports</span> System.Xml.Serialization<br>
|
||||
<span style="color:blue;">Imports</span> System.Collections<br>
|
||||
<span style="color:blue;">Imports</span> System.Collections.Generic<br>
|
||||
<span style="color:blue;">Imports</span> System.Data<br>
|
||||
<span style="color:blue;">Imports</span> System.Diagnostics<br>
|
||||
<span style="color:blue;">Imports</span> System.Windows.Forms<br>
|
||||
<span style="color:blue;">Imports</span> System.ComponentModel<br>
|
||||
<span style="color:blue;">Imports</span> EPDM.Interop.epdm<br>
|
||||
<br>
|
||||
<br>
|
||||
<span style="color:blue;">Public</span> <span style="color:blue;">Class</span> <span style="color:#2b91af;">Form1</span><br>
|
||||
<br>
|
||||
<span style="color:blue;">Private</span> vault1 <span style="color:blue;">As</span> <span style="color:#2b91af;">IEdmVault5</span> = <span style="color:blue;">Nothing</span><br>
|
||||
<br>
|
||||
<span style="color:blue;">Public</span> <span style="color:blue;">Sub</span> Form1_Load(<span style="color:blue;">ByVal</span> sender <span style="color:blue;">As</span> System.<span style="color:#2b91af;">Object</span>, <span style="color:blue;">ByVal</span> e <span style="color:blue;">As</span> System.<span style="color:#2b91af;">EventArgs</span>) <span style="color:blue;">Handles</span> <span style="color:blue;">MyBase</span>.Load<br>
|
||||
<br>
|
||||
<span style="color:blue;">Try</span><br>
|
||||
<span style="color:blue;">Dim</span> vault1 <span style="color:blue;">As</span> <span style="color:#2b91af;">IEdmVault5</span> = <span style="color:blue;">New</span> <span style="color:#2b91af;">EdmVault5</span>()<br>
|
||||
<span style="color:blue;">Dim</span> vault <span style="color:blue;">As</span> <span style="color:#2b91af;">IEdmVault8</span> = <span style="color:blue;">DirectCast</span>(vault1, <span style="color:#2b91af;">IEdmVault8</span>)<br>
|
||||
<span style="color:blue;">Dim</span> Views <span style="color:blue;">As</span> <span style="color:#2b91af;">EdmViewInfo</span>() = <span style="color:blue;">Nothing</span><br>
|
||||
<br>
|
||||
vault.<b>GetVaultViews</b>(Views, <span style="color:blue;">False</span>)<br>
|
||||
VaultsComboBox.Items.Clear()<br>
|
||||
<span style="color:blue;">For</span> <span style="color:blue;">Each</span> View <span style="color:blue;">As</span> <span style="color:#2b91af;">EdmViewInfo</span> <span style="color:blue;">In</span> Views<br>
|
||||
VaultsComboBox.Items.Add(View.<b>mbsVaultName</b>)<br>
|
||||
<span style="color:blue;">Next</span><br>
|
||||
<span style="color:blue;">If</span> VaultsComboBox.Items.Count > 0 <span style="color:blue;">Then</span><br>
|
||||
VaultsComboBox.Text = <span style="color:blue;">DirectCast</span>(VaultsComboBox.Items(0), <span style="color:blue;">String</span>)<br>
|
||||
<span style="color:blue;">End</span> <span style="color:blue;">If</span><br>
|
||||
<span style="color:blue;">Catch</span> ex <span style="color:blue;">As</span> System.Runtime.InteropServices.<span style="color:#2b91af;">COMException</span><br>
|
||||
<span style="color:#2b91af;">MessageBox</span>.Show(<span style="color:#a31515;">"HRESULT = 0x"</span> + ex.ErrorCode.ToString(<span style="color:#a31515;">"X"</span>) + <span style="color:#a31515;">" "</span> + ex.Message)<br>
|
||||
<span style="color:blue;">Catch</span> ex <span style="color:blue;">As</span> <span style="color:#2b91af;">Exception</span><br>
|
||||
<span style="color:#2b91af;">MessageBox</span>.Show(ex.Message)<br>
|
||||
<span style="color:blue;">End</span> <span style="color:blue;">Try</span><br>
|
||||
<span style="color:blue;">End</span> <span style="color:blue;">Sub</span><br>
|
||||
<br>
|
||||
<span style="color:blue;">Public</span> <span style="color:blue;">Sub</span> BrowseButton_Click(<span style="color:blue;">ByVal</span> sender <span style="color:blue;">As</span> System.<span style="color:#2b91af;">Object</span>, <span style="color:blue;">ByVal</span> e <span style="color:blue;">As</span> System.<span style="color:#2b91af;">EventArgs</span>) <span style="color:blue;">Handles</span> BrowseButton.Click<br>
|
||||
<span style="color:blue;">Try</span><br>
|
||||
CustRefListBox.Items.Clear()<br>
|
||||
<br>
|
||||
<span style="color:green;">'Only create a new vault object</span><br>
|
||||
<span style="color:green;">'if one hasn't been created yet</span><br>
|
||||
<span style="color:blue;">If</span> vault1 <span style="color:blue;">Is</span> <span style="color:blue;">Nothing</span> <span style="color:blue;">Then</span><br>
|
||||
vault1 = <span style="color:blue;">New</span> <span style="color:#2b91af;">EdmVault5</span>()<br>
|
||||
<span style="color:blue;">End</span> <span style="color:blue;">If</span><br>
|
||||
<span style="color:blue;">If</span> <span style="color:blue;">Not</span> vault1.<b>IsLoggedIn</b> <span style="color:blue;">Then</span><br>
|
||||
<span style="color:green;">'Log into selected vault as the current user</span><br>
|
||||
vault1.<b>LoginAuto</b>(VaultsComboBox.Text, <span style="color:blue;">Me</span>.Handle.ToInt32())<br>
|
||||
<span style="color:blue;">End</span> <span style="color:blue;">If</span><br>
|
||||
<br>
|
||||
<span style="color:green;">'Set the initial directory in the File Open dialog</span><br>
|
||||
CustRefOpenFileDialog.InitialDirectory = vault1.<b>RootFolderPath</b><br>
|
||||
<span style="color:green;">'Show the File Open dialog</span><br>
|
||||
<span style="color:blue;">Dim</span> DialogResult <span style="color:blue;">As</span> System.Windows.Forms.<span style="color:#2b91af;">DialogResult</span> = <span style="color:blue;">Nothing</span><br>
|
||||
DialogResult = CustRefOpenFileDialog.ShowDialog()<br>
|
||||
<span style="color:green;">'If the user didn't click Open, exit the sub</span><br>
|
||||
<span style="color:blue;">If</span> <span style="color:blue;">Not</span> (DialogResult = System.Windows.Forms.<span style="color:#2b91af;">DialogResult</span>.OK) <span style="color:blue;">Then</span><br>
|
||||
<span style="color:blue;">Return</span><br>
|
||||
<span style="color:blue;">End</span> <span style="color:blue;">If</span><br>
|
||||
<br>
|
||||
<span style="color:blue;">For</span> <span style="color:blue;">Each</span> FileName <span style="color:blue;">As</span> <span style="color:blue;">String</span> <span style="color:blue;">In</span> CustRefOpenFileDialog.FileNames<br>
|
||||
CustRefListBox.Items.Add(FileName)<br>
|
||||
<span style="color:blue;">Next</span><br>
|
||||
<span style="color:blue;">Catch</span> ex <span style="color:blue;">As</span> System.Runtime.InteropServices.<span style="color:#2b91af;">COMException</span><br>
|
||||
<span style="color:#2b91af;">MessageBox</span>.Show(<span style="color:#a31515;">"HRESULT = 0x"</span> + ex.ErrorCode.ToString(<span style="color:#a31515;">"X"</span>) + <span style="color:#a31515;">" "</span> + ex.Message)<br>
|
||||
<span style="color:blue;">Catch</span> ex <span style="color:blue;">As</span> <span style="color:#2b91af;">Exception</span><br>
|
||||
<span style="color:#2b91af;">MessageBox</span>.Show(ex.Message)<br>
|
||||
<span style="color:blue;">End</span> <span style="color:blue;">Try</span><br>
|
||||
<span style="color:blue;">End</span> <span style="color:blue;">Sub</span><br>
|
||||
<br>
|
||||
<br>
|
||||
<span style="color:blue;">Public</span> <span style="color:blue;">Sub</span> AddCustomFileReference_Click(<span style="color:blue;">ByVal</span> sender <span style="color:blue;">As</span> System.<span style="color:#2b91af;">Object</span>, <span style="color:blue;">ByVal</span> e <span style="color:blue;">As</span> System.<span style="color:#2b91af;">EventArgs</span>) <span style="color:blue;">Handles</span> AddCustomFileReference.Click<br>
|
||||
<span style="color:blue;">Try</span><br>
|
||||
<span style="color:green;">'Only create a new vault object</span><br>
|
||||
<span style="color:green;">'if one hasn't been created yet</span><br>
|
||||
<span style="color:blue;">Dim</span> vault2 <span style="color:blue;">As</span> <span style="color:#2b91af;">IEdmVault7</span> = <span style="color:blue;">Nothing</span><br>
|
||||
<span style="color:blue;">If</span> vault1 <span style="color:blue;">Is</span> <span style="color:blue;">Nothing</span> <span style="color:blue;">Then</span><br>
|
||||
vault1 = <span style="color:blue;">New</span> <span style="color:#2b91af;">EdmVault5</span>()<br>
|
||||
<span style="color:blue;">End</span> <span style="color:blue;">If</span><br>
|
||||
vault2 = <span style="color:blue;">DirectCast</span>(vault1, <span style="color:#2b91af;">IEdmVault7</span>)<br>
|
||||
<span style="color:blue;">If</span> <span style="color:blue;">Not</span> vault1.<b>IsLoggedIn</b> <span style="color:blue;">Then</span><br>
|
||||
<span style="color:green;">'Log into selected vault as the current user</span><br>
|
||||
vault1.<b>LoginAuto</b>(VaultsComboBox.Text, <span style="color:blue;">Me</span>.Handle.ToInt32())<br>
|
||||
<span style="color:blue;">End</span> <span style="color:blue;">If</span><br>
|
||||
<br>
|
||||
<span style="color:blue;">Dim</span> addCustRefs <span style="color:blue;">As</span> <span style="color:#2b91af;">IEdmAddCustomRefs</span> = <span style="color:blue;">DirectCast</span>(vault2.CreateUtility(<span style="color:#2b91af;">EdmUtility</span>.<b>EdmUtil_AddCustomRefs</b>), <span style="color:#2b91af;">IEdmAddCustomRefs</span>)<br>
|
||||
<span style="color:blue;">Dim</span> ppoFileIdArray <span style="color:blue;">As</span> <span style="color:#2b91af;">Int32</span>() = <span style="color:blue;">New</span> <span style="color:#2b91af;">Int32</span>(CustRefListBox.Items.Count - 1) {}<br>
|
||||
<span style="color:blue;">Dim</span> file <span style="color:blue;">As</span> <span style="color:#2b91af;">IEdmFile5</span> = <span style="color:blue;">Nothing</span><br>
|
||||
<span style="color:blue;">Dim</span> parentFolder <span style="color:blue;">As</span> <span style="color:#2b91af;">IEdmFolder5</span> = <span style="color:blue;">Nothing</span><br>
|
||||
<span style="color:blue;">Dim</span> i <span style="color:blue;">As</span> <span style="color:blue;">Integer</span> = 0<br>
|
||||
<span style="color:blue;">For</span> <span style="color:blue;">Each</span> FileName <span style="color:blue;">As</span> <span style="color:blue;">String</span> <span style="color:blue;">In</span> CustRefListBox.Items<br>
|
||||
file = vault2.<b>GetFileFromPath</b>(FileName, parentFolder)<br>
|
||||
<span style="color:blue;">If</span> <span style="color:blue;">Not</span> file.<b>IsLocked</b> <span style="color:blue;">Then</span><br>
|
||||
file.<b>LockFile</b>(parentFolder.<b>ID</b>, <span style="color:blue;">Me</span>.Handle.ToInt32(), <span style="color:blue;">CInt</span>(<span style="color:#2b91af;">EdmLockFlag</span>.EdmLock_Simple))<br>
|
||||
<span style="color:blue;">End</span> <span style="color:blue;">If</span><br>
|
||||
ppoFileIdArray(i) = file.<b>ID</b><br>
|
||||
i += 1<br>
|
||||
<span style="color:blue;">Next</span><br>
|
||||
<span style="color:blue;">Dim</span> retCode <span style="color:blue;">As</span> <span style="color:#2b91af;">[Boolean]</span> = <span style="color:blue;">False</span><br>
|
||||
<br>
|
||||
<span style="color:green;">'Add the file that is copied to the clipboard as a custom reference to the selected file</span><br>
|
||||
<span style="color:blue;">For</span> <span style="color:blue;">Each</span> ID <span style="color:blue;">As</span> <span style="color:blue;">Integer</span> <span style="color:blue;">In</span> ppoFileIdArray<br>
|
||||
addCustRefs.<b>AddReferencesClipboard</b>(ID)<br>
|
||||
addCustRefs.<b>CreateTree</b>(<span style="color:blue;">CInt</span>(<span style="color:#2b91af;">EdmCreateReferenceFlags</span>.Ecrf_Nothing))<br>
|
||||
addCustRefs.<b>ShowDlg</b>(<span style="color:blue;">Me</span>.Handle.ToInt32())<br>
|
||||
retCode = addCustRefs.<b>CreateReferences</b>()<br>
|
||||
<span style="color:blue;">Next</span><br>
|
||||
<br>
|
||||
<span style="color:green;">' Check in the file</span><br>
|
||||
file.<b>UnlockFile</b>(<span style="color:blue;">Me</span>.Handle.ToInt32(), <span style="color:#a31515;">"Custom reference added"</span>)<br>
|
||||
<br>
|
||||
<span style="color:green;">'Display current custom file references</span><br>
|
||||
<br>
|
||||
retCode = addCustRefs.<b>ShowEditReferencesDlg</b>(ppoFileIdArray, <span style="color:blue;">Me</span>.Handle.ToInt32())<br>
|
||||
<span style="color:blue;">Catch</span> ex <span style="color:blue;">As</span> System.Runtime.InteropServices.<span style="color:#2b91af;">COMException</span><br>
|
||||
<span style="color:#2b91af;">MessageBox</span>.Show(<span style="color:#a31515;">"HRESULT = 0x"</span> + ex.ErrorCode.ToString(<span style="color:#a31515;">"X"</span>) + <span style="color:#a31515;">" "</span> + ex.Message)<br>
|
||||
<span style="color:blue;">Catch</span> ex <span style="color:blue;">As</span> <span style="color:#2b91af;">Exception</span><br>
|
||||
<span style="color:#2b91af;">MessageBox</span>.Show(ex.Message)<br>
|
||||
<span style="color:blue;">End</span> <span style="color:blue;">Try</span><br>
|
||||
<span style="color:blue;">End</span> <span style="color:blue;">Sub</span></p>
|
||||
<p style="font-family: Courier New; font-size: 13; color: black; background: white" class="APICODE" align="left">
|
||||
<span style="color:blue;">End</span> <span style="color:blue;">Class</span></p>
|
||||
<p style="font-family: Courier New; font-size: 13; color: black; background: white" class="APICODE" align="center">
|
||||
<a href="#top">Back to top</a> </p>
|
||||
<p style="font-family: Courier New; font-size: 13; color: #008000; background: white" class="APICODE">
|
||||
<a name="form1designer"></a>'Form1.Designer.vb</p>
|
||||
<p style="font-family: Courier New; font-size: 13; color: black; background: white" class="APICODE">
|
||||
<<span style="color:blue;">Global</span>.Microsoft.VisualBasic.CompilerServices.<span style="color:#2b91af;">DesignerGenerated</span>()> _<br>
|
||||
<span style="color:blue;">Partial</span> <span style="color:blue;">Class</span> <span style="color:#2b91af;">Form1</span><br>
|
||||
<span style="color:blue;">Inherits</span> System.Windows.Forms.<span style="color:#2b91af;">Form</span><br>
|
||||
<span style="color:green;">''' </span><span style="color:gray;"><summary></span><br>
|
||||
<span style="color:green;">''' Required designer variable.</span><br>
|
||||
<span style="color:green;">''' </span><span style="color:gray;"></summary></span><br>
|
||||
<span style="color:blue;">Private</span> components <span style="color:blue;">As</span> System.ComponentModel.<span style="color:#2b91af;">IContainer</span> = <span style="color:blue;">Nothing</span><br>
|
||||
<br>
|
||||
<span style="color:green;">''' </span><span style="color:gray;"><summary></span><br>
|
||||
<span style="color:green;">''' Clean up any resources being used.</span><br>
|
||||
<span style="color:green;">''' </span><span style="color:gray;"></summary></span><br>
|
||||
<span style="color:green;">''' </span><span style="color:gray;"><param name="disposing"></span><span style="color:green;">true if managed resources should be disposed; otherwise, false.</span><span style="color:gray;"></param></span><br>
|
||||
<span style="color:blue;">Protected</span> <span style="color:blue;">Overrides</span> <span style="color:blue;">Sub</span> Dispose(<span style="color:blue;">ByVal</span> disposing <span style="color:blue;">As</span> <span style="color:blue;">Boolean</span>)<br>
|
||||
<span style="color:blue;">If</span> disposing <span style="color:blue;">AndAlso</span> (components <span style="color:blue;">IsNot</span> <span style="color:blue;">Nothing</span>) <span style="color:blue;">Then</span><br>
|
||||
components.Dispose()<br>
|
||||
<span style="color:blue;">End</span> <span style="color:blue;">If</span><br>
|
||||
<span style="color:blue;">MyBase</span>.Dispose(disposing)<br>
|
||||
<span style="color:blue;">End</span> <span style="color:blue;">Sub</span><br>
|
||||
<br>
|
||||
<span style="color:blue;">#Region</span> <span style="color:#a31515;">"Windows Form Designer generated code"</span><br>
|
||||
<br>
|
||||
<span style="color:green;">''' </span><span style="color:gray;"><summary></span><br>
|
||||
<span style="color:green;">''' Required method for Designer support - do not modify</span><br>
|
||||
<span style="color:green;">''' the contents of this method with the code editor.</span><br>
|
||||
<span style="color:green;">''' </span><span style="color:gray;"></summary></span><br>
|
||||
<span style="color:blue;">Private</span> <span style="color:blue;">Sub</span> InitializeComponent()<br>
|
||||
<span style="color:blue;">Me</span>.VaultsLabel = <span style="color:blue;">New</span> System.Windows.Forms.<span style="color:#2b91af;">Label</span>()<br>
|
||||
<span style="color:blue;">Me</span>.VaultsComboBox = <span style="color:blue;">New</span> System.Windows.Forms.<span style="color:#2b91af;">ComboBox</span>()<br>
|
||||
<span style="color:blue;">Me</span>.BrowseButton = <span style="color:blue;">New</span> System.Windows.Forms.<span style="color:#2b91af;">Button</span>()<br>
|
||||
<span style="color:blue;">Me</span>.CustRefListBox = <span style="color:blue;">New</span> System.Windows.Forms.<span style="color:#2b91af;">ListBox</span>()<br>
|
||||
<span style="color:blue;">Me</span>.AddCustomFileReference = <span style="color:blue;">New</span> System.Windows.Forms.<span style="color:#2b91af;">Button</span>()<br>
|
||||
<span style="color:blue;">Me</span>.CustRefOpenFileDialog = <span style="color:blue;">New</span> System.Windows.Forms.<span style="color:#2b91af;">OpenFileDialog</span>()<br>
|
||||
<span style="color:blue;">Me</span>.SuspendLayout()<br>
|
||||
<span style="color:green;">'</span><br>
|
||||
<span style="color:green;">'VaultsLabel</span><br>
|
||||
<span style="color:green;">'</span><br>
|
||||
<span style="color:blue;">Me</span>.VaultsLabel.AutoSize = <span style="color:blue;">True</span><br>
|
||||
<span style="color:blue;">Me</span>.VaultsLabel.Location = <span style="color:blue;">New</span> System.Drawing.<span style="color:#2b91af;">Point</span>(13, 26)<br>
|
||||
<span style="color:blue;">Me</span>.VaultsLabel.Name = <span style="color:#a31515;">"VaultsLabel"</span><br>
|
||||
<span style="color:blue;">Me</span>.VaultsLabel.Size = <span style="color:blue;">New</span> System.Drawing.<span style="color:#2b91af;">Size</span>(244, 13)<br>
|
||||
<span style="color:blue;">Me</span>.VaultsLabel.TabIndex = 0<br>
|
||||
<span style="color:blue;">Me</span>.VaultsLabel.Text = <span style="color:#a31515;">"Copy a file to the clipboard, then select vault view:"</span><br>
|
||||
<span style="color:green;">'</span><br>
|
||||
<span style="color:green;">'VaultsComboBox</span><br>
|
||||
<span style="color:green;">'</span><br>
|
||||
<span style="color:blue;">Me</span>.VaultsComboBox.FormattingEnabled = <span style="color:blue;">True</span><br>
|
||||
<span style="color:blue;">Me</span>.VaultsComboBox.Location = <span style="color:blue;">New</span> System.Drawing.<span style="color:#2b91af;">Point</span>(16, 59)<br>
|
||||
<span style="color:blue;">Me</span>.VaultsComboBox.Name = <span style="color:#a31515;">"VaultsComboBox"</span><br>
|
||||
<span style="color:blue;">Me</span>.VaultsComboBox.Size = <span style="color:blue;">New</span> System.Drawing.<span style="color:#2b91af;">Size</span>(121, 21)<br>
|
||||
<span style="color:blue;">Me</span>.VaultsComboBox.TabIndex = 1<br>
|
||||
<span style="color:green;">'</span><br>
|
||||
<span style="color:green;">'BrowseButton</span><br>
|
||||
<span style="color:green;">'</span><br>
|
||||
<span style="color:blue;">Me</span>.BrowseButton.Location = <span style="color:blue;">New</span> System.Drawing.<span style="color:#2b91af;">Point</span>(16, 98)<br>
|
||||
<span style="color:blue;">Me</span>.BrowseButton.Name = <span style="color:#a31515;">"BrowseButton"</span><br>
|
||||
<span style="color:blue;">Me</span>.BrowseButton.Size = <span style="color:blue;">New</span> System.Drawing.<span style="color:#2b91af;">Size</span>(271, 23)<br>
|
||||
<span style="color:blue;">Me</span>.BrowseButton.TabIndex = 3<br>
|
||||
<span style="color:blue;">Me</span>.BrowseButton.Text = <span style="color:#a31515;">"Browse for file to which to add a custom reference..."</span><br>
|
||||
<span style="color:blue;">Me</span>.BrowseButton.UseVisualStyleBackColor = <span style="color:blue;">True</span><br>
|
||||
<span style="color:green;">'</span><br>
|
||||
<span style="color:green;">'CustRefListBox</span><br>
|
||||
<span style="color:green;">'</span><br>
|
||||
<span style="color:blue;">Me</span>.CustRefListBox.FormattingEnabled = <span style="color:blue;">True</span><br>
|
||||
<span style="color:blue;">Me</span>.CustRefListBox.Location = <span style="color:blue;">New</span> System.Drawing.<span style="color:#2b91af;">Point</span>(16, 150)<br>
|
||||
<span style="color:blue;">Me</span>.CustRefListBox.Name = <span style="color:#a31515;">"CustRefListBox"</span><br>
|
||||
<span style="color:blue;">Me</span>.CustRefListBox.Size = <span style="color:blue;">New</span> System.Drawing.<span style="color:#2b91af;">Size</span>(259, 95)<br>
|
||||
<span style="color:blue;">Me</span>.CustRefListBox.TabIndex = 4<br>
|
||||
<span style="color:green;">'</span><br>
|
||||
<span style="color:green;">'AddCustomFileReference</span><br>
|
||||
<span style="color:green;">'</span><br>
|
||||
<span style="color:blue;">Me</span>.AddCustomFileReference.Location = <span style="color:blue;">New</span> System.Drawing.<span style="color:#2b91af;">Point</span>(16, 273)<br>
|
||||
<span style="color:blue;">Me</span>.AddCustomFileReference.Name = <span style="color:#a31515;">"AddCustomFileReference"</span><br>
|
||||
<span style="color:blue;">Me</span>.AddCustomFileReference.Size = <span style="color:blue;">New</span> System.Drawing.<span style="color:#2b91af;">Size</span>(259, 23)<br>
|
||||
<span style="color:blue;">Me</span>.AddCustomFileReference.TabIndex = 5<br>
|
||||
<span style="color:blue;">Me</span>.AddCustomFileReference.Text = <span style="color:#a31515;">"Add custom file reference"</span><br>
|
||||
<span style="color:blue;">Me</span>.AddCustomFileReference.UseVisualStyleBackColor = <span style="color:blue;">True</span><br>
|
||||
<span style="color:green;">'</span><br>
|
||||
<span style="color:green;">'Form1</span><br>
|
||||
<span style="color:green;">'</span><br>
|
||||
<span style="color:blue;">Me</span>.AutoScaleDimensions = <span style="color:blue;">New</span> System.Drawing.<span style="color:#2b91af;">SizeF</span>(6.0!, 13.0!)<br>
|
||||
<span style="color:blue;">Me</span>.AutoScaleMode = System.Windows.Forms.<span style="color:#2b91af;">AutoScaleMode</span>.Font<br>
|
||||
<span style="color:blue;">Me</span>.ClientSize = <span style="color:blue;">New</span> System.Drawing.<span style="color:#2b91af;">Size</span>(317, 308)<br>
|
||||
<span style="color:blue;">Me</span>.Controls.Add(<span style="color:blue;">Me</span>.AddCustomFileReference)<br>
|
||||
<span style="color:blue;">Me</span>.Controls.Add(<span style="color:blue;">Me</span>.CustRefListBox)<br>
|
||||
<span style="color:blue;">Me</span>.Controls.Add(<span style="color:blue;">Me</span>.BrowseButton)<br>
|
||||
<span style="color:blue;">Me</span>.Controls.Add(<span style="color:blue;">Me</span>.VaultsComboBox)<br>
|
||||
<span style="color:blue;">Me</span>.Controls.Add(<span style="color:blue;">Me</span>.VaultsLabel)<br>
|
||||
<span style="color:blue;">Me</span>.Name = <span style="color:#a31515;">"Form1"</span><br>
|
||||
<span style="color:blue;">Me</span>.Text = <span style="color:#a31515;">"Add custom file references"</span><br>
|
||||
<span style="color:blue;">Me</span>.ResumeLayout(<span style="color:blue;">False</span>)<br>
|
||||
<span style="color:blue;">Me</span>.PerformLayout()<br>
|
||||
<br>
|
||||
<span style="color:blue;">End</span> <span style="color:blue;">Sub</span><br>
|
||||
<br>
|
||||
<span style="color:blue;">#End</span> <span style="color:blue;">Region</span><br>
|
||||
<br>
|
||||
<span style="color:blue;">Friend</span> <span style="color:blue;">WithEvents</span> VaultsLabel <span style="color:blue;">As</span> System.Windows.Forms.<span style="color:#2b91af;">Label</span><br>
|
||||
<span style="color:blue;">Friend</span> <span style="color:blue;">WithEvents</span> VaultsComboBox <span style="color:blue;">As</span> System.Windows.Forms.<span style="color:#2b91af;">ComboBox</span><br>
|
||||
<span style="color:blue;">Friend</span> <span style="color:blue;">WithEvents</span> BrowseButton <span style="color:blue;">As</span> System.Windows.Forms.<span style="color:#2b91af;">Button</span><br>
|
||||
<span style="color:blue;">Friend</span> <span style="color:blue;">WithEvents</span> CustRefListBox <span style="color:blue;">As</span> System.Windows.Forms.<span style="color:#2b91af;">ListBox</span><br>
|
||||
<span style="color:blue;">Friend</span> <span style="color:blue;">WithEvents</span> AddCustomFileReference <span style="color:blue;">As</span> System.Windows.Forms.<span style="color:#2b91af;">Button</span><br>
|
||||
<span style="color:blue;">Friend</span> <span style="color:blue;">WithEvents</span> CustRefOpenFileDialog <span style="color:blue;">As</span> System.Windows.Forms.<span style="color:#2b91af;">OpenFileDialog</span><br>
|
||||
<span style="color:blue;">End</span> <span style="color:blue;">Class</span></p>
|
||||
</font>
|
||||
<p align="center"><a href="#top">Back to top</a></p>
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
Reference in New Issue
Block a user