Peter Smit Posted March 18, 2015 Posted March 18, 2015 Unigui is grate. I am trying to create a simple application with records of webpage addresses, I can do this I want to have a text link or button click from the UniDBedit to open a new page in the web browser. What am i doing wrong:This is what i did:OnMouseEnter ----> GetHTMLClickMouseEnter: Code Var GetHTML:String; begin GetHTML:= '<a href="' + HTMLUniDBEdit.Text + '/" target="new">Visit</a>'; <-----Copy the Address to GetHTMLClick GetHTMLClick.Hint:= HTMLUniDBEdit.Text; <----mouse over displays the web-address GetHTMLClick.Caption:= GetHTML; end; It is only working with some sites, is there a simple way that works The Unigui static example tested OK Quote
Peter Smit Posted July 3, 2015 Author Posted July 3, 2015 Hi everyone, I found a way and got the Link click to work First you need to add this to the uses uniGUIVars, uniGUIApplication, StrUtils; Remember GetHTMLClick:= UniLabel also remember to set the TextConversion to txtHTML OnMouseEnter ----> GetHTMLClickMouseEnter: Code Var GetHTML:String; URL: String; begin URL:= ''; // clear GetHTML:= ''; // clear if LeftStr(HTMLUniDBEdit.Text, 7) = 'http://' then //check if the link has http and set the link begin URL:='<a href="' + HTMLUniDBEdit.Text + '" target="_blank">Visit</a>'; //set the address to show in a new page GetHTMLClick.Hint:= HTMLUniDBEdit.Text; //mouse over to show the link GetHTMLClick.Caption:= URL; end else begin GetHTMLClick.Hint:= 'http://' + HTMLUniDBEdit.Text; // mouse over to show the link with the added Http:// URL:= '<a href="' + GetHTMLClick.Hint + '" target="_blank">Visit</a>'; //set the address to show in a new page GetHTMLClick.Caption:= URL; end; end; Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.