locked
Code is not working RRS feed

  • Question

  • I was using the code, it was working... after after changing somethings in the browser the code stoped working.

    What i've changed:

    add toolstrip (with some buttons and text boxes)

    The code is

    Private Sub go_Click(sender As Object, e As EventArgs) Handles go.Click
    
            Dim brsr As New Browser
            brsr.Show()
            brsr.BringToFront()
    
    End Sub

    Please help.


    NHK


    • Edited by NH Komaiha Tuesday, June 24, 2014 9:09 PM
    Tuesday, June 24, 2014 8:57 PM

Answers

  • Status can't be a label as a label does not have a TextChanged event.  It appears that Status is a TextBox.  If that is the case, then setting the value of the .Text property in the TextChanged event will probably result in an endless loop or a StackOverflow exception.
    • Marked as answer by NH Komaiha Sunday, June 29, 2014 10:38 PM
    Friday, June 27, 2014 7:38 PM
  • "Status can't be a label as a label does not have a TextChanged event."

    Hi Chris,

     Labels do have a TextChanged event.   :)


    If you say it can`t be done then i`ll try it

    • Marked as answer by NH Komaiha Sunday, June 29, 2014 10:38 PM
    Friday, June 27, 2014 7:57 PM

All replies

  • Hi,

     I don`t know what a Browser is but, i am guessing it is a webbrowser. It looks like your not adding the new instance of it to the Forms controls. Try this.

        Private Sub go_Click(ByVal sender As Object, ByVal e As EventArgs) Handles go.Click
    
            Dim brsr As New WebBrowser
            Me.Controls.Add(brsr)
            'brsr.Show()
            brsr.BringToFront()
    
        End Sub

    EDIT : I noticed that you have not answered back or marked an answer on the following thread that i tried helping you with.   Make a button work on many PCs


    If you say it can`t be done then i`ll try it


    • Edited by IronRazerz Tuesday, June 24, 2014 9:14 PM
    Tuesday, June 24, 2014 9:09 PM
  • Hello,

    What is Browser from? In Visual Studio the WebBrowser class is used.


    Please remember to mark the replies as answers if they help and unmark them if they provide no help, this will help others who are looking for solutions to the same or similar problem.

    Tuesday, June 24, 2014 9:09 PM
  • Hi,

     I don`t know what a Browser is but, i am guessing it is a webbrowser. It looks like your not adding the new instance of it to the Forms controls. Try this.

        Private Sub go_Click(ByVal sender As Object, ByVal e As EventArgs) Handles go.Click
    
            Dim brsr As New WebBrowser
            Me.Controls.Add(brsr)
            'brsr.Show()
            brsr.BringToFront()
    
        End Sub


    If you say it can`t be done then i`ll try it

    yes it's a webbrowser form (its name Browser)

    this code is adding a webbrowser in the main form (form1)...

    my code must open the webbrowser form, but I don't know why it's not working!


    NHK



    • Edited by NH Komaiha Tuesday, June 24, 2014 9:24 PM
    Tuesday, June 24, 2014 9:16 PM
  • That is strange. If you have changed any code in the Browser Form or in the properties window of it then make sure that the Opacity and the Visible properties didn`t get changed by accident. Also, if you have added any code to the Forms Load event then make sure that is not causing a problem by commenting it out. This is one of those problems that is hard to guess without seeing everything and knowing what all has been changed.

    If you say it can`t be done then i`ll try it

    Tuesday, June 24, 2014 9:33 PM
  • preview: (open it in a new tab)


    NHK


    • Edited by NH Komaiha Tuesday, June 24, 2014 9:33 PM
    Tuesday, June 24, 2014 9:33 PM
  • Have you tried to create a new project to test your code? I think maybe something is broken in you project

    Best Regards,
    Please remember to mark the replies as answers if they help

    Wednesday, June 25, 2014 6:43 AM
  • Have you tried to create a new project to test your code? I think maybe something is broken in you project

    Best Regards,
    Please remember to mark the replies as answers if they help

    I tried, and it's not working!

    I've uploaded my project to dev-host...

    Link: http://d-h.st/wQ5 (rar, 22M)


    NHK


    • Edited by NH Komaiha Wednesday, June 25, 2014 8:43 PM
    Wednesday, June 25, 2014 8:50 AM
  • Hello,

    What is Browser from? In Visual Studio the WebBrowser class is used.


    Please remember to mark the replies as answers if they help and unmark them if they provide no help, this will help others who are looking for solutions to the same or similar problem.

    it's a WebBrowser Form, its name in the properties Browser

    NHK


    • Edited by NH Komaiha Wednesday, June 25, 2014 8:45 PM
    Wednesday, June 25, 2014 8:44 PM
  • That is strange. If you have changed any code in the Browser Form or in the properties window of it then make sure that the Opacity and the Visible properties didn`t get changed by accident. Also, if you have added any code to the Forms Load event then make sure that is not causing a problem by commenting it out. This is one of those problems that is hard to guess without seeing everything and knowing what all has been changed.

    If you say it can`t be done then i`ll try it

    I'll give you the warnings that I have got:


    NHK

    Wednesday, June 25, 2014 8:55 PM
  • Hi,

     It looks like you might need to try building your application to target a different platform. You can find information about how to do that at the link below. You can check out the links on that page.

    Understanding Build Platforms


    If you say it can`t be done then i`ll try it

    Wednesday, June 25, 2014 9:02 PM
  • EDIT : I noticed that you have not answered back or marked an answer on the following thread that i tried helping you with.   Make a button work on many PCs


    If you say it can`t be done then i`ll try it

    But I marked the last post as answer! please check again.

    NHK

    Thursday, June 26, 2014 7:16 AM
  • But I marked the last post as answer! please check again.

    NHK

     Hi,

     Its not a big deal but, one of the moderators actually marked it as an answer. I just wondered if it helped or if you where having problems with it.   :)


    If you say it can`t be done then i`ll try it

    Thursday, June 26, 2014 9:47 AM
  • If its a standard WebBrowser you would see the following in the property window


    Please remember to mark the replies as answers if they help and unmark them if they provide no help, this will help others who are looking for solutions to the same or similar problem.

    Thursday, June 26, 2014 1:15 PM
  • That is strange. If you have changed any code in the Browser Form or in the properties window of it then make sure that the Opacity and the Visible properties didn`t get changed by accident. Also, if you have added any code to the Forms Load event then make sure that is not causing a problem by commenting it out. This is one of those problems that is hard to guess without seeing everything and knowing what all has been changed.

    If you say it can`t be done then i`ll try it

    The Problem is in this code: 

    Private Sub Status_TextChanged(sender As Object, e As EventArgs) Handles Status.TextChanged
            If StatusProgressBar.Value = 0 Then
                Status.Text = "Status"
            End If
    End Sub

    I've tried to delete the above code and then the button worked!

    But what's the problem with this code?


    Note:

    Status = label

    StatusProgressBar = Progress Bar

    and They are existed in a Web Browser Form


    NHK


    • Edited by NH Komaiha Thursday, June 26, 2014 9:27 PM
    Thursday, June 26, 2014 9:19 PM
  • Hi,

     Try setting a break point on the Status.TextChanged event and keep stepping threw your code one step at a time to see what may be happening. It is hard to tell what could be causing it on my end without seeing the whole code of both forms to understand what all is happening in the code.

     Here is a few links you can look at if you are not sure how to set a Breakpoint and step threw your code to debug it.

    Debugging Express

    Debugging How to use the tools


    If you say it can`t be done then i`ll try it

    • Edited by IronRazerz Thursday, June 26, 2014 10:33 PM
    Thursday, June 26, 2014 10:31 PM
  • Status can't be a label as a label does not have a TextChanged event.  It appears that Status is a TextBox.  If that is the case, then setting the value of the .Text property in the TextChanged event will probably result in an endless loop or a StackOverflow exception.
    • Marked as answer by NH Komaiha Sunday, June 29, 2014 10:38 PM
    Friday, June 27, 2014 7:38 PM
  • "Status can't be a label as a label does not have a TextChanged event."

    Hi Chris,

     Labels do have a TextChanged event.   :)


    If you say it can`t be done then i`ll try it

    • Marked as answer by NH Komaiha Sunday, June 29, 2014 10:38 PM
    Friday, June 27, 2014 7:57 PM
  • I stand corrected.  I could have sworn that when I pulled up the docs for the Label class that TextChanged was not listed as an event.  I just did it again and it is there!!  I guess my eyes are starting to betray me!!

    Part of my answer still applies.  Changing the text of the label inside the label's TextChanged event may result in infinite recursion and ultimately an StackOverflowException.

    Wednesday, July 2, 2014 9:04 PM