LinkLabel

N

Nick

Hi,

I am trying to rise explorer during the event of a
LinkLabel but something goes wrong:

private void linklblWebsite_LinkClicked(object sender,
OpenNETCF.Windows.Forms.LinkLabelLinkClickedEventArgs e)
{
System.Diagnostics.Process.Start
(e.Link.LinkData.ToString())
}

But I get the following error:

There is no System.Diagnostics.Process namespace.

Thanks in advance
 
M

marcmc

surely you get a squiggly line in Imports
System.Diagnostics.process as it does not exist.

Not sure I understood your question.
Are you trying to open pocket internet explorer from an
event...if so try

Dowload OpenNETCF.WinAPI.dll binary version, unzip and
put in \Windows Visual Studio.NET 2003\Compact Framework
SDL\ v1.0.5000\Windows CE

Add reference in solution add reference when you right
xlick on your project.

at the very top of your code....
imports OpenNETCF.WinAPI.Core

ShellExecute("\windows\iexplore.exe", "html file here
(eg.\windows\inbox.htm")
 
T

Tim Wilson [MVP]

<Code Below>

using System.Runtime.InteropServices;

[DllImport("Coredll.dll")]
private extern static int CreateProcess(string pszImageName, string
pszCmdLine, IntPtr psaProcess, IntPtr psaThread, bool fInheritHandles, int
fdwCreate, IntPtr pvEnvironment, IntPtr pszCurDir, IntPtr psiStartInfo,
IntPtr pProcInfo);

private void linklblWebsite_LinkClicked(object sender,
OpenNETCF.Windows.Forms.LinkLabelLinkClickedEventArgs e)
{
CreateProcess("iexplore", e.LinkData.ToString(), IntPtr.Zero, IntPtr.Zero,
false, 0, IntPtr.Zero, IntPtr.Zero, IntPtr.Zero, IntPtr.Zero);
}
 
N

Nick

Actually, .NET Compact Framework does not have a

linklblWebsite.Links(..) method

I tried to set this by

linklblWebsite.Text = ...

but it does not work.
-----Original Message-----
<Code Below>

using System.Runtime.InteropServices;

[DllImport("Coredll.dll")]
private extern static int CreateProcess(string pszImageName, string
pszCmdLine, IntPtr psaProcess, IntPtr psaThread, bool fInheritHandles, int
fdwCreate, IntPtr pvEnvironment, IntPtr pszCurDir, IntPtr psiStartInfo,
IntPtr pProcInfo);

private void linklblWebsite_LinkClicked(object sender,
OpenNETCF.Windows.Forms.LinkLabelLinkClickedEventArgs e)
{
CreateProcess("iexplore", e.LinkData.ToString(), IntPtr.Zero, IntPtr.Zero,
false, 0, IntPtr.Zero, IntPtr.Zero, IntPtr.Zero, IntPtr.Zero);
}

--
Tim Wilson
Windows Embedded MVP

Hi,

I am trying to rise explorer during the event of a
LinkLabel but something goes wrong:

private void linklblWebsite_LinkClicked(object sender,
OpenNETCF.Windows.Forms.LinkLabelLinkClickedEventArgs e)
{
System.Diagnostics.Process.Start
(e.Link.LinkData.ToString())
}

But I get the following error:

There is no System.Diagnostics.Process namespace.

Thanks in advance


.
 
T

Tim Wilson [MVP]

The LinkLabel that you are using is not part of the Compact Framework. This
control only supports having one link, which is the typical way in which a
LinkLabel is used (IMO), almost like a link button. So you can either set
the Text property to the URL and then use linklblWebsite.Text to get the URL
for the CreateProcess call, or you can set the LinkData property to the URL
and get the URL for the CreateProcess call from the event args that is
passed to the LinkClicked event (e.LinkData.ToString()). Specifying the URL
as the LinkData allows you to use alternate Text such as "Click Here" as
opposed to displaying the entire URL as the link.

--
Tim Wilson
Windows Embedded MVP

Nick said:
Actually, .NET Compact Framework does not have a

linklblWebsite.Links(..) method

I tried to set this by

linklblWebsite.Text = ...

but it does not work.
-----Original Message-----
<Code Below>

using System.Runtime.InteropServices;

[DllImport("Coredll.dll")]
private extern static int CreateProcess(string pszImageName, string
pszCmdLine, IntPtr psaProcess, IntPtr psaThread, bool fInheritHandles, int
fdwCreate, IntPtr pvEnvironment, IntPtr pszCurDir, IntPtr psiStartInfo,
IntPtr pProcInfo);

private void linklblWebsite_LinkClicked(object sender,
OpenNETCF.Windows.Forms.LinkLabelLinkClickedEventArgs e)
{
CreateProcess("iexplore", e.LinkData.ToString(), IntPtr.Zero, IntPtr.Zero,
false, 0, IntPtr.Zero, IntPtr.Zero, IntPtr.Zero, IntPtr.Zero);
}

--
Tim Wilson
Windows Embedded MVP

Hi,

I am trying to rise explorer during the event of a
LinkLabel but something goes wrong:

private void linklblWebsite_LinkClicked(object sender,
OpenNETCF.Windows.Forms.LinkLabelLinkClickedEventArgs e)
{
System.Diagnostics.Process.Start
(e.Link.LinkData.ToString())
}

But I get the following error:

There is no System.Diagnostics.Process namespace.

Thanks in advance


.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top