<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Access Form1.vb from Class.vb in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/access-form1-vb-from-class-vb/m-p/2440392#M71604</link>
    <description>You need to create public properties for this:&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;In your Form1.vb class:&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Public ReadOnly Property MyText As String&lt;BR /&gt;&lt;BR /&gt;Get&lt;BR /&gt;&lt;BR /&gt;return textBox1.text&lt;BR /&gt;&lt;BR /&gt;End Get&lt;BR /&gt;&lt;BR /&gt;End Property&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;then you can access that property from outside the Form class...&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;--&lt;BR /&gt;&lt;BR /&gt; http://cupocadnet.blogspot.com&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Edited by: bertvan on Mar 5, 2009 9:15 PM&lt;BR /&gt;

Edited by: bertvan on Mar 7, 2009 5:33 PM</description>
    <pubDate>Thu, 05 Mar 2009 21:15:47 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2009-03-05T21:15:47Z</dc:date>
    <item>
      <title>Access Form1.vb from Class.vb</title>
      <link>https://forums.autodesk.com/t5/net-forum/access-form1-vb-from-class-vb/m-p/2440390#M71602</link>
      <description>I have a class file and a Form1.vb file in my project.&lt;BR /&gt;
I need to read the values of Form1.vb (example: value of textbox1.text in Form1.vb) from my class.&lt;BR /&gt;
Somehow I am getting nothing returned when I try to acces the values on the form.&lt;BR /&gt;
I guess it's because I am having the following statement in my class:&lt;BR /&gt;
 &lt;COMMANDMETHOD&gt; _&lt;BR /&gt;
        Public Sub NewCmd1()&lt;BR /&gt;
        Dim myForm As New Form1&lt;BR /&gt;
        Autodesk.AutoCAD.ApplicationServices.Application.ShowModelessDialog(myForm)&lt;BR /&gt;
    End Sub&lt;BR /&gt;
&lt;BR /&gt;
&lt;COMMANDMETHOD&gt; _&lt;BR /&gt;
     Public Sub MessageboxTest()&lt;BR /&gt;
        Messagebox.show(myForm.Textbox1.text)&lt;BR /&gt;
        Messagebox.show(myForm.Combobox.text)&lt;BR /&gt;
    End Sub&lt;BR /&gt;
&lt;BR /&gt;
If I call MessageboxTest(), the values are nothing.&lt;BR /&gt;
If I don't declare "Dim myForm As New Form1" I cannot get the form to display, but if I do this, I cannot get&lt;BR /&gt;
the value of any of the comboboxes or textboxes. Can anybody help ?&lt;/COMMANDMETHOD&gt;&lt;/COMMANDMETHOD&gt;</description>
      <pubDate>Tue, 03 Mar 2009 05:31:16 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/access-form1-vb-from-class-vb/m-p/2440390#M71602</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-03-03T05:31:16Z</dc:date>
    </item>
    <item>
      <title>Re: Access Form1.vb from Class.vb</title>
      <link>https://forums.autodesk.com/t5/net-forum/access-form1-vb-from-class-vb/m-p/2440391#M71603</link>
      <description>If you declare a variable in one sub it is not available in another sub. You need to declare the variable outside the subs.</description>
      <pubDate>Tue, 03 Mar 2009 21:44:30 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/access-form1-vb-from-class-vb/m-p/2440391#M71603</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-03-03T21:44:30Z</dc:date>
    </item>
    <item>
      <title>Re: Access Form1.vb from Class.vb</title>
      <link>https://forums.autodesk.com/t5/net-forum/access-form1-vb-from-class-vb/m-p/2440392#M71604</link>
      <description>You need to create public properties for this:&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;In your Form1.vb class:&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Public ReadOnly Property MyText As String&lt;BR /&gt;&lt;BR /&gt;Get&lt;BR /&gt;&lt;BR /&gt;return textBox1.text&lt;BR /&gt;&lt;BR /&gt;End Get&lt;BR /&gt;&lt;BR /&gt;End Property&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;then you can access that property from outside the Form class...&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;--&lt;BR /&gt;&lt;BR /&gt; http://cupocadnet.blogspot.com&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Edited by: bertvan on Mar 5, 2009 9:15 PM&lt;BR /&gt;

Edited by: bertvan on Mar 7, 2009 5:33 PM</description>
      <pubDate>Thu, 05 Mar 2009 21:15:47 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/access-form1-vb-from-class-vb/m-p/2440392#M71604</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-03-05T21:15:47Z</dc:date>
    </item>
  </channel>
</rss>

