Results 1 to 7 of 7

Thread: [RESOLVED] form1.show(), form1 pops up and says not responding. but form1.showdialog() works.

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Mar 2024
    Posts
    509

    Resolved [RESOLVED] form1.show(), form1 pops up and says not responding. but form1.showdialog() works.

    (I admit to being very new to vb.net)

    but frmAbout.showdialog() works ok.

    showdialog seems to be for child forms only?

    How to make a form not a child of a parent is the idea, I think.
    I read to say new form, but also does not work.



    frmAbout.ShowDialog()

    the below not working

    Dim f As Form1 = New Form1()
    f.Show()

    This is the code in form1
    Code:
    Option Strict Off
    Option Explicit On
    
    Public Class Form1
    
    
        Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox1.SelectedIndexChanged
            Dim a As Short
            a = a
    
        End Sub
    End Class
    Attached Images Attached Images  

  2. #2
    PowerPoster
    Join Date
    Nov 2017
    Posts
    3,200

    Re: form1.show(), form1 pops up and says not responding. but form1.showdialog() works

    What isn't working? Form1 is appearing. Because it is displayed using just .Show, then the next line of code, missextraLoadEtc() will immediately execute. That routine seems have some long running code or possibly an infinite loop, since your program has gone into a Not Responding status. You can verify that by simply commenting out the call to that routine, and I would imagine your Form1 form will be displayed and responsive.

    So you need to dig into that called routine yourself to see what is hanging it up, or post the code for that routine if you want help with it.

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Mar 2024
    Posts
    509

    Re: form1.show(), form1 pops up and says not responding. but form1.showdialog() works

    Quote Originally Posted by OptionBase1 View Post
    What isn't working? Form1 is appearing. Because it is displayed using just .Show, then the next line of code, missextraLoadEtc() will immediately execute. That routine seems have some long running code or possibly an infinite loop, since your program has gone into a Not Responding status. You can verify that by simply commenting out the call to that routine, and I would imagine your Form1 form will be displayed and responsive.

    So you need to dig into that called routine yourself to see what is hanging it up, or post the code for that routine if you want help with it.
    Hi you are exactly right.
    I just used exit sub and Form1 pops us fine.

  4. #4
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    39,146

    Re: [RESOLVED] form1.show(), form1 pops up and says not responding. but form1.showdia

    So, does that method just do a whole lot of stuff, or is it a perpetual loop? If it's just doing a whole lot of stuff, you might be able to move it to a background thread so that it is working while the forms remain responsive. Depends on what it is doing, though.
    My usual boring signature: Nothing

  5. #5

    Thread Starter
    Hyperactive Member
    Join Date
    Mar 2024
    Posts
    509

    Re: [RESOLVED] form1.show(), form1 pops up and says not responding. but form1.showdia

    Quote Originally Posted by Shaggy Hiker View Post
    So, does that method just do a whole lot of stuff, or is it a perpetual loop? If it's just doing a whole lot of stuff, you might be able to move it to a background thread so that it is working while the forms remain responsive. Depends on what it is doing, though.
    Right now it is doing nothing as it is not fully converted, not sure what it doing to cause the form to stop responding., without loading a test form which I was doing as learning how to show a form, it retrieves a registry setting and connects to a database, but since my decryption does not work in vbnet, a DB connection fails and is supposed to show a frmFailure, which it will do without loading Form1.show


    So I don't get why exactly it stops responding. But for the moment I am thinking of something else to do with the encrypt decrypt string in the registry issue which happens in the frmlogon initialize event. Until I figure that one out, no point in going any further.

    I started a thread showing that encrypt registry that I do. I may have to come up with a simpler xor function, something that leaves out non typeable ASCI chars.
    It might have to do with a NUL char in the encryption string, which for 20 years has been no problem from win xp on up with vb6 getsetting method.

    If you have any thoughts about the registry please tell me on the other thread, thanks

    Idea long ago was keep the connection string in the local machine versus some user having to always enter the parameters, and then encrypt it to make it more secure.
    Seemed at the time, the windows registry was a good place to hide strings versus some independent file
    Last edited by sdowney1; Apr 21st, 2024 at 12:28 PM.

  6. #6

    Thread Starter
    Hyperactive Member
    Join Date
    Mar 2024
    Posts
    509

    Re: [RESOLVED] form1.show(), form1 pops up and says not responding. but form1.showdia

    Quote Originally Posted by Shaggy Hiker View Post
    So, does that method just do a whole lot of stuff, or is it a perpetual loop? If it's just doing a whole lot of stuff, you might be able to move it to a background thread so that it is working while the forms remain responsive. Depends on what it is doing, though.
    ok, this am got program working in vs2022 with my encrypt sub, so I looked into it and yes was in a pepetual loop, deliberate by me. I am adapting code from vb6 into vbnet and I had commented out lines like 'frmOpener.show' that is in the errhandler and at end of the errhandler, program execution reloads the sub that tries to load that form on an error, and the sub was erroring as the decrypt sub is broken in vs2008. so round and round it went forever.

    I am really happy my encryption scheme does work in vs2022. I can move ahead again. I am slowly adding in forms from the vb6 app and I comment out lines that link forms I am not ready to add into the vs2022 project. So I get things working one form at a time, and I have some 25 forms and 20 modules.

    But mostly the modules just work without many changes. It is the forms which are the biggest challenge to make work. What I am doing was use vs2008 to import a vb6 project and I started a new vs2008 project and added in forms and modules one at a time from the converted vs2008 vb6 project.

    Since I need vs2022 for my encryption thing to work, I am installing vs2022 and will start using it instead of vs2008

  7. #7
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    39,146

    Re: [RESOLVED] form1.show(), form1 pops up and says not responding. but form1.showdia

    That's a good move anyways. VS2008 was kind of mediocre. VS2010 was the most beautiful version, up until VS2017 or so. I kind of skipped from VS2010 to VS2017, but since that version, I've just stuck with the latest. VS2022 has some really nice features.

    Eventually, you'll want to switch to structured exception handling rather than the errhandler approach.
    My usual boring signature: Nothing

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