CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5

Thread: VB Debugging

  1. #1
    Join Date
    Jun 2000
    Location
    Germany
    Posts
    448

    VB Debugging

    Hi there!

    The VB debugger always stops when a new formn is shown. How can I change this?

    Thank you in advance for any help!

    --------------------------------------------------
    Visit our new forum: www.maxcode.com
    Feel free to contact me via ICQ# 82806695

  2. #2
    Join Date
    Jul 2000
    Location
    Milano, Italy
    Posts
    7,726

    Re: VB Debugging

    What do you mean? Are you debugging a project in ide with breakpoints on source code? To be sure it stops, make a simple project with only a textbox and a timer (interval 2 seconds). In form load event wtite:
    Text1.text = "myText"
    timer1.enabled = true
    in timer event write:

    timer1.enabled = false
    text1.text = "change text"

    Put a breakpoint only, on this statement.
    Run the project pressing F5.
    Does your project break in load event or in timer event?
    Hope this help.


    Special thanks to Lothar "the Great" Haensler. Come back soon, you Guru.
    ...at present time, using mainly Net 4.0, Vs 2010



    Special thanks to Lothar "the Great" Haensler, Chris Eastwood , dr_Michael, ClearCode, Iouri and
    all the other wonderful people who made and make Codeguru a great place.
    Come back soon, you Gurus.

  3. #3
    Join Date
    Jul 2000
    Location
    Milano, Italy
    Posts
    7,726

    Re: VB Debugging

    Whoops... sorry: on a new form displayed! Are you using modal forms?

    Special thanks to Lothar "the Great" Haensler. Come back soon, you Guru.
    ...at present time, using mainly Net 4.0, Vs 2010



    Special thanks to Lothar "the Great" Haensler, Chris Eastwood , dr_Michael, ClearCode, Iouri and
    all the other wonderful people who made and make Codeguru a great place.
    Come back soon, you Gurus.

  4. #4
    Join Date
    Jun 2000
    Location
    Germany
    Posts
    448

    Re: VB Debugging

    Yes..

    Form1.Show vbModal


    --------------------------------------------------
    Visit our new forum: www.maxcode.com
    Feel free to contact me via ICQ# 82806695

  5. #5
    Join Date
    Jul 2000
    Location
    Milano, Italy
    Posts
    7,726

    Re: VB Debugging

    When you use a modal form, code in form that calls it stops, until the modal form is closed. Make a try with simple example I post you before, but try it with two istances of same form, first called in non-modal and second in modal way, just to see.
    ie:
    have two forms: form1 with a commandbutton, form2 with a timer and a textbox
    command1 code:
    dim f1 as new form2
    'comment out one line of the following to make a try
    'then comment out the other for next try
    f1.show 'non modal calling
    f1.show vbmodal 'modal calling

    put a breakpoint only in form2 timer event and then look what happens
    Best regards,
    Cesare Imperiali

    Special thanks to Lothar "the Great" Haensler. Come back soon, you Guru.
    ...at present time, using mainly Net 4.0, Vs 2010



    Special thanks to Lothar "the Great" Haensler, Chris Eastwood , dr_Michael, ClearCode, Iouri and
    all the other wonderful people who made and make Codeguru a great place.
    Come back soon, you Gurus.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured