vb.net forms question - Page 2


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Page 2 of 2 FirstFirst 12
Results 16 to 29 of 29

Thread: vb.net forms question

  1. #16
    Join Date
    Apr 2007
    Location
    Sterling Heights, Michigan
    Posts
    8,666
    As a test, try this
    Code:
    MessageBox.Show(arAdmin.centerName)
    Does that work?
    I don't answer coding questions via PM or Email. Please post a thread in the appropriate forum section.
    Please use [Code]your code goes in here[/Code] tags when posting code.
    Before posting your question, did you look here?
    Got a question on Linux? Visit our Linux sister site.
    Modifications Required For VB6 Apps To Work On Vista

  2. #17
    Join Date
    Aug 2006
    Posts
    43
    it worked just the way it should
    Attached Images Attached Images

  3. #18
    Join Date
    Apr 2007
    Location
    Sterling Heights, Michigan
    Posts
    8,666
    Ok, then try this
    Code:
    Dim strCaption As String = arAdmin.centerName
    MainForm.Text = strCaption
    I don't answer coding questions via PM or Email. Please post a thread in the appropriate forum section.
    Please use [Code]your code goes in here[/Code] tags when posting code.
    Before posting your question, did you look here?
    Got a question on Linux? Visit our Linux sister site.
    Modifications Required For VB6 Apps To Work On Vista

  4. #19
    Join Date
    Aug 2006
    Posts
    43
    it gives me the same error i had before

  5. #20
    Join Date
    Apr 2007
    Location
    Sterling Heights, Michigan
    Posts
    8,666
    Then try this
    Code:
    Dim MF as New MainForm
    MF.Text = arAdmin.centerName
    I don't answer coding questions via PM or Email. Please post a thread in the appropriate forum section.
    Please use [Code]your code goes in here[/Code] tags when posting code.
    Before posting your question, did you look here?
    Got a question on Linux? Visit our Linux sister site.
    Modifications Required For VB6 Apps To Work On Vista

  6. #21
    Join Date
    Aug 2006
    Posts
    43
    ok i tried that and this is the error i got

    object reference not set to an instance of an object

    See the end of this message for details on invoking
    just-in-time (JIT) debugging instead of this dialog box.

    ************** Exception Text **************
    System.NullReferenceException: Object reference not set to an instance of an object.
    at lock1.MainForm.Timer1_Tick(Object sender, EventArgs e) in C:\Documents and Settings\Jay\My Documents\Visual Studio Projects\lock1\MainForm.vb:line 208
    at System.Windows.Forms.Timer.OnTick(EventArgs e)
    at System.Windows.Forms.Timer.Callback(IntPtr hWnd, Int32 msg, IntPtr idEvent, IntPtr dwTime)


    ************** Loaded Assemblies **************
    mscorlib
    Assembly Version: 1.0.5000.0
    Win32 Version: 1.1.4322.2032
    CodeBase: file:///c:/windows/microsoft.net/framework/v1.1.4322/mscorlib.dll
    ----------------------------------------
    lock1
    Assembly Version: 1.0.2855.17606
    Win32 Version: 1.0.2855.17606
    CodeBase: file:///C:/Documents%20and%20Settings/Jay/My%20Documents/Visual%20Studio%20Projects/lock1/bin/lock1.exe
    ----------------------------------------
    System.Windows.Forms
    Assembly Version: 1.0.5000.0
    Win32 Version: 1.1.4322.2032
    CodeBase: file:///c:/windows/assembly/gac/system.windows.forms/1.0.5000.0__b77a5c561934e089/system.windows.forms.dll
    ----------------------------------------
    System
    Assembly Version: 1.0.5000.0
    Win32 Version: 1.1.4322.2032
    CodeBase: file:///c:/windows/assembly/gac/system/1.0.5000.0__b77a5c561934e089/system.dll
    ----------------------------------------
    System.Drawing
    Assembly Version: 1.0.5000.0
    Win32 Version: 1.1.4322.2032
    CodeBase: file:///c:/windows/assembly/gac/system.drawing/1.0.5000.0__b03f5f7f11d50a3a/system.drawing.dll
    ----------------------------------------
    System.Data
    Assembly Version: 1.0.5000.0
    Win32 Version: 1.1.4322.2032
    CodeBase: file:///c:/windows/assembly/gac/system.data/1.0.5000.0__b77a5c561934e089/system.data.dll
    ----------------------------------------
    System.Xml
    Assembly Version: 1.0.5000.0
    Win32 Version: 1.1.4322.2032
    CodeBase: file:///c:/windows/assembly/gac/system.xml/1.0.5000.0__b77a5c561934e089/system.xml.dll
    ----------------------------------------
    Microsoft.VisualBasic
    Assembly Version: 7.0.5000.0
    Win32 Version: 7.10.6001.4
    CodeBase: file:///c:/windows/assembly/gac/microsoft.visualbasic/7.0.5000.0__b03f5f7f11d50a3a/microsoft.visualbasic.dll
    ----------------------------------------

    ************** JIT Debugging **************
    To enable just in time (JIT) debugging, the config file for this
    application or machine (machine.config) must have the
    jitDebugging value set in the system.windows.forms section.
    The application must also be compiled with debugging
    enabled.

    For example:

    <configuration>
    <system.windows.forms jitDebugging="true" />
    </configuration>

    When JIT debugging is enabled, any unhandled exception
    will be sent to the JIT debugger registered on the machine
    rather than being handled by this dialog.

  7. #22
    Join Date
    Apr 2007
    Location
    Sterling Heights, Michigan
    Posts
    8,666
    Do you have Option Strict On?

    What is the entire code that you are running?
    I don't answer coding questions via PM or Email. Please post a thread in the appropriate forum section.
    Please use [Code]your code goes in here[/Code] tags when posting code.
    Before posting your question, did you look here?
    Got a question on Linux? Visit our Linux sister site.
    Modifications Required For VB6 Apps To Work On Vista

  8. #23
    Join Date
    Aug 2006
    Posts
    43
    no i do not have option strict on should i have it turned on what dose it do for my program?

  9. #24
    Join Date
    Apr 2007
    Location
    Sterling Heights, Michigan
    Posts
    8,666
    Yes, you should have it on. It will point out/highlight errors before you ever run your program and it will tell you what .NET doesn't like about the code you just wrote.
    I don't answer coding questions via PM or Email. Please post a thread in the appropriate forum section.
    Please use [Code]your code goes in here[/Code] tags when posting code.
    Before posting your question, did you look here?
    Got a question on Linux? Visit our Linux sister site.
    Modifications Required For VB6 Apps To Work On Vista

  10. #25
    Join Date
    Aug 2006
    Posts
    43
    ok when i set the option strict on it shows alot of errors like can't convert form decimal to string but when i add .tostring on the end it works is that how i should fix things like that?

  11. #26
    Join Date
    Nov 2003
    Location
    Portland, OR
    Posts
    8,387
    Try this:

    Me.ParentForm.Text = drAdmin.centerName
    Phil Weber
    http://www.philweber.com

    Please post questions to the forums, where others may benefit.
    I do not offer free assistance by e-mail. Thank you!

  12. #27
    Join Date
    Apr 2007
    Location
    Sterling Heights, Michigan
    Posts
    8,666
    Quote Originally Posted by trains58554
    ok when i set the option strict on it shows alot of errors like can't convert form decimal to string but when i add .tostring on the end it works is that how i should fix things like that?
    Yes

    Did Phil's suggestion work (I hadn't thought of that approach )
    I don't answer coding questions via PM or Email. Please post a thread in the appropriate forum section.
    Please use [Code]your code goes in here[/Code] tags when posting code.
    Before posting your question, did you look here?
    Got a question on Linux? Visit our Linux sister site.
    Modifications Required For VB6 Apps To Work On Vista

  13. #28
    Join Date
    Aug 2006
    Posts
    43
    Quote Originally Posted by Hack
    Yes

    Did Phil's suggestion work (I hadn't thought of that approach )
    It did work Thanks for all of your help Hack and the same to you Phil

    Thanks
    Trains

  14. #29
    Join Date
    Apr 2007
    Location
    Sterling Heights, Michigan
    Posts
    8,666
    Nice job Phil....as I said....I hadn't thought of that.

    @trains58554: Glad we finally got this problem sorted out.
    I don't answer coding questions via PM or Email. Please post a thread in the appropriate forum section.
    Please use [Code]your code goes in here[/Code] tags when posting code.
    Before posting your question, did you look here?
    Got a question on Linux? Visit our Linux sister site.
    Modifications Required For VB6 Apps To Work On Vista

Similar Threads

  1. DoubleBuffered Question VB.NET
    By howiegoo in forum .NET
    Replies: 3
    Last Post: 09-16-2007, 06:06 PM
  2. A question on VB.NET
    By scorpions in forum .NET
    Replies: 1
    Last Post: 06-20-2007, 05:45 AM
  3. Replies: 2
    Last Post: 09-10-2005, 02:56 AM
  4. VB.NET upgrade question
    By tlwahl in forum .NET
    Replies: 1
    Last Post: 06-30-2005, 07:03 AM
  5. vb.net database question
    By dc in forum .NET
    Replies: 4
    Last Post: 04-22-2002, 12:45 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center