Forgive me for the dumb question.
I want to display a link in a textbox or some control so the user can click it from a classic form. Anyone know how?
Forgive me for the dumb question.
I want to display a link in a textbox or some control so the user can click it from a classic form. Anyone know how?
I was hoping there was some EpiMagic I was missing, but this works and I can follow directions.
I’ll write up a little code blurb to go with the video.
Yeah sorry its an old post from Epicor 9… so I do’nt have a blurb just an old video and regrets
You will have one soon, works perfect, and almost exactly what I needed.
//Class level (Script)
LinkLabel lblBookingUrl;
public void InitializeCustomCode()
{
CreateBookingUrlLabel();
}
private void CreateBookingUrlLabel()
{
//Where I want to add it to
Erp.UI.App.CustShipEntry.SummaryPanel panel = (Erp.UI.App.CustShipEntry.SummaryPanel)csm.GetNativeControlReference("550ae954-4cbb-43a9-a594-e15f4f60da07");
lblBookingUrl = new LinkLabel();
lblBookingUrl.Name = "lblBookingUrl";;
lblBookingUrl.Location = new System.Drawing.Point(924, 136);
lblBookingUrl.Size = new System.Drawing.Size(205, 22);
lblBookingUrl.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
lblBookingUrl.ForeColor = System.Drawing.Color.Blue;
lblBookingUrl.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(lblBookingUrl_LinkClicked);
//Populated somewhere else
lblBookingUrl.Text = String.Empty;
lblBookingUrl.Links[0].LinkData = String.Empty;
//Add to my panel
panel.Controls.Add(lblBookingUrl);
}
public void DestroyCustomCode()
{
lblBookingUrl.LinkClicked -= new System.Windows.Forms.LinkLabelLinkClickedEventHandler(lblBookingUrl_LinkClicked);
lblBookingUrl.Dispose();
}
private void lblBookingUrl_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
string url = e.Link.LinkData.ToString();
System.Diagnostics.Process.Start(url);
}
private void Somewhere_Else()
{
string bookUrl = "https://example.com/exampleurl";
lblBookingUrl.Text = "Booking Url";
lblBookingUrl.Links[0].LinkData = bookUrl;
}