none
Form20Load contain a richtextbox and contain a code to write in a richtextbox and I debug first line code in a form20Load during show form20 while the program does not path to any code in the form20Load? RRS feed

  • Question

  • Hi,

    Form20Load contain a richtextbox and contain a code to write in a richtextbox and I debug first line code in a form20Load during show form20 while the program does not path to any code in the form20Load?

    I dont know why.

    If the code is big, that may produce that problem?

    Knowing that the total line code in form20 load = 1230 line.

    Kind Regards,


    Hany Metry



    • Edited by Hany Metry Tuesday, November 12, 2019 10:18 AM adjust
    Tuesday, November 12, 2019 10:10 AM

Answers

  • Hi,

    When I remove the following code line.

    file = My.Computer.FileSystem.OpenTextFileWriter("D:\" & My.Settings.FileName1 & ".txt", True)

    or make the file name is untitled.text then all the problem is solved and there is no hang and I can maximize form20.

    Kind Regards,


    Hany Metry

    • Marked as answer by Hany Metry Wednesday, November 13, 2019 6:28 AM
    Wednesday, November 13, 2019 6:28 AM

All replies

  • Hi

    Dispose(Boolean) of form20 show the following

    <Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
    Partial Class Form20Report
        Inherits System.Windows.Forms.Form

        'Form overrides dispose to clean up the component list.
        <System.Diagnostics.DebuggerNonUserCode()> _
        Protected Overrides Sub Dispose(ByVal disposing As Boolean)
            Try
                If disposing AndAlso components IsNot Nothing Then
                    components.Dispose()
                End If
            Finally
                MyBase.Dispose(disposing)
            End Try
        End Sub

        'Required by the Windows Form Designer
        Private components As System.ComponentModel.IContainer

        'NOTE: The following procedure is required by the Windows Form Designer
        'It can be modified using the Windows Form Designer.  
        'Do not modify it using the code editor.
        <System.Diagnostics.DebuggerStepThrough()> _


    Hany Metry

    Tuesday, November 12, 2019 11:00 AM
  • Hi,

    I will explain the history of form20 hang.

    I added code to create and write in a text file at form20 load and then I run the program.

    The program hang at the line

     If My.Settings.FileName1 = "" Then
           file = My.Computer.FileSystem.OpenTextFileWriter("D:\Untitled.txt", True)
     Else
           file = My.Computer.FileSystem.OpenTextFileWriter("D:\" & My.Settings.FileName1 & ".txt", True)
     End If

    I cant stop the program except by window task manager because form20 full the screen.

    The above hang is repeated two times.

    Then I ask a question in the Forum

    https://social.msdn.microsoft.com/Forums/en-US/a0cda9d4-6d2f-402f-924d-4fa78722573b/during-create-and-write-a-text-file-which-written-in-form-load-the-form-is-hang?forum=vbgeneral

    And then the program does not path to any code in form20 Load 

    Then I asked this question in that thread.

    Is window task manager damage any thing in form20 when I forced to stop two times.

    Now I have no solution except delete form20 and redo it again assuming that window task manager produce a problem in form20.

    Kind Regards,

     


    Hany Metry

    • Marked as answer by Hany Metry Tuesday, November 12, 2019 2:50 PM
    • Unmarked as answer by Hany Metry Tuesday, November 12, 2019 3:44 PM
    Tuesday, November 12, 2019 11:25 AM
  • Hi,

    Once I make the size of form20 normal and not maximize my problem is solved regards does not path to the code in form20 Load

    I need form20 to be maximize, how I can solve the problem?

    Also the program does not create text file. Please refer to next post.

    Kind Regards,


    Hany Metry



    • Marked as answer by Hany Metry Tuesday, November 12, 2019 2:50 PM
    • Unmarked as answer by Hany Metry Tuesday, November 12, 2019 3:44 PM
    • Edited by Hany Metry Tuesday, November 12, 2019 3:52 PM add
    Tuesday, November 12, 2019 2:49 PM
  • Hi,

    When I remove the following code line.

    file = My.Computer.FileSystem.OpenTextFileWriter("D:\" & My.Settings.FileName1 & ".txt", True)

    or make the file name is untitled.text then all the problem is solved and there is no hang and I can maximize form20.

    Kind Regards,


    Hany Metry

    • Marked as answer by Hany Metry Wednesday, November 13, 2019 6:28 AM
    Wednesday, November 13, 2019 6:28 AM