Recent Messages(Msdn,en-US,visualbasic)Recent Messages (Last 20)© 2009 Microsoft Corporation. All rights reserved.Wed, 25 Nov 2009 02:44:00 -0800Recent Messageshttp://social.msdn.microsoft.com/Forums/en-US/vbgeneral/thread/771f13e7-f798-478f-a781-260f816fe734#6aeaf5ee-eba8-4ed8-a5c9-67a8d8972d3chttp://social.msdn.microsoft.com/Forums/en-US/vbgeneral/thread/771f13e7-f798-478f-a781-260f816fe734#6aeaf5ee-eba8-4ed8-a5c9-67a8d8972d3cHarrie KalaChakrahttp://social.msdn.microsoft.com/Profile/en-US/?user=Harrie%20KalaChakraUnable to retain data in DataRepeaterCan u add component to show Listbox or Combobox?? to easily u adding item to the control. If u had listbox or combobox it will very easy adding item. Textbox is not support for list item.<br/>Wed, 25 Nov 2009 02:44:00 Z2009-11-25T02:44:00Zhttp://social.msdn.microsoft.com/Forums/en-US/vbgeneral/thread/bc90b524-55d1-4089-a41c-aadcc2744ccd#d09200e1-971a-4271-8974-2fb4ae4e574ahttp://social.msdn.microsoft.com/Forums/en-US/vbgeneral/thread/bc90b524-55d1-4089-a41c-aadcc2744ccd#d09200e1-971a-4271-8974-2fb4ae4e574aHarrie KalaChakrahttp://social.msdn.microsoft.com/Profile/en-US/?user=Harrie%20KalaChakraNeed help to update source database - access &quot;<span style="font-family:Times New Roman;font-size:small">It seems as if my changes to the table have not been applied to the dataset.</span> &quot;<br/> <br/> <br/> <br/> So, take a look at these sites:<br/> <br/> <a href="http://www.astahost.com/info.php/vbnet-ms-access-interaction-tutorial-part_t12054.html">http://www.astahost.com/info.php/vbnet-ms-access-interaction-tutorial-part_t12054.html</a> <br/> <br/> <a href="http://www.startvbdotnet.com/ado/msaccess.aspx">http://www.startvbdotnet.com/ado/msaccess.aspx</a> <br/> <br/> Learn how to create new table, fetch/retrieve data, and record data to Ms Access. Hope U'll like it ;)<br/> <br/> <br/> <br/> -Harrie-Wed, 25 Nov 2009 02:38:01 Z2009-11-25T02:38:01Zhttp://social.msdn.microsoft.com/Forums/en-US/vbinterop/thread/a47b86be-91ef-43dc-a97e-cce163ab57c1#b50966c4-7973-4d12-8b7e-2f8cb086096ehttp://social.msdn.microsoft.com/Forums/en-US/vbinterop/thread/a47b86be-91ef-43dc-a97e-cce163ab57c1#b50966c4-7973-4d12-8b7e-2f8cb086096eMartin Xie - MSFThttp://social.msdn.microsoft.com/Profile/en-US/?user=Martin%20Xie%20-%20MSFTinterop between vba and vb<span style="font-family:'Verdana', 'sans-serif';color:black;font-size:8pt">Hi drawworkphone,<br/></span><br/><span style="line-height:115%;font-family:'Verdana','sans-serif';color:black;font-size:8pt">Welcome to MSDN forums!<br/></span><br/>Here are some tutorials about Interoperation between VBA and VB.NET for you to check.<br/><br/>KB article: HOW TO Call a VB.NET Class Library from VBA in Microsoft Office<br/><a href="http://support.microsoft.com/kb/317535/en-us">http://support.microsoft.com/kb/317535/en-us</a><br/><br/>Related threads: How to call VBA code from VB.NET application<br/><a href="http://social.msdn.microsoft.com/forums/en-US/isvvba/thread/71ce4353-b6ea-445e-9eda-8964f8ba2adc/">http://social.msdn.microsoft.com/forums/en-US/isvvba/thread/71ce4353-b6ea-445e-9eda-8964f8ba2adc/</a><br/><a href="http://social.msdn.microsoft.com/forums/en/vbgeneral/thread/4804a5cd-78b2-47ce-a6e6-684e9c3834b6/">http://social.msdn.microsoft.com/forums/en/vbgeneral/thread/4804a5cd-78b2-47ce-a6e6-684e9c3834b6/</a><br/><br/><br/> <p class=MsoNormal style="line-height:normal;margin:0in 0in 0pt"><span style="font-family:'Verdana', 'sans-serif';color:black;font-size:8pt"><br/>Best regards,<br/>Martin Xie</span><span style="font-family:'Verdana', 'sans-serif';color:#1f497d;font-size:8pt"> </span></p> <p class=MsoNormal style="line-height:normal;margin:0in 0in 0pt"><span style="font-family:'Verdana', 'sans-serif';color:#1f497d;font-size:8pt"><a href="http://msdn.microsoft.com/en-us/subscriptions/aa974230.aspx"><span style="color:blue">MSDN Subscriber Support</span></a> </span><span style="font-family:'Verdana', 'sans-serif';color:black;font-size:8pt">in Forum</span></p> <p class=MsoNormal style="line-height:normal;margin:0in 0in 6.7pt"><span style="font-family:'Verdana', 'sans-serif';color:black;font-size:8pt">If you have any feedback on our support, please contact</span><span style="font-family:'Verdana', 'sans-serif';color:#1f497d;font-size:8pt"> <a href="mailto:msdnmg@microsoft.com"><span style="color:blue">msdnmg@microsoft.com</span></a> </span></p><hr class="sig">Please remember to mark the replies as answers if they help and unmark them if they provide no help. <br/> <a href="http://cfx.codeplex.com/">Welcome to the All-In-One Code Framework!</a> If you have any feedback, please tell us.Wed, 25 Nov 2009 02:35:46 Z2009-11-25T02:35:46Zhttp://social.msdn.microsoft.com/Forums/en-US/vbgeneral/thread/c7cf0a07-9bf7-4a7a-aae9-72f0b921a696#481f599f-dbb0-47d4-a768-e25613d383eahttp://social.msdn.microsoft.com/Forums/en-US/vbgeneral/thread/c7cf0a07-9bf7-4a7a-aae9-72f0b921a696#481f599f-dbb0-47d4-a768-e25613d383eaAcamarhttp://social.msdn.microsoft.com/Profile/en-US/?user=AcamarHow To Change Code For Communication USB Port in VB6 to VB.NET?Do you have the Agilent documentation that gives the declaration of the iopen, iwrite and iread functions, and describes how to use them?   If this information can be provided, someone may be able to suggest how the above code could be rewritten for .Net.  <br/><br/>The code is nearly legal for .Net, so it is only the functioning that needs to be considered, and without knowing what a usbinfo is or what a usbcapinfo is, there is no way to convert it to .Net.<br/><br/>Vb.Net doesn't support fixed length strings, so<br/>  Dim buf As String * 100<br/>becomes <br/>  Dim buf As String<br/>  Buf = Space(100)<br/>and<br/>  Dim strres As String<br/>becomes <br/>  Dim strres As String<br/>  strres = Space(80)<br/><br/>but beyond that it is entirely dependant on those Agilent functions and those two usb types.<br/>Wed, 25 Nov 2009 02:23:32 Z2009-11-25T02:23:32Zhttp://social.msdn.microsoft.com/Forums/en-US/vbgeneral/thread/771f13e7-f798-478f-a781-260f816fe734#94534eb1-8955-4b5e-9828-d029db02bd37http://social.msdn.microsoft.com/Forums/en-US/vbgeneral/thread/771f13e7-f798-478f-a781-260f816fe734#94534eb1-8955-4b5e-9828-d029db02bd37Davidnewbhttp://social.msdn.microsoft.com/Profile/en-US/?user=DavidnewbUnable to retain data in DataRepeater<p>It didn't work. I am cloning the txtBox control in itemTemplate each time I add an item. The problem is that when I scroll up and down, the text in the txtBox control disapears. I thried to assign the datasource to dataRepeater but that failed too.</p> <p>Any other suggestions?</p>Wed, 25 Nov 2009 01:46:26 Z2009-11-25T02:44:00Zhttp://social.msdn.microsoft.com/Forums/en-US/vbgeneral/thread/c7cf0a07-9bf7-4a7a-aae9-72f0b921a696#37ee82d9-ac8b-4b77-ada8-3e7cd1e49f11http://social.msdn.microsoft.com/Forums/en-US/vbgeneral/thread/c7cf0a07-9bf7-4a7a-aae9-72f0b921a696#37ee82d9-ac8b-4b77-ada8-3e7cd1e49f11eifadanhttp://social.msdn.microsoft.com/Profile/en-US/?user=eifadanHow To Change Code For Communication USB Port in VB6 to VB.NET?can you change this code to vb.net for me?i don't know how to change it because the code it very different for me.i hope you can help me for give step for go on...i also checked with Agilent whether for use example but it not help me for change this code.Wed, 25 Nov 2009 01:35:06 Z2009-11-25T02:23:32Zhttp://social.msdn.microsoft.com/Forums/en-US/vbgeneral/thread/c7cf0a07-9bf7-4a7a-aae9-72f0b921a696#2fe5351a-4c4c-4922-8425-520bfaccf847http://social.msdn.microsoft.com/Forums/en-US/vbgeneral/thread/c7cf0a07-9bf7-4a7a-aae9-72f0b921a696#2fe5351a-4c4c-4922-8425-520bfaccf847kaymafhttp://social.msdn.microsoft.com/Profile/en-US/?user=kaymafHow To Change Code For Communication USB Port in VB6 to VB.NET?<blockquote><br/>    <br/>    ' Change the value of siclAddr to refer to the USB device of<br/>    ' your choice.  Note that for simplicity, we are using an<br/>    ' alias name rather than the much longer standard open string.<br/>    ' Consult the Agilent Connectivity Expert for the interface names<br/>    '    and instrument addresses on your PC.<br/>    siclAddr = &quot;USB1&quot;<br/>    <br/>       id = iopen(siclAddr)<br/>    status = iwrite(id, buf, datalen, 1, 0&amp;)<br/>    status = iread(id, strres, 80, 0&amp;, actual)<br/>   <br/></blockquote> You have to consult Agilent for iopen/iwrite/iread method implementation before you can convert it to .net<br/><br/>kaymaf<hr class="sig">If that what you want, take it. If not, ignored it and no complainWed, 25 Nov 2009 01:33:29 Z2009-11-25T01:33:29Zhttp://social.msdn.microsoft.com/Forums/en-US/vbgeneral/thread/cdd6f53e-0140-41ef-ad13-be2a8e20cc6a#0229b81d-4a9f-4e7d-b4c9-954b0b7d86a7http://social.msdn.microsoft.com/Forums/en-US/vbgeneral/thread/cdd6f53e-0140-41ef-ad13-be2a8e20cc6a#0229b81d-4a9f-4e7d-b4c9-954b0b7d86a7kaymafhttp://social.msdn.microsoft.com/Profile/en-US/?user=kaymafHow to change this VB cord to VB.net cord<blockquote><br/>    <br/>    ' Change the value of siclAddr to refer to the USB device of<br/>    ' your choice.  Note that for simplicity, we are using an<br/>    ' alias name rather than the much longer standard open string.<br/>    ' Consult the Agilent Connectivity Expert for the interface names<br/>    '    and instrument addresses on your PC.<br/>    siclAddr = &quot;USB1&quot;<br/>    <br/>       id = iopen(siclAddr)<br/>    status = iwrite(id, buf, datalen, 1, 0&amp;)<br/>    status = iread(id, strres, 80, 0&amp;, actual)<br/>   <br/></blockquote> You have to consult Agilent for iopen/iwrite/iread method implementation before you can convert it to .net<br/><br/>kaymaf<hr class="sig">If that what you want, take it. If not, ignored it and no complainWed, 25 Nov 2009 01:32:43 Z2009-11-25T01:32:43Zhttp://social.msdn.microsoft.com/Forums/en-US/vblanguage/thread/03eab6c8-0aa9-4724-ae75-b73a832470e5#ae115942-e8b5-4008-bc21-69e510984103http://social.msdn.microsoft.com/Forums/en-US/vblanguage/thread/03eab6c8-0aa9-4724-ae75-b73a832470e5#ae115942-e8b5-4008-bc21-69e510984103Lingzhi Sunhttp://social.msdn.microsoft.com/Profile/en-US/?user=Lingzhi%20SunSimple Linq to XML question<p class=MsoNormal style="margin:0in 0in 0pt"><span style="font-size:12pt"><span style="font-family:Calibri">Hello Erik,</span></span></p> <p class=MsoNormal style="margin:0in 0in 0pt"><span style="font-size:12pt"><span style="font-family:Calibri"> </span></span></p> <p class=MsoNormal style="margin:0in 0in 0pt"><span style="font-size:12pt"><span style="font-family:Calibri">Welcome to Visual Basic Language forum!</span></span></p> <p class=MsoNormal style="margin:0in 0in 0pt"><span style="font-size:12pt"><span style="font-family:Calibri"> </span></span></p> <p class=MsoNormal style="margin:0in 0in 0pt"><span style="font-size:12pt"><span style="font-family:Calibri">I think the most difficult part in this problem is the namespace of the XML nodes and attributes.<span style="">  </span>In LINQ to XML, to retrieve certain XElement or XAttribute, we need to set their namespace correctly.<span style="">  </span>For detail, please see </span><a href="http://msdn.microsoft.com/en-us/library/bb387093.aspx"><span style="font-family:Calibri">http://msdn.microsoft.com/en-us/library/bb387093.aspx</span></a><span style="font-family:Calibri">.<span style="">   </span></span></span></p> <p class=MsoNormal style="margin:0in 0in 0pt"><span style="font-size:12pt"><span style="font-family:Calibri"> </span></span></p> <p class=MsoNormal style="margin:0in 0in 0pt"><span style="font-size:12pt"><span style="font-family:Calibri">Here are some sample codes to retrieve the Name, Value elements and the type attribute of the Value element: (The text is loaded from a txt file)</span></span></p> <p class=MsoNormal style="margin:0in 0in 0pt"><span style="font-size:12pt"><span style="font-family:Calibri">============================================================================<br/></span></span><span style="font-family:新宋体;color:blue;font-size:9pt"><span style="">        </span>Dim</span><span style="font-family:新宋体;font-size:9pt"> reader = <span style="color:blue">New</span> StreamReader(<span style="color:#a31515">&quot;XML.txt&quot;</span>)</span></p> <p class=MsoNormal style="margin:0in 0in 0pt"><span style="font-family:新宋体;font-size:9pt"><span style="">        </span><span style="color:blue">Dim</span> text = reader.ReadToEnd()</span></p> <p class=MsoNormal style="margin:0in 0in 0pt"><span style="font-family:新宋体;font-size:9pt"><span style="">        </span>reader.Close()</span></p> <p class=MsoNormal style="margin:0in 0in 0pt"><span style="font-family:新宋体;font-size:9pt"> </span></p> <p class=MsoNormal style="margin:0in 0in 0pt"><span style="font-family:新宋体;font-size:9pt"><span style="">        </span><span style="color:blue">Dim</span> ns <span style="color:blue">As</span> XNamespace = <span style="color:#a31515">&quot;urn:schemas-microsoft-com:xml-analysis&quot;</span></span></p> <p class=MsoNormal style="margin:0in 0in 0pt"><span style="font-family:新宋体;font-size:9pt"><span style="">        </span><span style="color:blue">Dim</span> xsi <span style="color:blue">As</span> XNamespace = <span style="color:#a31515">&quot;http://www.w3.org/2001/XMLSchema-instance&quot;</span></span></p> <p class=MsoNormal style="margin:0in 0in 0pt"><span style="font-family:新宋体;font-size:9pt"><span style="">        </span><span style="color:blue">Dim</span> xsd <span style="color:blue">As</span> XNamespace = <span style="color:#a31515">&quot;http://www.w3.org/2001/XMLSchema&quot;</span></span></p> <p class=MsoNormal style="margin:0in 0in 0pt"><span style="font-family:新宋体;font-size:9pt"><span style="">        </span><span style="color:blue">Dim</span> root = XElement.Parse(text)</span></p> <p class=MsoNormal style="margin:0in 0in 0pt"><span style="font-family:新宋体;font-size:9pt"><span style="">        </span><span style="color:blue">Dim</span> name <span style="color:blue">As</span> XElement = <span style="color:blue">Nothing</span></span></p> <p class=MsoNormal style="margin:0in 0in 0pt"><span style="font-family:新宋体;font-size:9pt"><span style="">        </span><span style="color:blue">Dim</span> value <span style="color:blue">As</span> XElement = <span style="color:blue">Nothing</span></span></p> <p class=MsoNormal style="margin:0in 0in 0pt"><span style="font-family:新宋体;font-size:9pt"><span style="">        </span><span style="color:blue">Dim</span> type <span style="color:blue">As</span> XAttribute = <span style="color:blue">Nothing</span></span></p> <p class=MsoNormal style="margin:0in 0in 0pt"><span style="font-family:新宋体;font-size:9pt"><span style="">        </span><span style="color:blue">For</span> <span style="color:blue">Each</span> element <span style="color:blue">In</span> root.Elements(<strong style="">ns + <span style="color:#a31515">&quot;Parameter&quot;</span></strong>)</span></p> <p class=MsoNormal style="margin:0in 0in 0pt"><span style="font-family:新宋体;font-size:9pt"><span style="">            </span>name = element.Element(<strong style="">ns + <span style="color:#a31515">&quot;Name&quot;</span></strong>)</span></p> <p class=MsoNormal style="margin:0in 0in 0pt"><span style="font-family:新宋体;font-size:9pt"><span style="">            </span>Console.WriteLine(<span style="color:#a31515">&quot;Name: {0}&quot;</span>, name.Value)</span></p> <p class=MsoNormal style="margin:0in 0in 0pt"><span style="font-family:新宋体;font-size:9pt"><span style="">            </span>value = element.Element(<strong style="">ns + <span style="color:#a31515">&quot;Value&quot;</span></strong>)</span></p> <p class=MsoNormal style="margin:0in 0in 0pt"><span style="font-family:新宋体;font-size:9pt"><span style="">            </span>type = value.Attribute(<strong style="">xsi + <span style="color:#a31515">&quot;type&quot;</span></strong>)</span></p> <p class=MsoNormal style="margin:0in 0in 0pt"><span style="font-family:新宋体;font-size:9pt"><span style="">            </span>Console.WriteLine(<span style="color:#a31515">&quot;Value: {0}<span style="">   </span>Type:{1}&quot;</span>, value.Value, type.Value.Replace(<span style="color:#a31515">&quot;xsd&quot;</span>, xsd.ToString()))</span></p> <p class=MsoNormal style="margin:0in 0in 0pt"><span style="font-family:新宋体;font-size:9pt"><span style="">        </span><span style="color:blue">Next</span></span><span style="font-size:12pt"><br/><span style="font-family:Calibri">============================================================================</span></span></p> <p class=MsoNormal style="margin:0in 0in 0pt"><span style="font-size:12pt"><span style="font-family:Calibri"> </span></span></p> <p class=MsoNormal style="margin:0in 0in 0pt"><span style="font-size:12pt"><span style="font-family:Calibri">If you have any questions, please feel free to let me know.</span></span></p> <p class=MsoNormal style="margin:0in 0in 0pt"><span style="font-size:12pt"><span style="font-family:Calibri"> </span></span></p> <p class=MsoNormal style="margin:0in 0in 0pt"><span style="font-size:12pt"><span style="font-family:Calibri">Have a great day!</span></span></p> <p class=MsoNormal style="margin:0in 0in 0pt"><span style="font-size:12pt"><span style="font-family:Calibri"> </span></span></p> <p class=MsoNormal style="margin:0in 0in 0pt"><span style="font-size:12pt"><span style="font-family:Calibri"> </span></span></p> <p class=MsoNormal style="margin:0in 0in 0pt"><span style="font-size:12pt"><span style="font-family:Calibri">Best Regards,<br/>Lingzhi Sun</span></span></p> <p class=MsoNormal style="margin:0in 0in 0pt"><span style="color:#1f497d;font-size:12pt"><a href="http://msdn.microsoft.com/en-us/subscriptions/aa974230.aspx"><span style="font-family:Calibri">MSDN Subscriber Support</span></a><span style="font-family:Calibri"> </span></span><span style="font-size:12pt"><span style="font-family:Calibri">in Forum<span style="color:#1f497d"></span></span></span></p> <p class=MsoNormal style="margin:0in 0in 0pt"><span style="font-size:12pt"><span style="font-family:Calibri">If you have any feedback on our support, please contact<span style="color:#1f497d"> </span></span></span><span style="font-family:'Verdana','sans-serif';color:black;font-size:10pt"><a href="mailto:msdnmg@microsoft.com"><span style="color:#0000ff">msdnmg@microsoft.com</span></a></span></p><hr class="sig">Please remember to mark the replies as answers if they help and unmark them if they provide no help. <br/> <a href="http://cfx.codeplex.com/">Welcome to the All-In-One Code Framework!</a> If you have any feedback, please tell us. <br/>Wed, 25 Nov 2009 01:23:25 Z2009-11-25T01:23:25Zhttp://social.msdn.microsoft.com/Forums/en-US/vbgeneral/thread/c7cf0a07-9bf7-4a7a-aae9-72f0b921a696#1b0b50a8-3bca-4c4a-996a-e45d381d4e43http://social.msdn.microsoft.com/Forums/en-US/vbgeneral/thread/c7cf0a07-9bf7-4a7a-aae9-72f0b921a696#1b0b50a8-3bca-4c4a-996a-e45d381d4e43Acamarhttp://social.msdn.microsoft.com/Profile/en-US/?user=AcamarHow To Change Code For Communication USB Port in VB6 to VB.NET?iopen, iwrite and iread are Agilent functions.   Tto use them in .Net you will need details of the function declaration - parameters, return types etc.   Although it is possible to guess what these might be from the VB6 code, it would be prefereable to use the original documentation.    Have you checked with Agilent whether they have examples of the use of these finctions in .Net?Wed, 25 Nov 2009 01:18:44 Z2009-11-25T01:35:06Zhttp://social.msdn.microsoft.com/Forums/en-US/vbgeneral/thread/cdd6f53e-0140-41ef-ad13-be2a8e20cc6a#e0173777-3a62-4331-994f-a5ef5cb1121ehttp://social.msdn.microsoft.com/Forums/en-US/vbgeneral/thread/cdd6f53e-0140-41ef-ad13-be2a8e20cc6a#e0173777-3a62-4331-994f-a5ef5cb1121eeifadanhttp://social.msdn.microsoft.com/Profile/en-US/?user=eifadanHow to change this VB cord to VB.net cordHello...John can you help me?i also to change the vb6 code in vb.net.but i not understand about vb.net.can you help me?<br/>This is vb6 code:<br/><br/>Dim id As Integer<br/>    Dim status As Integer<br/>    Dim res As Integer<br/>    Dim buf As String * 100<br/>    Dim result As Long<br/>    Dim setting As Long<br/>    Dim strres As String * 80<br/>    Dim actual As Long<br/>    Dim datalen As Long<br/>    Dim retcnt As Integer<br/>    Dim siclAddr As String<br/>    Dim info As usbinfo<br/>    Dim capinfo As usbcapinfo<br/>    <br/>    ' Change the value of siclAddr to refer to the USB device of<br/>    ' your choice.  Note that for simplicity, we are using an<br/>    ' alias name rather than the much longer standard open string.<br/>    ' Consult the Agilent Connectivity Expert for the interface names<br/>    '    and instrument addresses on your PC.<br/>    siclAddr = &quot;USB1&quot;<br/>    <br/>    strres = &quot; &quot;<br/>    buf = &quot;SENS:DIG:DATA:BYTE? (@101)&quot; + Chr$(10)<br/>     datalen = Len(&quot;SENS:DIG:DATA:BYTE? (@101)&quot; + Chr$(10))<br/> '   datalen = Len(buf)<br/>    id = iopen(siclAddr)<br/>    status = iwrite(id, buf, datalen, 1, 0&amp;)<br/>    status = iread(id, strres, 80, 0&amp;, actual)<br/>    'MsgBox &quot;Result is: &quot; + strres, vbOKOnly, &quot;Channel Input&quot;<br/>    <br/>    status = iclose(id)<br/>    Label5.Caption = strres<br/><br/>You can email me <a href="mailto:eifadan_89@yahoo.com.my">eifadan_89@yahoo.com.my</a> .Thanks if you can help me...Wed, 25 Nov 2009 01:18:27 Z2009-11-25T01:32:43Zhttp://social.msdn.microsoft.com/Forums/en-US/vbgeneral/thread/e28abf33-2005-44ef-a35e-6f52a90d4507#db8a8baa-f7f6-445f-9a05-7de2a3e0c7e9http://social.msdn.microsoft.com/Forums/en-US/vbgeneral/thread/e28abf33-2005-44ef-a35e-6f52a90d4507#db8a8baa-f7f6-445f-9a05-7de2a3e0c7e9jwavilahttp://social.msdn.microsoft.com/Profile/en-US/?user=jwavilasave textbox to disk in VB.NET?most likely because you left the savefiledialog.ShowDialog line in your original code<br/><br/>take that line out<br/><br/>it is in the If statementWed, 25 Nov 2009 01:14:17 Z2009-11-25T01:14:17Zhttp://social.msdn.microsoft.com/Forums/en-US/vbgeneral/thread/4714c7f0-69e5-4633-8f3f-7c6054fa5b9b#011323e9-38ac-4974-ab7d-760638c72a09http://social.msdn.microsoft.com/Forums/en-US/vbgeneral/thread/4714c7f0-69e5-4633-8f3f-7c6054fa5b9b#011323e9-38ac-4974-ab7d-760638c72a09John Anthony Oliverhttp://social.msdn.microsoft.com/Profile/en-US/?user=John%20Anthony%20Oliverreturn values to the calling formHi MeetP,<br/> <br/> If you simply need to act on an action you can call a FORM<br/>  using ShowDialog and then act the DialogResult.&gt;&gt;<br/> <br/> <br/> 'Code in FORM1 &gt;&gt;<br/> <br/> <pre lang=x-vbnet>Option Strict On Option Explicit On Public Class Form1 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim Frm2 As New Form2 'Another way is to call a FORM using ShowDialog 'and get the result.&gt;&gt; Dim Result As DialogResult = Frm2.ShowDialog 'You could use a SELECT-CASE block if you use 'all 8 variations of a DialogResult.&gt;&gt; Select Case Result Case Windows.Forms.DialogResult.Abort Case Windows.Forms.DialogResult.Cancel Case Windows.Forms.DialogResult.Ignore Case Windows.Forms.DialogResult.Yes Case Windows.Forms.DialogResult.No Case Windows.Forms.DialogResult.None Case Windows.Forms.DialogResult.OK Case Windows.Forms.DialogResult.Retry End Select End Sub End Class</pre> <br/> <br/> <br/> <br/> <br/> Code in FORM2 &gt;&gt;<br/> <br/> <pre lang=x-vbnet>Public Class Form2 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click DialogResult = Windows.Forms.DialogResult.OK End Sub End Class</pre> <br/> <br/> Regards,<br/> <br/> John<br/> <hr class=sig> I'm currently looking for work in Vb.Net software development. :-)Wed, 25 Nov 2009 01:02:42 Z2009-11-25T01:04:32Zhttp://social.msdn.microsoft.com/Forums/en-US/vbgeneral/thread/c7cf0a07-9bf7-4a7a-aae9-72f0b921a696#c7cf0a07-9bf7-4a7a-aae9-72f0b921a696http://social.msdn.microsoft.com/Forums/en-US/vbgeneral/thread/c7cf0a07-9bf7-4a7a-aae9-72f0b921a696#c7cf0a07-9bf7-4a7a-aae9-72f0b921a696eifadanhttp://social.msdn.microsoft.com/Profile/en-US/?user=eifadanHow To Change Code For Communication USB Port in VB6 to VB.NET?I have 1 project to comunication with usb port in VB.NET.But now,i have code VB6 and then i want to change the code VB6 to VB.NET.can any body to help me for change the code to VB.NET?please email: <a href="mailto:eifadan_89@yahoo.com.my">eifadan_89@yahoo.com.my</a><br/>This is code in VB6:<br/><br/>    Dim id As Integer<br/>    Dim status As Integer<br/>    Dim res As Integer<br/>    Dim buf As String * 100<br/>    Dim result As Long<br/>    Dim setting As Long<br/>    Dim strres As String * 80<br/>    Dim actual As Long<br/>    Dim datalen As Long<br/>    Dim retcnt As Integer<br/>    Dim siclAddr As String<br/>    Dim info As usbinfo<br/>    Dim capinfo As usbcapinfo<br/>    <br/>    ' Change the value of siclAddr to refer to the USB device of<br/>    ' your choice.  Note that for simplicity, we are using an<br/>    ' alias name rather than the much longer standard open string.<br/>    ' Consult the Agilent Connectivity Expert for the interface names<br/>    '    and instrument addresses on your PC.<br/>    siclAddr = &quot;USB1&quot;<br/>    <br/>    strres = &quot; &quot;<br/>    buf = &quot;SENS:DIG:DATA:BYTE? (@101)&quot; + Chr$(10)<br/>     datalen = Len(&quot;SENS:DIG:DATA:BYTE? (@101)&quot; + Chr$(10))<br/> '   datalen = Len(buf)<br/>    id = iopen(siclAddr)<br/>    status = iwrite(id, buf, datalen, 1, 0&amp;)<br/>    status = iread(id, strres, 80, 0&amp;, actual)<br/>    'MsgBox &quot;Result is: &quot; + strres, vbOKOnly, &quot;Channel Input&quot;<br/>    <br/>    status = iclose(id)<br/>    Label5.Caption = strresWed, 25 Nov 2009 00:57:09 Z2009-11-25T01:18:44Zhttp://social.msdn.microsoft.com/Forums/en-US/vbgeneral/thread/7a8f4c90-3d42-472e-b24a-218204f23159#338f0246-1604-4c62-b37f-cb8460fe5dc9http://social.msdn.microsoft.com/Forums/en-US/vbgeneral/thread/7a8f4c90-3d42-472e-b24a-218204f23159#338f0246-1604-4c62-b37f-cb8460fe5dc9Rudedog2http://social.msdn.microsoft.com/Profile/en-US/?user=Rudedog2Dynamic IF statements<p><br/>Public Interface ICondition<br/>    Function TestCondition(ByVal input As String) As Boolean<br/>End Interface</p> <p>Public Delegate Function Test() As Boolean</p> <p>Public Interface IPerformAction<br/>    Sub PerformAction(ByVal test As Test)<br/>End Interface</p> <p>Public Interface ITestStrategy : Inherits ICondition, IPerformAction</p> <p>End Interface</p> <p>Public MustInherit Class TestConditons : Implements ITestStrategy<br/>    Private condition As ICondition<br/>    Private test As IPerformAction<br/>    Public Sub New(ByVal condition As ICondition, ByVal test As IPerformAction)<br/>        Me.condition = condition<br/>        Me.test = test<br/>    End Sub<br/>    Public Function TestCondition(ByVal input As String) As Boolean Implements ICondition.TestCondition<br/>        Return condition.TestCondition(input)<br/>    End Function</p> <p>    Public Sub PerformTest(ByVal test As Test) Implements IPerformAction.PerformAction<br/>        test.Invoke()<br/>    End Sub<br/>End Class<br/><br/><br/>Hope this starts a brainstorm.<br/><br/>Rudedog  =8^D</p><hr class="sig">Mark the best replies as answers. &quot;Fooling computers since 1971.&quot; Wed, 25 Nov 2009 00:20:20 Z2009-11-25T02:17:12Zhttp://social.msdn.microsoft.com/Forums/en-US/vbgeneral/thread/4cc9c0a4-7293-4f76-bac6-4a897e99ca0e#d1379a7e-1d24-4b66-a9cd-b4a086bd9035http://social.msdn.microsoft.com/Forums/en-US/vbgeneral/thread/4cc9c0a4-7293-4f76-bac6-4a897e99ca0e#d1379a7e-1d24-4b66-a9cd-b4a086bd9035John Anthony Oliverhttp://social.msdn.microsoft.com/Profile/en-US/?user=John%20Anthony%20OliverPrinting to LPT1 in vb.net 2003<blockquote> <p>I am writing a POS application using vb.net 2003 and need to print 3 or 4 lines of information (complete with formatting instructions) to an attached parallel printer.  Here are the specifics:<br/> <br/> 1.  Printer is a Practictical Automation CLTX2003 parallel thermal printer<br/> 2.  Formatting instructions accomplished using <strong><span style="text-decoration:underline">Friendly Ghost Language (FGL)</span> </strong> <br/> 3.  No dialog boxes should open for user confirmation or input<br/> 4.  Would prefer to print each line (with its formating instructions) directly to the printer<br/> <br/> If there is someone who is able to help with the code (including all declarations) I would greatly appreciate it.  I have tried using Open &quot;LPT1:&quot; As #1 . . . . and all I get is several items shown as &quot;Undeclared&quot;.<br/> <br/> Tired of going home with a headache!!!!</p> </blockquote> <br/> Hi again George,<br/> <br/> Sorry I can't answer every question. :-(<br/> <br/> One way I know how to send a file like a text file to a<br/>  parallel printer is to redirect it using a CMD window like this.&gt;&gt;<br/> <br/> <br/> <img src="http://i13.photobucket.com/albums/a272/u-might-want-this/CmdWindow.jpg" alt=""> <br/> <br/> It is easy enough to write a text file in VB.NET.<br/> <br/> I do not know <strong><span style="text-decoration:underline">Friendly Ghost Language (FGL)</span> </strong> however.<br/> <br/> Maybe someone that knows FGL could use the above idea with VB.Net.<br/> <br/> <br/> Regards,<br/> <br/> John<br/><hr class="sig">I'm currently looking for work in Vb.Net software development. :-) Wed, 25 Nov 2009 00:13:22 Z2009-11-25T00:13:22Zhttp://social.msdn.microsoft.com/Forums/en-US/vbgeneral/thread/e28abf33-2005-44ef-a35e-6f52a90d4507#22396472-95ac-4e2b-872b-934fd9b2b34ehttp://social.msdn.microsoft.com/Forums/en-US/vbgeneral/thread/e28abf33-2005-44ef-a35e-6f52a90d4507#22396472-95ac-4e2b-872b-934fd9b2b34egiants00http://social.msdn.microsoft.com/Profile/en-US/?user=giants00save textbox to disk in VB.NET?Thanks for that it worked, but there was one minor issue.  After you pick where you want to save and the name when you click OK to finalize the save the prompt askign you to where to save and name pops up again for a second time.  If I hit the cancel button it will again pop up and after the second time I hit the cancel button it will go away.Tue, 24 Nov 2009 23:59:54 Z2009-11-25T01:14:17Zhttp://social.msdn.microsoft.com/Forums/en-US/vbgeneral/thread/7a8f4c90-3d42-472e-b24a-218204f23159#a7613385-e593-4e41-9836-74513fa77d90http://social.msdn.microsoft.com/Forums/en-US/vbgeneral/thread/7a8f4c90-3d42-472e-b24a-218204f23159#a7613385-e593-4e41-9836-74513fa77d90TechNoHickhttp://social.msdn.microsoft.com/Profile/en-US/?user=TechNoHickDynamic IF statements<p>So as in your example above if you stored valid image values in a list you could have a form that had all <br/>values and they could check the ones that were valid tiff values. Then one if statement could check a <br/>dynamically created list of valid image values<br/><br/>I think that was the point Jinzai was trying to make.</p> <p><br/>kINDa lIKe tHIs:</p> <pre lang=x-vbnet>Public Class Form1 'Store the Vaild Image vaules for D1 Private mImageValues As List(Of Integer) Public Property ImageValues() As List(Of Integer) Get If mImageValues Is Nothing Then mImageValues = New List(Of Integer) End If Return mImageValues End Get Set(ByVal value As List(Of Integer)) mImageValues = CType(value, List(Of Integer)) End Set End Property Private Sub StartIfs_Click(ByVal sender As Object, ByVal e As EventArgs) Dim D1 As Integer Dim ImageName As String If Integer.TryParse(Me.Controls(&quot;txtD1Values&quot;).Text, D1) = False Then MessageBox.Show(&quot;Not an Integer&quot;, &quot;Data Error&quot;, _ MessageBoxButtons.OK, MessageBoxIcon.Error) Exit Sub End If 'does the list contain the value? If ImageValues.Contains(D1) Then ImageName = String.Format(&quot;save-{0}.tif&quot;, D1) Else ImageName = String.Format(&quot;Don't Save {0}&quot;, D1) End If Me.Text = ImageName End Sub Private Sub Form1_Load(ByVal sender As Object, ByVal _ e As System.EventArgs) Handles Me.Load LoadControlsAtRunTime() End Sub 'Below code is for loadding controls at runtime so 'you don't have to... :-) Private Sub LoadControlsAtRunTime() Dim newList As New CheckedListBox With newList .Height = Me.Height * 0.66 .Dock = DockStyle.Bottom .CheckOnClick = True 'Possible Image Values .Items.Add(10) .Items.Add(20) .Items.Add(30) .Items.Add(40) .Items.Add(50) .Items.Add(60) End With AddHandler newList.ItemCheck, AddressOf ImageValues_ItemCheck Me.Controls.Add(newList) Dim newButton As New Button With newButton .Text = &quot;Start If's&quot; .Location = New Point(5, 5) End With AddHandler newButton.Click, AddressOf StartIfs_Click Me.Controls.Add(newButton) Dim newText As New TextBox With newText .Name = &quot;txtD1Values&quot; .Text = &quot;10&quot; .Location = New Point(newButton.Right + 5, newButton.Top) End With Me.Controls.Add(newText) End Sub Private Sub ImageValues_ItemCheck(ByVal sender As Object, _ ByVal e As System.Windows.Forms.ItemCheckEventArgs) Dim CheckedList As CheckedListBox = CType(sender, CheckedListBox) Dim D1 As Integer = CheckedList.Items(e.Index) Select Case True Case e.NewValue = CheckState.Checked AndAlso ImageValues.Contains(D1) = False ImageValues.Add(D1) Case e.NewValue = CheckState.Unchecked AndAlso ImageValues.Contains(D1) ImageValues.Remove(D1) End Select End Sub End Class </pre>Tue, 24 Nov 2009 23:50:57 Z2009-11-25T02:17:07Zhttp://social.msdn.microsoft.com/Forums/en-US/vbgeneral/thread/e28abf33-2005-44ef-a35e-6f52a90d4507#c7b88464-990d-4756-bd95-6da0fbf892b9http://social.msdn.microsoft.com/Forums/en-US/vbgeneral/thread/e28abf33-2005-44ef-a35e-6f52a90d4507#c7b88464-990d-4756-bd95-6da0fbf892b9jwavilahttp://social.msdn.microsoft.com/Profile/en-US/?user=jwavilasave textbox to disk in VB.NET?yep<br/><br/> <pre lang=x-vbnet>Imports System.IO</pre>Tue, 24 Nov 2009 23:50:30 Z2009-11-24T23:59:54Zhttp://social.msdn.microsoft.com/Forums/en-US/vbgeneral/thread/e28abf33-2005-44ef-a35e-6f52a90d4507#7da6ae6e-9ebb-4b60-82ed-d1979d5b6475http://social.msdn.microsoft.com/Forums/en-US/vbgeneral/thread/e28abf33-2005-44ef-a35e-6f52a90d4507#7da6ae6e-9ebb-4b60-82ed-d1979d5b6475giants00http://social.msdn.microsoft.com/Profile/en-US/?user=giants00save textbox to disk in VB.NET?Hi I am trying to use this code but it says that streamwriter is not defined.  Do I need to import anything to the project or declare it?? ThanksTue, 24 Nov 2009 23:49:01 Z2009-11-24T23:50:30Z