locked
Having problem with Controls.GetTextBoxText ? RRS feed

  • Question

  • Hello & Thanks ;

    I have been stuck on this all day .

      addressBarText = "http://vmars.us/SafeBrowser/SafeBrowserHome.html"
        url = Controls.GetTextBoxText(addressBarText)

    It gives me "" back . 

    What am I going wrong ? 

    Thanks

    ' LDControls-Btn-TxtBox-Browser-VM.sb    One Window One Button One TextBox
    ' https://social.technet.microsoft.com/wiki/contents/articles/23583.small-basic-reference-documentation.aspx
    ' https://social.msdn.microsoft.com/Forums/en-US/home?forum=smallbasic
    ' to end program use  Program.End()
    
    browserWidth = 1000
    browserHeight = 500
    buttonWidth = 100
    buttonHeight = 30
    textBoxWidth = 300
    textBoxHeight = 300
    addressBarText = "http://vmars.us/SafeBrowser/SafeBrowserHome.html"
    url = "http://vmars.us/SafeBrowser/SafeBrowserHome.html"
    browser = LDControls.AddBrowser(browserWidth , browserHeight , url) 
    Controls.SetSize(browser , 1000 ,500)  
    Controls.Move(browser, 0, 50)
    
    
    Initialise()
    While ("True")
      Program.Delay(20)
    EndWhile
    
    
    Sub Initialise
      goButton = Controls.AddButton("GO->>", 280, 4)
      Controls.SetSize(goButton,buttonWidth , buttonHeight)
      Controls.ButtonClicked = OnButtonClicked
      
      addressBar = Controls.AddTextBox(400,4)
      Controls.SetTextBoxText(addressBar , addressBarText)
      Controls.SetSize(addressBar , 400 ,30)  
      
      
      GraphicsWindow.Title="SafeBrowser"
      GraphicsWindow.CanResize="True"
      GraphicsWindow.Width = 1000
      GraphicsWindow.Height = 520
    EndSub ' Initialize
    
    
    Sub OnButtonClicked
      addressBarText = "http://vmars.us/SafeBrowser/SafeBrowserHome.html"
      If Controls.LastClickedButton = goButton Then
        url = Controls.GetTextBoxText(addressBarText)
        GraphicsWindow.ShowMessage(url , "url = ")
        If url <> "" Then 
          LDControls.BrowserSetURL(browser, url)
        EndIf 
      EndIf ' lastButtonClicked
      
    EndSub ' OnButtonClicked
    


    "All things in moderation, except for love and forgiveness."...vm

    Monday, August 10, 2020 10:18 PM

Answers

  • u missused 

    url = Controls.GetTextBoxText(addressBarText)

    it must be

    url = Controls.GetTextBoxText(addressBar)

    • Edited by Tryhest Tuesday, August 11, 2020 6:19 AM
    • Proposed as answer by Nonki Takahashi Sunday, August 16, 2020 4:20 AM
    • Marked as answer by WhTurner33Editor Saturday, September 19, 2020 12:27 PM
    Tuesday, August 11, 2020 6:14 AM

All replies

  • u missused 

    url = Controls.GetTextBoxText(addressBarText)

    it must be

    url = Controls.GetTextBoxText(addressBar)

    • Edited by Tryhest Tuesday, August 11, 2020 6:19 AM
    • Proposed as answer by Nonki Takahashi Sunday, August 16, 2020 4:20 AM
    • Marked as answer by WhTurner33Editor Saturday, September 19, 2020 12:27 PM
    Tuesday, August 11, 2020 6:14 AM
  • Ugh !

    Thanks Tryhest

    Runs Great :)


    "All things in moderation, except for love and forgiveness."...vm

    Tuesday, August 11, 2020 2:24 PM