Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C#
  4. C sharp Picturebox linking error

C sharp Picturebox linking error

Scheduled Pinned Locked Moved C#
csharpcomalgorithmshelp
7 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • O Offline
    O Offline
    OmurTokman
    wrote on last edited by
    #1

    Hello,

    First of all, I would like to inform you that I am not a software developer, I am dealing with it as a hobby.

    I made a simple desktop application, there is a picturebox on the form, I want a website to be opened when I click on the picture, but it gives an error. I've been searching for a few days, there are similar issues but no answer.

    Methods I have tried.

    using System.Diagnostics;

    private void pictureBox2_Click(object sender, EventArgs e)
    {
    //ProcessStartInfo adres = new ProcessStartInfo("http://www.website.com.tr");
    //System.Diagnostics.Process.Start(adres);
    //System.Diagnostics.Process.Start("https://www.website.com.tr/");
    //Process.Start(@"https://www.website.com.tr/");
    System.Diagnostics.Process.Start(@"https://www.website.com.tr/");
    }

    The error the codes give is "System.ComponentModel.Win32Exception: 'The system cannot find the file specified.' "
    Error details.

    System.ComponentModel.Win32Exception
    HResult=0x80004005
    İleti=Sistem belirtilen dosyayı bulamıyor.
    Kaynak=System.Diagnostics.Process
    StackTrace:
    at System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo)
    at System.Diagnostics.Process.Start()
    at System.Diagnostics.Process.Start(ProcessStartInfo startInfo)
    at System.Diagnostics.Process.Start(String fileName)
    at AcınımHepalama_001.Form1.pictureBox2_Click(Object sender, EventArgs e) in D:\ÖMÜR ÇALIŞMALAR\MU-uygulamarı\AcınımHepalama-001\Form1.cs:line 604
    at System.Windows.Forms.Control.OnClick(EventArgs e)
    at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
    at System.Windows.Forms.Control.WndProc(Message& m)
    at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
    at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
    at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
    at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
    at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
    at System.Windows.Forms.Application.Run(Form mainForm)

    OriginalGriffO L 3 Replies Last reply
    0
    • O OmurTokman

      Hello,

      First of all, I would like to inform you that I am not a software developer, I am dealing with it as a hobby.

      I made a simple desktop application, there is a picturebox on the form, I want a website to be opened when I click on the picture, but it gives an error. I've been searching for a few days, there are similar issues but no answer.

      Methods I have tried.

      using System.Diagnostics;

      private void pictureBox2_Click(object sender, EventArgs e)
      {
      //ProcessStartInfo adres = new ProcessStartInfo("http://www.website.com.tr");
      //System.Diagnostics.Process.Start(adres);
      //System.Diagnostics.Process.Start("https://www.website.com.tr/");
      //Process.Start(@"https://www.website.com.tr/");
      System.Diagnostics.Process.Start(@"https://www.website.com.tr/");
      }

      The error the codes give is "System.ComponentModel.Win32Exception: 'The system cannot find the file specified.' "
      Error details.

      System.ComponentModel.Win32Exception
      HResult=0x80004005
      İleti=Sistem belirtilen dosyayı bulamıyor.
      Kaynak=System.Diagnostics.Process
      StackTrace:
      at System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo)
      at System.Diagnostics.Process.Start()
      at System.Diagnostics.Process.Start(ProcessStartInfo startInfo)
      at System.Diagnostics.Process.Start(String fileName)
      at AcınımHepalama_001.Form1.pictureBox2_Click(Object sender, EventArgs e) in D:\ÖMÜR ÇALIŞMALAR\MU-uygulamarı\AcınımHepalama-001\Form1.cs:line 604
      at System.Windows.Forms.Control.OnClick(EventArgs e)
      at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
      at System.Windows.Forms.Control.WndProc(Message& m)
      at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
      at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
      at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
      at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
      at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
      at System.Windows.Forms.Application.Run(Form mainForm)

      OriginalGriffO Offline
      OriginalGriffO Offline
      OriginalGriff
      wrote on last edited by
      #2

      Try:

      System.Diagnostics.Process.Start("explorer.exe", @"https://www.website.com.tr/");

      "I have no idea what I did, but I'm taking full credit for it." - ThisOldTony "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt AntiTwitter: @DalekDave is now a follower!

      "I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
      "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt

      O 1 Reply Last reply
      0
      • O OmurTokman

        Hello,

        First of all, I would like to inform you that I am not a software developer, I am dealing with it as a hobby.

        I made a simple desktop application, there is a picturebox on the form, I want a website to be opened when I click on the picture, but it gives an error. I've been searching for a few days, there are similar issues but no answer.

        Methods I have tried.

        using System.Diagnostics;

        private void pictureBox2_Click(object sender, EventArgs e)
        {
        //ProcessStartInfo adres = new ProcessStartInfo("http://www.website.com.tr");
        //System.Diagnostics.Process.Start(adres);
        //System.Diagnostics.Process.Start("https://www.website.com.tr/");
        //Process.Start(@"https://www.website.com.tr/");
        System.Diagnostics.Process.Start(@"https://www.website.com.tr/");
        }

        The error the codes give is "System.ComponentModel.Win32Exception: 'The system cannot find the file specified.' "
        Error details.

        System.ComponentModel.Win32Exception
        HResult=0x80004005
        İleti=Sistem belirtilen dosyayı bulamıyor.
        Kaynak=System.Diagnostics.Process
        StackTrace:
        at System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo)
        at System.Diagnostics.Process.Start()
        at System.Diagnostics.Process.Start(ProcessStartInfo startInfo)
        at System.Diagnostics.Process.Start(String fileName)
        at AcınımHepalama_001.Form1.pictureBox2_Click(Object sender, EventArgs e) in D:\ÖMÜR ÇALIŞMALAR\MU-uygulamarı\AcınımHepalama-001\Form1.cs:line 604
        at System.Windows.Forms.Control.OnClick(EventArgs e)
        at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
        at System.Windows.Forms.Control.WndProc(Message& m)
        at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
        at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
        at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
        at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
        at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
        at System.Windows.Forms.Application.Run(Form mainForm)

        L Offline
        L Offline
        Lost User
        wrote on last edited by
        #3

        A simpler solution is to use a WebBrowser control on your form. See Using the WebBrowser control in .NET[^].

        O 1 Reply Last reply
        0
        • OriginalGriffO OriginalGriff

          Try:

          System.Diagnostics.Process.Start("explorer.exe", @"https://www.website.com.tr/");

          "I have no idea what I did, but I'm taking full credit for it." - ThisOldTony "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt AntiTwitter: @DalekDave is now a follower!

          O Offline
          O Offline
          OmurTokman
          wrote on last edited by
          #4

          thank you very much this code worked.

          OriginalGriffO 1 Reply Last reply
          0
          • L Lost User

            A simpler solution is to use a WebBrowser control on your form. See Using the WebBrowser control in .NET[^].

            O Offline
            O Offline
            OmurTokman
            wrote on last edited by
            #5

            Thanks for the reply, I'll look into the thread you mentioned.

            1 Reply Last reply
            0
            • O OmurTokman

              thank you very much this code worked.

              OriginalGriffO Offline
              OriginalGriffO Offline
              OriginalGriff
              wrote on last edited by
              #6

              You're welcome!

              "I have no idea what I did, but I'm taking full credit for it." - ThisOldTony "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt AntiTwitter: @DalekDave is now a follower!

              "I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
              "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt

              1 Reply Last reply
              0
              • O OmurTokman

                Hello,

                First of all, I would like to inform you that I am not a software developer, I am dealing with it as a hobby.

                I made a simple desktop application, there is a picturebox on the form, I want a website to be opened when I click on the picture, but it gives an error. I've been searching for a few days, there are similar issues but no answer.

                Methods I have tried.

                using System.Diagnostics;

                private void pictureBox2_Click(object sender, EventArgs e)
                {
                //ProcessStartInfo adres = new ProcessStartInfo("http://www.website.com.tr");
                //System.Diagnostics.Process.Start(adres);
                //System.Diagnostics.Process.Start("https://www.website.com.tr/");
                //Process.Start(@"https://www.website.com.tr/");
                System.Diagnostics.Process.Start(@"https://www.website.com.tr/");
                }

                The error the codes give is "System.ComponentModel.Win32Exception: 'The system cannot find the file specified.' "
                Error details.

                System.ComponentModel.Win32Exception
                HResult=0x80004005
                İleti=Sistem belirtilen dosyayı bulamıyor.
                Kaynak=System.Diagnostics.Process
                StackTrace:
                at System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo)
                at System.Diagnostics.Process.Start()
                at System.Diagnostics.Process.Start(ProcessStartInfo startInfo)
                at System.Diagnostics.Process.Start(String fileName)
                at AcınımHepalama_001.Form1.pictureBox2_Click(Object sender, EventArgs e) in D:\ÖMÜR ÇALIŞMALAR\MU-uygulamarı\AcınımHepalama-001\Form1.cs:line 604
                at System.Windows.Forms.Control.OnClick(EventArgs e)
                at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
                at System.Windows.Forms.Control.WndProc(Message& m)
                at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
                at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
                at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
                at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
                at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
                at System.Windows.Forms.Application.Run(Form mainForm)

                L Offline
                L Offline
                Lost User
                wrote on last edited by
                #7

                You included expected results vs. actual results. You included actual exception. Well done :thumbsup:

                Bastard Programmer from Hell :suss: "If you just follow the bacon Eddy, wherever it leads you, then you won't have to think about politics." -- Some Bell.

                1 Reply Last reply
                0
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                • Login

                • Don't have an account? Register

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • World
                • Users
                • Groups