﻿<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>StrataFrame Forum » StrataFrame Application Framework - V1 » WinForms (How do I?)  » Macro substitution</title><generator>InstantForum 2017-1 Final</generator><description>StrataFrame Forum</description><link>http://forum.strataframe.net/</link><webMaster>StrataFrame Forum</webMaster><lastBuildDate>Tue, 14 Apr 2026 09:22:37 GMT</lastBuildDate><ttl>20</ttl><item><title>Macro substitution</title><link>http://forum.strataframe.net/FindPost1974.aspx</link><description>As a VFP developer, the one thing I have missed the most of my old friend "&amp;amp;".&lt;/P&gt;&lt;P&gt;Trying to build controls and/or objects dynamically then loop through them has proven a real PITA, the closest I&amp;nbsp;have come so far is using .NET's control arrays (not even as easy to use as VB6's, but I digress) which have the limitiation of having to be loaded.&lt;/P&gt;&lt;P&gt;So.... being former VFP developers did you put in anything like this?&lt;/P&gt;&lt;P&gt;for x = 1 to n&amp;nbsp;&lt;/P&gt;&lt;P&gt;l_controlstring = "thisform.txtTextbox" + alltrim(str(n)) + ".backcolor = rgb(255,213,202)"&lt;/P&gt;&lt;P&gt;&amp;amp;l_controlstring&lt;/P&gt;&lt;P&gt;next x&lt;/P&gt;&lt;P&gt;If you did, I'm sold.</description><pubDate>Thu, 06 Oct 2011 08:55:20 GMT</pubDate><dc:creator>Keith Chisarik</dc:creator></item><item><title>RE: Macro substitution</title><link>http://forum.strataframe.net/FindPost30397.aspx</link><description>&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&lt;font color="#000000" size="3" face="Calibri"&gt;&lt;font face="Times New Roman"&gt;Basically I needed to dynamically load an assembly, then call a user control from that assemby. The assembly was not know at design time so it could not be set as a reference at design time. The user control can vary and typically is in a string from a table. IE... not known at design time.&amp;nbsp;Then I needed to pass 3 parameters to the user control dynamically using reflection. Since the user control is not know at design time, I needed to use reflection. The code below shows what I learned from this. Works like a charm.&lt;/font&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;br/&gt;&lt;br/&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&lt;font color="#000000" size="3" face="Calibri"&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&lt;span style="mso-spacerun: yes;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&amp;nbsp;&lt;br/&gt;&lt;br/&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&lt;font color="#000000" size="3" face="Calibri"&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: green;"&gt;//textboxWhere.Text = lcSelect;&lt;/span&gt;&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br/&gt;&lt;br/&gt;&lt;font face="Times New Roman"&gt;&lt;/font&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: green;"&gt;// Here is how to create an instance of a Form class just from knowingits name in a string.&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br/&gt;&lt;br/&gt;&lt;font face="Times New Roman"&gt;&lt;/font&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: green;"&gt;// You can use the System.Reflection.Assembly.CreateInstance method tocreate a form from its name. Below is a code snippet. &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br/&gt;&lt;br/&gt;&lt;font face="Times New Roman"&gt;&lt;/font&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: green;"&gt;// The name in the textbox has to be the full name including itsnamespace. So if there is a class named Form2 in namespace MyCompanyName, &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br/&gt;&lt;br/&gt;&lt;font face="Times New Roman"&gt;&lt;/font&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: green;"&gt;// thenthe textbox would contain MyCompanyName.Form2. This snippet also assumes thatthe class is defined in the current executing assembly. &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br/&gt;&lt;br/&gt;&lt;font face="Times New Roman"&gt;&lt;/font&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: green;"&gt;// If not, you would have to create an instance of the assembly thatcontains the class instead of calling the static method GetExecutingAssembly. &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br/&gt;&lt;br/&gt;&lt;font face="Times New Roman"&gt;&lt;/font&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: green;"&gt;// As noted on this board, using reflection in this manner might affectperformance.&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br/&gt;&lt;br/&gt;&lt;font face="Times New Roman"&gt;&lt;/font&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);"&gt;UserControl&lt;/span&gt; uct;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br/&gt;&lt;br/&gt;&lt;font face="Times New Roman"&gt;&lt;/font&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: green;"&gt;//Assembly tempAssembly = Assembly.GetExecutingAssembly(); &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br/&gt;&lt;br/&gt;&lt;font face="Times New Roman"&gt;&lt;/font&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: green;"&gt;// if class is located in another DLL or EXE, use somethinglike &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br/&gt;&lt;br/&gt;&lt;font face="Times New Roman"&gt;&lt;/font&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: green;"&gt;// Assembly tempAssembly =Assembly.LoadFrom("myDLL.DLL"); &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br/&gt;&lt;br/&gt;&lt;font face="Times New Roman"&gt;&lt;/font&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);"&gt;Assembly&lt;/span&gt; tempAssembly = &lt;span style="background: yellow; color: rgb(43, 145, 175); mso-highlight: yellow;"&gt;Assembly&lt;/span&gt;&lt;span style="background: yellow; mso-highlight: yellow;"&gt;.LoadFrom(&lt;span style="color: rgb(163, 21, 21);"&gt;@"C:\CMTAskAtRuntimeUserControls\CMTAskAtRuntimeUserControls\bin\Release\CMTAskAtRuntimeUserControls.dll"&lt;/span&gt;)&lt;/span&gt;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br/&gt;&lt;br/&gt;&lt;font face="Times New Roman"&gt;&lt;/font&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: green;"&gt;// or &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br/&gt;&lt;br/&gt;&lt;font face="Times New Roman"&gt;&lt;/font&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: green;"&gt;// Assembly tempAssembly =Assembly.LoadFrom("myEXE.exe"); &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br/&gt;&lt;br/&gt;&lt;font face="Times New Roman"&gt;&lt;/font&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: green;"&gt;//Form frm1 = (Form)tempAssembly.CreateInstance(textBox1.Text);// as Form;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br/&gt;&lt;br/&gt;&lt;font face="Times New Roman"&gt;&lt;/font&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: green;"&gt;//frm1.Show(); &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br/&gt;&lt;br/&gt;&lt;font face="Times New Roman"&gt;&lt;/font&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="background: yellow; mso-highlight: yellow;"&gt;uct = (&lt;span style="color: rgb(43, 145, 175);"&gt;UserControl&lt;/span&gt;)tempAssembly.CreateInstance(strAskAtRunTimeUserControl);&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br/&gt;&lt;br/&gt;&lt;font face="Times New Roman"&gt;&lt;/font&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="background: yellow; color: rgb(43, 145, 175); mso-highlight: yellow;"&gt;Type&lt;/span&gt;&lt;span style="background: yellow; mso-highlight: yellow;"&gt; t = uct.GetType();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;br/&gt;&lt;br/&gt;&lt;font face="Times New Roman"&gt;&lt;/font&gt;&lt;span style="background: yellow; font-family: Consolas; font-size: 9.5pt; mso-highlight: yellow;"&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: blue;"&gt;object&lt;/span&gt;[] p = { lcSelect };&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br/&gt;&lt;br/&gt;&lt;font face="Times New Roman"&gt;&lt;/font&gt;&lt;span style="background: yellow; font-family: Consolas; font-size: 9.5pt; mso-highlight: yellow;"&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;t.GetMethod(&lt;span style="color: rgb(163, 21, 21);"&gt;"SetParams"&lt;/span&gt;).Invoke(uct, p);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br/&gt;&lt;br/&gt;&lt;font face="Times New Roman"&gt;&lt;/font&gt;&lt;span style="background: yellow; font-family: Consolas; font-size: 9.5pt; mso-highlight: yellow;"&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: blue;"&gt;object&lt;/span&gt;[] q = { strReportfilename };&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br/&gt;&lt;br/&gt;&lt;font face="Times New Roman"&gt;&lt;/font&gt;&lt;span style="background: yellow; font-family: Consolas; font-size: 9.5pt; mso-highlight: yellow;"&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;t.GetMethod(&lt;span style="color: rgb(163, 21, 21);"&gt;"SetParamsRptFile"&lt;/span&gt;).Invoke(uct, q);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br/&gt;&lt;br/&gt;&lt;font face="Times New Roman"&gt;&lt;/font&gt;&lt;span style="background: yellow; font-family: Consolas; font-size: 9.5pt; mso-highlight: yellow;"&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: blue;"&gt;object&lt;/span&gt;[] r = { strNodetext };&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br/&gt;&lt;br/&gt;&lt;font face="Times New Roman"&gt;&lt;/font&gt;&lt;span style="background: yellow; font-family: Consolas; font-size: 9.5pt; mso-highlight: yellow;"&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;t.GetMethod(&lt;span style="color: rgb(163, 21, 21);"&gt;"SetParamsReportName"&lt;/span&gt;).Invoke(uct, r);&lt;/span&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br/&gt;&lt;br/&gt;&lt;font face="Times New Roman"&gt;&lt;/font&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;panelManagerAskAtRunTime.Controls.Clear();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br/&gt;&lt;br/&gt;&lt;font face="Times New Roman"&gt;&lt;/font&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: green;"&gt;//// what default viewer do you want to use ie... grid orreport.... need to enhance this to show the GRid Viewer&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br/&gt;&lt;br/&gt;&lt;font face="Times New Roman"&gt;&lt;/font&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;Logiware.CMT.Forms.EasyQuery.&lt;span style="color: rgb(43, 145, 175);"&gt;frmReportViewer&lt;/span&gt; frmRpt = &lt;span style="color: blue;"&gt;new&lt;/span&gt;Logiware.CMT.Forms.EasyQuery.&lt;span style="color: rgb(43, 145, 175);"&gt;frmReportViewer&lt;/span&gt;();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br/&gt;&lt;br/&gt;&lt;font face="Times New Roman"&gt;&lt;/font&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;panelManagerAskAtRunTime.Controls.Add(uct);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br/&gt;&lt;br/&gt;&lt;font face="Times New Roman"&gt;&lt;/font&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;uct.Dock = &lt;span style="color: rgb(43, 145, 175);"&gt;DockStyle&lt;/span&gt;.Fill;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br/&gt;&lt;br/&gt;&lt;font face="Times New Roman"&gt;&lt;/font&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;panelManagerAskAtRunTime.Visible = &lt;span style="color: blue;"&gt;true&lt;/span&gt;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br/&gt;&lt;br/&gt;&lt;font face="Times New Roman"&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;br/&gt;&lt;br/&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&lt;font color="#000000" size="3" face="Calibri"&gt;&lt;/font&gt;&lt;/span&gt;&amp;nbsp;&lt;br/&gt;&lt;br/&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&lt;font color="#000000" size="3" face="Calibri"&gt;The code behind the control in this example. This user control is in a totally different class project and is not referenced in the main solution above other than in code. Notice the:&lt;/font&gt;&lt;font color="#000000" size="3" face="Times New Roman"&gt;&lt;/font&gt;&lt;ul&gt;&lt;li&gt;&lt;h6 style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;" class="MsoNormal" align="left"&gt;&lt;p style="margin: 0in 0in 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none;" class="MsoNormal"&gt;&lt;span style="color: blue; font-family: Consolas; font-size: 9.5pt;"&gt;using&lt;/span&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&lt;font color="#000000"&gt; System;&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;font color="#000000" size="3" face="Times New Roman"&gt;&lt;/font&gt;&lt;p style="margin: 0in 0in 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none;" class="MsoNormal"&gt;&lt;span style="color: blue; font-family: Consolas; font-size: 9.5pt;"&gt;using&lt;/span&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&lt;font color="#000000"&gt; System.Collections.Generic;&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;font color="#000000" size="3" face="Times New Roman"&gt;&lt;/font&gt;&lt;p style="margin: 0in 0in 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none;" class="MsoNormal"&gt;&lt;span style="color: blue; font-family: Consolas; font-size: 9.5pt;"&gt;using&lt;/span&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&lt;font color="#000000"&gt; System.ComponentModel;&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;font color="#000000" size="3" face="Times New Roman"&gt;&lt;/font&gt;&lt;p style="margin: 0in 0in 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none;" class="MsoNormal"&gt;&lt;span style="color: blue; font-family: Consolas; font-size: 9.5pt;"&gt;using&lt;/span&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&lt;font color="#000000"&gt; System.Drawing;&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;font color="#000000" size="3" face="Times New Roman"&gt;&lt;/font&gt;&lt;p style="margin: 0in 0in 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none;" class="MsoNormal"&gt;&lt;span style="color: blue; font-family: Consolas; font-size: 9.5pt;"&gt;using&lt;/span&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&lt;font color="#000000"&gt; System.Data;&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;font color="#000000" size="3" face="Times New Roman"&gt;&lt;/font&gt;&lt;p style="margin: 0in 0in 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none;" class="MsoNormal"&gt;&lt;span style="color: blue; font-family: Consolas; font-size: 9.5pt;"&gt;using&lt;/span&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&lt;font color="#000000"&gt; System.Text;&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;font color="#000000" size="3" face="Times New Roman"&gt;&lt;/font&gt;&lt;p style="margin: 0in 0in 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none;" class="MsoNormal"&gt;&lt;span style="color: blue; font-family: Consolas; font-size: 9.5pt;"&gt;using&lt;/span&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&lt;font color="#000000"&gt; System.Windows.Forms;&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;font color="#000000" size="3" face="Times New Roman"&gt;&lt;/font&gt;&lt;p style="margin: 0in 0in 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none;" class="MsoNormal"&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&lt;o:p&gt;&lt;font color="#000000"&gt;&amp;nbsp;&lt;/font&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;font color="#000000" size="3" face="Times New Roman"&gt;&lt;/font&gt;&lt;p style="margin: 0in 0in 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none;" class="MsoNormal"&gt;&lt;span style="color: blue; font-family: Consolas; font-size: 9.5pt;"&gt;namespace&lt;/span&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&lt;font color="#000000"&gt; CMTAskAtRuntimeUserControls&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;font color="#000000" size="3" face="Times New Roman"&gt;&lt;/font&gt;&lt;p style="margin: 0in 0in 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none;" class="MsoNormal"&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&lt;font color="#000000"&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;font color="#000000" size="3" face="Times New Roman"&gt;&lt;/font&gt;&lt;p style="margin: 0in 0in 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none;" class="MsoNormal"&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&lt;span style="mso-spacerun: yes;"&gt;&lt;font color="#000000"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;public&lt;/span&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;span style="color: blue;"&gt;partial&lt;/span&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;span style="color: blue;"&gt;class&lt;/span&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;span style="color: rgb(43, 145, 175);"&gt;uctSalesReport&lt;/span&gt;&lt;font color="#000000"&gt;: MicroFour.StrataFrame.UI.Windows.Forms.&lt;/font&gt;&lt;span style="color: rgb(43, 145, 175);"&gt;UserControl&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;font color="#000000" size="3" face="Times New Roman"&gt;&lt;/font&gt;&lt;p style="margin: 0in 0in 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none;" class="MsoNormal"&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;font color="#000000" size="3" face="Times New Roman"&gt;&lt;/font&gt;&lt;p style="margin: 0in 0in 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none;" class="MsoNormal"&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&lt;span style="mso-spacerun: yes;"&gt;&lt;font color="#000000"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="color: green;"&gt;// just always at least include these although currentlyonly the SQLselect is being passed this may change.&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;font color="#000000" size="3" face="Times New Roman"&gt;&lt;/font&gt;&lt;p style="margin: 0in 0in 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none;" class="MsoNormal"&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&lt;span style="mso-spacerun: yes;"&gt;&lt;font color="#000000"&gt;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0in 0in 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none;" class="MsoNormal"&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&lt;span style="mso-spacerun: yes;"&gt;&lt;font color="#000000"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;public&lt;/span&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;span style="color: blue;"&gt;string&lt;/span&gt;&lt;font color="#000000"&gt;lcSelect { &lt;/font&gt;&lt;span style="color: blue;"&gt;get&lt;/span&gt;&lt;font color="#000000"&gt;; &lt;/font&gt;&lt;span style="color: blue;"&gt;set&lt;/span&gt;&lt;font color="#000000"&gt;;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;font color="#000000" size="3" face="Times New Roman"&gt;&lt;/font&gt;&lt;p style="margin: 0in 0in 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none;" class="MsoNormal"&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&lt;span style="mso-spacerun: yes;"&gt;&lt;font color="#000000"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;public&lt;/span&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;span style="color: blue;"&gt;string&lt;/span&gt;&lt;font color="#000000"&gt; rptFile{ &lt;/font&gt;&lt;span style="color: blue;"&gt;get&lt;/span&gt;&lt;font color="#000000"&gt;; &lt;/font&gt;&lt;span style="color: blue;"&gt;set&lt;/span&gt;&lt;font color="#000000"&gt;; }&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;font color="#000000" size="3" face="Times New Roman"&gt;&lt;/font&gt;&lt;p style="margin: 0in 0in 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none;" class="MsoNormal"&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&lt;span style="mso-spacerun: yes;"&gt;&lt;font color="#000000"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;public&lt;/span&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;span style="color: blue;"&gt;string&lt;/span&gt;&lt;font color="#000000"&gt;reportName { &lt;/font&gt;&lt;span style="color: blue;"&gt;get&lt;/span&gt;&lt;font color="#000000"&gt;; &lt;/font&gt;&lt;span style="color: blue;"&gt;set&lt;/span&gt;&lt;font color="#000000"&gt;;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;font color="#000000" size="3" face="Times New Roman"&gt;&lt;/font&gt;&lt;p style="margin: 0in 0in 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none;" class="MsoNormal"&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&lt;o:p&gt;&lt;font color="#000000"&gt;&amp;nbsp;&lt;/font&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;font color="#000000" size="3" face="Times New Roman"&gt;&lt;/font&gt;&lt;p style="margin: 0in 0in 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none;" class="MsoNormal"&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&lt;span style="mso-spacerun: yes;"&gt;&lt;font color="#000000"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="color: green;"&gt;// here is the spot to set the BO and Binding Source up&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;font color="#000000" size="3" face="Times New Roman"&gt;&lt;/font&gt;&lt;p style="margin: 0in 0in 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none;" class="MsoNormal"&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;Logiware.CMT_DLL.&lt;/font&gt;&lt;span style="color: rgb(43, 145, 175);"&gt;boCompany&lt;/span&gt;&lt;font color="#000000"&gt; bc = &lt;/font&gt;&lt;span style="color: blue;"&gt;new&lt;/span&gt;&lt;font color="#000000"&gt; Logiware.CMT_DLL.&lt;/font&gt;&lt;span style="color: rgb(43, 145, 175);"&gt;boCompany&lt;/span&gt;&lt;font color="#000000"&gt;();&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;font color="#000000" size="3" face="Times New Roman"&gt;&lt;/font&gt;&lt;p style="margin: 0in 0in 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none;" class="MsoNormal"&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;MicroFour.StrataFrame.Business.&lt;/font&gt;&lt;span style="color: rgb(43, 145, 175);"&gt;BusinessBindingSource&lt;/span&gt;&lt;font color="#000000"&gt;bs = &lt;/font&gt;&lt;span style="color: blue;"&gt;new&lt;/span&gt;&lt;font color="#000000"&gt; MicroFour.StrataFrame.Business.&lt;/font&gt;&lt;span style="color: rgb(43, 145, 175);"&gt;BusinessBindingSource&lt;/span&gt;&lt;font color="#000000"&gt;();&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;font color="#000000" size="3" face="Times New Roman"&gt;&lt;/font&gt;&lt;p style="margin: 0in 0in 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none;" class="MsoNormal"&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;font color="#000000" size="3" face="Times New Roman"&gt;&lt;/font&gt;&lt;p style="margin: 0in 0in 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none;" class="MsoNormal"&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&lt;o:p&gt;&lt;font color="#000000"&gt;&amp;nbsp;&lt;/font&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;font color="#000000" size="3" face="Times New Roman"&gt;&lt;/font&gt;&lt;p style="margin: 0in 0in 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none;" class="MsoNormal"&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&lt;span style="mso-spacerun: yes;"&gt;&lt;font color="#000000"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;public&lt;/span&gt;&lt;font color="#000000"&gt; uctSalesReport()&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;font color="#000000" size="3" face="Times New Roman"&gt;&lt;/font&gt;&lt;p style="margin: 0in 0in 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none;" class="MsoNormal"&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;font color="#000000" size="3" face="Times New Roman"&gt;&lt;/font&gt;&lt;p style="margin: 0in 0in 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none;" class="MsoNormal"&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;InitializeComponent();&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;font color="#000000" size="3" face="Times New Roman"&gt;&lt;/font&gt;&lt;p style="margin: 0in 0in 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none;" class="MsoNormal"&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&lt;o:p&gt;&lt;font color="#000000"&gt;&amp;nbsp;&lt;/font&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;font color="#000000" size="3" face="Times New Roman"&gt;&lt;/font&gt;&lt;p style="margin: 0in 0in 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none;" class="MsoNormal"&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;bs.BusinessObject = bc;&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;font color="#000000" size="3" face="Times New Roman"&gt;&lt;/font&gt;&lt;p style="margin: 0in 0in 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none;" class="MsoNormal"&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;bc.FillDataTable(&lt;/font&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;"SELECT * FROMtbl_Company_1"&lt;/span&gt;&lt;font color="#000000"&gt;);&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;font color="#000000" size="3" face="Times New Roman"&gt;&lt;/font&gt;&lt;p style="margin: 0in 0in 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none;" class="MsoNormal"&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&lt;span style="mso-spacerun: yes;"&gt;&lt;font color="#000000"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;this&lt;/span&gt;&lt;font color="#000000"&gt;.dataGridView1.DataSource = bs;&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;font color="#000000" size="3" face="Times New Roman"&gt;&lt;/font&gt;&lt;p style="margin: 0in 0in 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none;" class="MsoNormal"&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;font color="#000000" size="3" face="Times New Roman"&gt;&lt;/font&gt;&lt;p style="margin: 0in 0in 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none;" class="MsoNormal"&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&lt;o:p&gt;&lt;font color="#000000"&gt;&amp;nbsp;&lt;/font&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;font color="#000000" size="3" face="Times New Roman"&gt;&lt;/font&gt;&lt;p style="margin: 0in 0in 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none;" class="MsoNormal"&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&lt;o:p&gt;&lt;font color="#000000"&gt;&amp;nbsp;&lt;/font&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;font color="#000000" size="3" face="Times New Roman"&gt;&lt;/font&gt;&lt;p style="margin: 0in 0in 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none;" class="MsoNormal"&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&lt;span style="mso-spacerun: yes;"&gt;&lt;font color="#000000"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;public&lt;/span&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;span style="color: blue;"&gt;void&lt;/span&gt;&lt;font color="#000000"&gt;SetParams(&lt;/font&gt;&lt;span style="color: blue;"&gt;string&lt;/span&gt;&lt;font color="#000000"&gt; slsl)&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;font color="#000000" size="3" face="Times New Roman"&gt;&lt;/font&gt;&lt;p style="margin: 0in 0in 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none;" class="MsoNormal"&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;font size="3"&gt;&lt;font color="#000000"&gt;&lt;font face="Times New Roman"&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000" size="3" face="Times New Roman"&gt;&lt;/font&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&lt;font color="#000000"&gt;&lt;font size="3" face="Times New Roman"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;lcSelect = slsl;&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/span&gt;&lt;/h6&gt;&lt;/li&gt;&lt;li&gt;&lt;h6 align="left"&gt;&lt;font color="#000000" size="3" face="Times New Roman"&gt;&lt;/font&gt;&lt;p style="margin: 0in 0in 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none;" class="MsoNormal"&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&lt;span style="mso-spacerun: yes;"&gt;&lt;font color="#000000"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;this&lt;/span&gt;&lt;font color="#000000"&gt;.textbox1.Text = lcSelect;&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;font color="#000000" size="3" face="Times New Roman"&gt;&lt;/font&gt;&lt;p style="margin: 0in 0in 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none;" class="MsoNormal"&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;font color="#000000" size="3" face="Times New Roman"&gt;&lt;/font&gt;&lt;p style="margin: 0in 0in 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none;" class="MsoNormal"&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&lt;o:p&gt;&lt;font color="#000000"&gt;&amp;nbsp;&lt;/font&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;font color="#000000" size="3" face="Times New Roman"&gt;&lt;/font&gt;&lt;p style="margin: 0in 0in 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none;" class="MsoNormal"&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&lt;span style="mso-spacerun: yes;"&gt;&lt;font color="#000000"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;public&lt;/span&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;span style="color: blue;"&gt;void&lt;/span&gt;&lt;font color="#000000"&gt;SetParamsRptFile(&lt;/font&gt;&lt;span style="color: blue;"&gt;string&lt;/span&gt;&lt;font color="#000000"&gt; prmRptFile)&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;font color="#000000" size="3" face="Times New Roman"&gt;&lt;/font&gt;&lt;p style="margin: 0in 0in 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none;" class="MsoNormal"&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;font color="#000000" size="3" face="Times New Roman"&gt;&lt;/font&gt;&lt;p style="margin: 0in 0in 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none;" class="MsoNormal"&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;rptFile = prmRptFile;&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;font color="#000000" size="3" face="Times New Roman"&gt;&lt;/font&gt;&lt;p style="margin: 0in 0in 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none;" class="MsoNormal"&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;font color="#000000" size="3" face="Times New Roman"&gt;&lt;/font&gt;&lt;p style="margin: 0in 0in 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none;" class="MsoNormal"&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&lt;o:p&gt;&lt;font color="#000000"&gt;&amp;nbsp;&lt;/font&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;font color="#000000" size="3" face="Times New Roman"&gt;&lt;/font&gt;&lt;p style="margin: 0in 0in 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none;" class="MsoNormal"&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&lt;o:p&gt;&lt;font color="#000000"&gt;&amp;nbsp;&lt;/font&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;font color="#000000" size="3" face="Times New Roman"&gt;&lt;/font&gt;&lt;p style="margin: 0in 0in 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none;" class="MsoNormal"&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&lt;span style="mso-spacerun: yes;"&gt;&lt;font color="#000000"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;public&lt;/span&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;span style="color: blue;"&gt;void&lt;/span&gt;&lt;font color="#000000"&gt;SetParamsReportName(&lt;/font&gt;&lt;span style="color: blue;"&gt;string&lt;/span&gt;&lt;font color="#000000"&gt; prmReportName)&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;font color="#000000" size="3" face="Times New Roman"&gt;&lt;/font&gt;&lt;p style="margin: 0in 0in 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none;" class="MsoNormal"&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;font color="#000000" size="3" face="Times New Roman"&gt;&lt;/font&gt;&lt;p style="margin: 0in 0in 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none;" class="MsoNormal"&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;reportName = prmReportName;&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;font color="#000000" size="3" face="Times New Roman"&gt;&lt;/font&gt;&lt;p style="margin: 0in 0in 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none;" class="MsoNormal"&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;font color="#000000" size="3" face="Times New Roman"&gt;&lt;/font&gt;&lt;p style="margin: 0in 0in 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none;" class="MsoNormal"&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&lt;o:p&gt;&lt;font color="#000000"&gt;&amp;nbsp;&lt;/font&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;font color="#000000" size="3" face="Times New Roman"&gt;&lt;/font&gt;&lt;p style="margin: 0in 0in 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none;" class="MsoNormal"&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&lt;o:p&gt;&lt;font color="#000000"&gt;&amp;nbsp;&lt;/font&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;font color="#000000" size="3" face="Times New Roman"&gt;&lt;/font&gt;&lt;p style="margin: 0in 0in 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none;" class="MsoNormal"&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&lt;span style="mso-spacerun: yes;"&gt;&lt;font color="#000000"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;private&lt;/span&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;span style="color: blue;"&gt;void&lt;/span&gt;&lt;font color="#000000"&gt;toolStripButtonContinue_Click(&lt;/font&gt;&lt;span style="color: blue;"&gt;object&lt;/span&gt;&lt;font color="#000000"&gt; sender, &lt;/font&gt;&lt;span style="color: rgb(43, 145, 175);"&gt;EventArgs&lt;/span&gt;&lt;font color="#000000"&gt; e)&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;font color="#000000" size="3" face="Times New Roman"&gt;&lt;/font&gt;&lt;p style="margin: 0in 0in 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none;" class="MsoNormal"&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;font color="#000000" size="3" face="Times New Roman"&gt;&lt;/font&gt;&lt;p style="margin: 0in 0in 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none;" class="MsoNormal"&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;Logiware.CMT.Forms.EasyQuery.&lt;/font&gt;&lt;span style="color: rgb(43, 145, 175);"&gt;frmReportViewer&lt;/span&gt;&lt;font color="#000000"&gt;frmRpt = &lt;/font&gt;&lt;span style="color: blue;"&gt;new&lt;/span&gt;&lt;font color="#000000"&gt; Logiware.CMT.Forms.EasyQuery.&lt;/font&gt;&lt;span style="color: rgb(43, 145, 175);"&gt;frmReportViewer&lt;/span&gt;&lt;font color="#000000"&gt;();&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;font color="#000000" size="3" face="Times New Roman"&gt;&lt;/font&gt;&lt;p style="margin: 0in 0in 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none;" class="MsoNormal"&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&lt;o:p&gt;&lt;font color="#000000"&gt;&amp;nbsp;&lt;/font&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;font color="#000000" size="3" face="Times New Roman"&gt;&lt;/font&gt;&lt;p style="margin: 0in 0in 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none;" class="MsoNormal"&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&lt;span style="mso-spacerun: yes;"&gt;&lt;font color="#000000"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="color: green;"&gt;//// this will take care of everything to display thereport in the default viewer&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;font color="#000000" size="3" face="Times New Roman"&gt;&lt;/font&gt;&lt;p style="margin: 0in 0in 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none;" class="MsoNormal"&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;Logiware.CMT.ClassLibrary.&lt;/font&gt;&lt;span style="color: rgb(43, 145, 175);"&gt;clsReportViewer&lt;/span&gt;&lt;font color="#000000"&gt;.showReport(lcSelect, frmRpt,rptFile, reportName, lcSelect);&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;font color="#000000" size="3" face="Times New Roman"&gt;&lt;/font&gt;&lt;p style="margin: 0in 0in 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none;" class="MsoNormal"&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;font color="#000000" size="3" face="Times New Roman"&gt;&lt;/font&gt;&lt;p style="margin: 0in 0in 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none;" class="MsoNormal"&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;font color="#000000" size="3" face="Times New Roman"&gt;&lt;/font&gt;&lt;p style="margin: 0in 0in 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none;" class="MsoNormal"&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&lt;font color="#000000"&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;font color="#000000" size="3" face="Times New Roman"&gt;&lt;/font&gt;&lt;p style="margin: 0in 0in 0pt; line-height: normal; text-autospace: ; mso-layout-grid-align: none;" class="MsoNormal"&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&lt;o:p&gt;&lt;font color="#000000"&gt;&amp;nbsp;&lt;/font&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;font color="#000000" size="3" face="Times New Roman"&gt;&lt;/font&gt;&lt;/h6&gt;&lt;/li&gt;&lt;/ul&gt;</description><pubDate>Thu, 06 Oct 2011 08:55:20 GMT</pubDate><dc:creator>Ross L. Rooker, Sr.</dc:creator></item><item><title>RE: Macro substitution</title><link>http://forum.strataframe.net/FindPost2013.aspx</link><description>Good deal.</description><pubDate>Mon, 31 Jul 2006 09:28:09 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: Macro substitution</title><link>http://forum.strataframe.net/FindPost2009.aspx</link><description>I found this out on the net somewhere and the light went on:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;FONT class=k&gt;For&lt;/FONT&gt; i &lt;FONT class=k&gt;As&lt;/FONT&gt; &lt;FONT class=k&gt;Integer&lt;/FONT&gt; = 1 &lt;FONT class=k&gt;To&lt;/FONT&gt; 3 &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;CType(&lt;FONT class=k&gt;Me&lt;/FONT&gt;.Controls(&lt;FONT class=s&gt;"Label"&lt;/FONT&gt; &amp;amp; i), Label).Text = &lt;FONT class=s&gt;"Text Number "&lt;/FONT&gt; &amp;amp; i &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;FONT class=k&gt;Next&lt;/FONT&gt; &lt;/P&gt;&lt;P&gt;I get it............. :D</description><pubDate>Sun, 30 Jul 2006 22:03:33 GMT</pubDate><dc:creator>Keith Chisarik</dc:creator></item><item><title>RE: Macro substitution</title><link>http://forum.strataframe.net/FindPost1983.aspx</link><description>Cool Ill try this all out....... thank you.</description><pubDate>Fri, 28 Jul 2006 23:02:29 GMT</pubDate><dc:creator>Keith Chisarik</dc:creator></item><item><title>RE: Macro substitution</title><link>http://forum.strataframe.net/FindPost1982.aspx</link><description>That is what I am trying to illustrate.&amp;nbsp; TextBox1 is not a direct reference, you could just as easily put in a local variable here.&amp;nbsp; If I wanted to directly reference the TextBox1, there would not have been quotes and I would have made a call like this:&lt;/P&gt;&lt;P&gt;TextBox1.GetType()&lt;/P&gt;&lt;P&gt;Does that make sense?&amp;nbsp; Regardless of VFP or .NET, you have to have some base reference.&amp;nbsp; For example, a form, user control, containter, etc. that you know will exist in order for you to enumerate the controls within it.&amp;nbsp; Or create controls.&amp;nbsp; In your example, your base would be "&lt;FONT color=#1111ff&gt;thisform.pgfCorpInfo.page5" &lt;/FONT&gt;&lt;FONT color=#4b6e9d&gt;which you would then iterate through the Controls collection of this container object and begin using reflection to determine what to do, if anything, with that object.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color=#111111&gt;DIm loControl As Control&lt;BR&gt;Dim loType As System.Type&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color=#111111&gt;For Each loControl In Me.pgfCorpInfo.Page5&lt;BR&gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp; '-- Save off the type of the&amp;nbsp;control&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;loType =&amp;nbsp;loControl.GetType()&lt;BR&gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp; '--&amp;nbsp;See if this control need to be&amp;nbsp;updated&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;If loType.IsSubClassOf(TextBox) Then&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; CType(loControl, TextBox).Text = "MyValue"&lt;BR&gt;&amp;nbsp;&amp;nbsp; ElseIf loType.IsSubClassOf(CheckBox) Then&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; CType(loControl, CheckBox).Checked =&amp;nbsp;True&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;End If&lt;BR&gt;&lt;BR&gt;&lt;BR&gt;Next&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;So in this example you really are not using as much reflection as just making sure that the objects are properly typed.&amp;nbsp; For whatever it is worth, you can do what you are trying to do.&amp;nbsp; You can do practically ANYTHING in .NET.&amp;nbsp; The thing is that you have to properly reflect the objects in order to set them or execute methods.&amp;nbsp; You can test on object names, values, literllay anything.&amp;nbsp; But just as you already knew where you were planning to look in your VFP code, you have to have a point of reference to at least start from before you can reflect to the objects dynamically.</description><pubDate>Fri, 28 Jul 2006 22:59:47 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: Macro substitution</title><link>http://forum.strataframe.net/FindPost1979.aspx</link><description>Great stuff there and I may be dense since it is getting late, but....&lt;/P&gt;&lt;P&gt;You code all has a hardcoded reference like "Textbox1"&lt;/P&gt;&lt;P&gt;How do you make your code flexible so that it can accept any/many controls (ie. TEXTBOX(x) ) with passing an explicit reference to a control:&lt;/P&gt;&lt;P&gt;Here is VFP code I cannot reproduce:&lt;/P&gt;&lt;FONT face="Courier New" color=#0000ff size=2&gt;&lt;P&gt;&lt;FONT face=Verdana color=#1111ff&gt;IF ALLTRIM(this.Value) &amp;lt;&amp;gt; ALLTRIM(g_emailaddress)&lt;BR&gt;&amp;nbsp;For x = 1 To 4 &amp;amp;&amp;amp; 4 contacts&lt;BR&gt;&amp;nbsp;&amp;nbsp;l_fieldname = "thisform.pgfCorpInfo.page5.chkCont"+Alltrim(Str(x))+"_primary.value"&lt;BR&gt;&amp;nbsp;&amp;nbsp;If &amp;amp;l_fieldname = .T.&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;l_emailfield = "thisform.pgfCorpInfo.page5.txtCont"+ALLTRIM(STR(x))+"_email.value"&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;amp;l_emailfield = ALLTRIM(this.value)&lt;BR&gt;&amp;nbsp;&amp;nbsp;Endif&lt;BR&gt;&amp;nbsp;Next x&lt;BR&gt;ENDIF&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face=Verdana color=#1f5080&gt;See how l_fieldname references 4 controls here since I am BUILDING the name? THAT is what I dont get.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face=Verdana color=#1f5080&gt;Replection DOES look awesome though.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;FONT face="Courier New" color=#0000ff size=2&gt;&lt;/FONT&gt;&lt;P&gt;I must not be explaining myself well, but I do promise to buy ya a beer August 11th for putting up with it :)</description><pubDate>Fri, 28 Jul 2006 22:45:44 GMT</pubDate><dc:creator>Keith Chisarik</dc:creator></item><item><title>RE: Macro substitution</title><link>http://forum.strataframe.net/FindPost1977.aspx</link><description>Here is a sample that shows how to start using reflection.&amp;nbsp; This is a very basic sample, but should start giving you an idea of how to use reflection.&amp;nbsp; Honestly, though it may be hard to believe at first, .NET has a much system of communicating with indirect objects.&amp;nbsp; Once you begin to understand the structure of .NET, the VFP macro will seem clumsy and cumbersome....and practically useless :)&amp;nbsp; But believe me, I did not think this at first and I have come a long way since I first wanted to resort back to a weak typed macro.&lt;P&gt;The first method you need to learn about it GetType().&amp;nbsp; This method will be instrisically on every object, regardless of the class or control, in .NET.&amp;nbsp; This is the gateway into reflecting an object or class to get to its properties, methods, events, and so on.&lt;/P&gt;&lt;P&gt;Also, as a side note, you will want to use CType() and GetType() instead of TypeOf.&amp;nbsp; It will be much faster.&amp;nbsp; For example, in your code snippet:&lt;/P&gt;&lt;FONT color=#0000ff size=2&gt;&lt;P&gt;[quote]&lt;FONT color=#0000ff&gt;If&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;TypeOf&lt;/FONT&gt;&lt;FONT size=2&gt; ctr &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Is&lt;/FONT&gt;&lt;FONT size=2&gt; CheckBox &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Then&lt;/FONT&gt;[/quote]&lt;/P&gt;&lt;/FONT&gt;&lt;P&gt;would be faster and more efficient as:&lt;/P&gt;&lt;P&gt;If ctr.GetType() Is GetType(CheckBox) Then&lt;/P&gt;&lt;P&gt;As for the forum questions, press Ctrl+Enter to break for a single line.&amp;nbsp; Enter takes you to a new paragraph.&amp;nbsp; As for tab....sorry:ermm:, you have to use spaces...at least for now.&amp;nbsp; As for code examples, you can copy from .NET and paste it directly into the editor. It will keep the tabs, but you may have to delete the blank lines and add a Ctrl+Enter to get a single line back in.&lt;P&gt;Last thing, instead of passing an array over to your pingit method, you should create a generic list with a reference to your controls.&lt;P&gt;&lt;STRONG&gt;Single Object Type As a CheckBox&lt;BR&gt;&lt;/STRONG&gt;&lt;BR&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#117711&gt;'-- Establish Locals&lt;/FONT&gt;&lt;BR&gt;Dim&lt;/FONT&gt;&lt;FONT color=#000000 size=2&gt; loCheckBoxesOnly &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;As&lt;/FONT&gt;&lt;FONT color=#000000 size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;New&lt;/FONT&gt;&lt;FONT color=#000000 size=2&gt; System.Collections.Generic.List(&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Of&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;FONT color=#000000&gt; CheckBox)&lt;/FONT&gt;&lt;P&gt;loCheckBoxesOnly.Add(&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Me&lt;/FONT&gt;&lt;FONT size=2&gt;.CheckBox1)&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size=2&gt;&lt;STRONG&gt;Any Type Of Control&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size=2&gt;&lt;FONT color=#117711&gt;'-- Establish Locals&lt;BR&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff&gt;Dim&lt;/FONT&gt;&lt;FONT color=#000000 size=2&gt;&amp;nbsp;loAnyControl &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;As&lt;/FONT&gt;&lt;FONT color=#000000 size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;New&lt;/FONT&gt;&lt;FONT color=#000000 size=2&gt; System.Collections.Generic.List(&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Of&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;FONT color=#000000&gt; System.Windows.Forms.Control)&lt;/FONT&gt; &lt;/P&gt;&lt;P&gt;loAnyControl.Add(&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Me&lt;/FONT&gt;&lt;FONT size=2&gt;.CheckBox1)&lt;BR&gt;loAnyControl.Add(&lt;FONT color=#0000ff size=2&gt;Me&lt;/FONT&gt;&lt;FONT size=2&gt;.Textbox1)&lt;BR&gt;loAnyControl.Add(&lt;FONT color=#0000ff size=2&gt;Me&lt;/FONT&gt;&lt;FONT size=2&gt;.Textbox2)&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size=2&gt;I hope this helps.&amp;nbsp; Please let me know if things are still a little fuzzy. My explanation may not be the best.&lt;/P&gt;&lt;/FONT&gt;&lt;/FONT&gt;</description><pubDate>Fri, 28 Jul 2006 22:27:32 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: Macro substitution</title><link>http://forum.strataframe.net/FindPost1976.aspx</link><description>** why dont tabs work in my posts? and why is bouble spacing forced? makes for sloppy code examples **&lt;/P&gt;&lt;P&gt;perhaps a practical example is best:&lt;/P&gt;&lt;P&gt;here is some code I wrote that may explain my need, this is my workaround so far.....&lt;/P&gt;&lt;FONT size=2&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;For&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Each&lt;/FONT&gt;&lt;FONT size=2&gt; ctr &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;In&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Me&lt;/FONT&gt;&lt;FONT size=2&gt;.Controls&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;If&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;TypeOf&lt;/FONT&gt;&lt;FONT size=2&gt; ctr &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Is&lt;/FONT&gt;&lt;FONT size=2&gt; CheckBox &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Then&lt;/P&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;P&gt;curCheckbox = ctr&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;If&lt;/FONT&gt;&lt;FONT size=2&gt; curCheckbox.Checked = &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;True&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Then&lt;/P&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;If&lt;/FONT&gt;&lt;FONT size=2&gt; curCheckbox.Name.Length = 9 &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Then&lt;/P&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;P&gt;checkid = curCheckbox.Name.Substring(curCheckbox.Name.Length - 1, 1)&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Else&lt;/P&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;P&gt;checkid = curCheckbox.Name.Substring(curCheckbox.Name.Length - 2, 2)&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;End&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;If&lt;/P&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;If&lt;/FONT&gt;&lt;FONT size=2&gt; checkid &amp;lt;= 30 &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Then&lt;/P&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;P&gt;texttopass = textarray(Val(checkid) - 1)&lt;/P&gt;&lt;P&gt;labeltopass = labelarray(Val(checkid) - 1)&lt;/P&gt;&lt;P&gt;progresstopass = bararray(Val(checkid) - 1)&lt;/P&gt;&lt;P&gt;pingit(texttopass.Text, progresstopass, labeltopass, curCheckbox, checkid)&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;End&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;If&lt;/P&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;End&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;If&lt;/P&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;End&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;If&lt;/P&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Next&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color=#0000ff size=2&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color=#0000ff size=2&gt;********************************************************************************&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color=#0000ff size=2&gt;I have those arrays of controls textarray&lt;FONT color=#1f5080&gt;, labelarray, and bararrray preloaded with controls that I might want to change the values of in the PINGIT method (I still call them methods,&amp;nbsp;it is&amp;nbsp;really a function/sub). I pass the entire control based on the array index because I dont know how to programatically create a control reference.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color=#0000ff size=2&gt;If VFP I could just pass the index, then build a control reference variable and execute a macro substitution. I cant (or dont know how).&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color=#0000ff size=2&gt;Lets take your options 2 since I think it was the closest.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color=#0000ff size=2&gt;&lt;STRONG&gt;Option 2 - Accessing the Property Directly&lt;BR&gt;&lt;/STRONG&gt;Controls("txtTextBox1").GetType().GetProperty("BackColor")&amp;nbsp;= Color.FromArgb(255,213,202)&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color=#0000ff size=2&gt;How would I do that without hardcoding the "1" in "Textbox1"? What is the name of the control to be changed was for instance pulled from a table?&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color=#0000ff size=2&gt;Do you see what I am getting at?&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color=#0000ff size=2&gt;Thanks for looking.... this isnt just me. The other developers in my office (all still semi-novices as .NET) cant get an elegant equivilant to the flexibility of the VFP macro.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color=#0000ff size=2&gt;I guess the bottom line is how do I dynamically make a reference to a control using variables?&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color=#0000ff size=2&gt;&lt;STRONG&gt;This is wrong but is pseuocode for what I want to do&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color=#0000ff size=2&gt;&lt;STRONG&gt;Dim ctrl as Control&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color=#0000ff size=2&gt;&lt;STRONG&gt;ctrl = "me." + &amp;lt;&amp;lt;variable containing textbox name or part of it (index) &amp;gt;&amp;gt; &lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color=#0000ff size=2&gt;&lt;STRONG&gt;ctrl.text = "some text"&lt;/STRONG&gt;&lt;/P&gt;&lt;/FONT&gt;</description><pubDate>Fri, 28 Jul 2006 20:57:38 GMT</pubDate><dc:creator>Keith Chisarik</dc:creator></item><item><title>RE: Macro substitution</title><link>http://forum.strataframe.net/FindPost1975.aspx</link><description>This is actually quite easy when you know where to look.&amp;nbsp; When I first wanted to do this it was extremely frustrating because I just wanted to create a macro like in VFP and execute it.&amp;nbsp; The good news is that this can be done, in a lot of different ways.&amp;nbsp; It all comes down to reflection and strong-typing.&amp;nbsp; Since VFP is a weak-typed language this was just a matter of combining some text and hoping that you didn't get an error.&amp;nbsp; In .NET, it is equally as easy, but you just have to conform to strong-typing.&amp;nbsp; Let's take your example and turn it into .NET using SF...keep in mind that ThisForm in VFP is not nearly as important in .NET which is referenced by Me.&lt;P&gt;&lt;STRONG&gt;Option 1&lt;BR&gt;&lt;/STRONG&gt;'-- Establish Locals&lt;BR&gt;Dim loControl As System.Windows.Forms.Control&lt;/P&gt;&lt;P&gt;For Each loControl In Me.Controls&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; '-- See if the object is a textbox&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; If loControl.GetType() Is GetType(TextBox)&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; loControl.BackColor = Color.FromArgb(255,213,202)&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; End If&lt;/P&gt;&lt;P&gt;Next&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Option 2 - Accessing the Property Directly&lt;BR&gt;&lt;/STRONG&gt;Controls("txtTextBox1").GetType().GetProperty("BackColor")&amp;nbsp;= Color.FromArgb(255,213,202)&lt;/P&gt;&lt;P&gt;You can also call methods and create objects dynamically using an activator which is similar to macros in VFP.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Sample Class Creation&lt;/STRONG&gt;&lt;BR&gt;'-- Establish Locals&lt;BR&gt;DIm lcCmd As String = "MyClass"&lt;BR&gt;Dim loObj As Object&lt;BR&gt;&lt;BR&gt;'-- Create the class&lt;BR&gt;loObj = Activator.CreateInstance(lcCmd)&lt;/P&gt;&lt;P&gt;The topic you are asking about will be covered to some degree in our class.&amp;nbsp; This is also something we could go on about for a good long while.&amp;nbsp; There are MANY differents to accomplish this, it just depends on what you are attempting to do.&lt;/P&gt;&lt;P&gt;If this doesn't answer your question please let me know.&lt;BR&gt;</description><pubDate>Fri, 28 Jul 2006 20:12:33 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item></channel></rss>