C# Tutorial - Chromium Browser with Tabs using CefSharp | FoxLearn

แชร์
ฝัง
  • เผยแพร่เมื่อ 27 ธ.ค. 2024

ความคิดเห็น • 161

  • @MuffinologyTrainer
    @MuffinologyTrainer 8 ปีที่แล้ว +7

    This is great! Thanks for the effort of releasing this for free to the public! :)

    • @foxlearn
      @foxlearn  8 ปีที่แล้ว +3

      thank you so much :)

  • @heemozero4035
    @heemozero4035 ปีที่แล้ว

    Thanks . How can I add close button for each tab ?

  • @Igor108ru
    @Igor108ru 2 ปีที่แล้ว

    how to create a new tab via the OnBeforePopup event?

  • @HyperBassYT
    @HyperBassYT 3 ปีที่แล้ว

    Hello, What is the code to remove the tab after I added one?

  • @neo34rd
    @neo34rd 8 ปีที่แล้ว +2

    Thanks a lot! Are there are other references on how to use cefsharp? Also how do I display java elements? Certain websites don't display properly using this tutorial! External documents of any kind will help!

    • @foxlearn
      @foxlearn  8 ปีที่แล้ว +2

      Hi, You can view more details at github.com/cefsharp/CefSharp . Thanks

  • @大帅比-v1m
    @大帅比-v1m 4 ปีที่แล้ว

    Thanks ! Love from China ~

  • @muhammedakyuz2887
    @muhammedakyuz2887 3 ปีที่แล้ว

    Thx bro, great tutorial.

  • @lanaolushola8894
    @lanaolushola8894 5 ปีที่แล้ว +1

    Please can a cerfsharp app run on a 32bit machine/os? considering it was built with 64bit config.

    • @foxlearn
      @foxlearn  5 ปีที่แล้ว

      Yes, you should set build 32 bit

  • @MrBricklyAwesome
    @MrBricklyAwesome 7 ปีที่แล้ว +2

    Hi is it possible to add history or favourites to this browser . Great tutorial though!

    • @alibabaskafe5393
      @alibabaskafe5393 7 ปีที่แล้ว +2

      Yes, of course its passible!!
      This may help you:
      www.codeproject.com/Articles/60179/Web-Browser-in-C#History&Favorites4

  • @NK34Player
    @NK34Player 4 ปีที่แล้ว

    how to change the title or the text of the tab??? replay fast plz

  • @TheSKDown
    @TheSKDown 7 ปีที่แล้ว

    Hello, do you know how to add a support for mp4 files, because by default the chromium web browser doesn't play these videos?

    • @MCHealo9999
      @MCHealo9999 7 ปีที่แล้ว

      Probably too complex for you

    • @cossinle
      @cossinle 4 ปีที่แล้ว

      @@MCHealo9999 :I

    • @cossinle
      @cossinle 4 ปีที่แล้ว

      You can probably check for mp4 files, and then use wmp to play it

  • @SuperMario9078
    @SuperMario9078 4 ปีที่แล้ว +1

    How do i remove a tab

  • @СаидЛутфуллин
    @СаидЛутфуллин 4 ปีที่แล้ว

    Excelent video. But wpf is nedded too!

  • @mrrickr121
    @mrrickr121 8 ปีที่แล้ว +1

    woww :) what a tutorial... Thank you mam....

    • @foxlearn
      @foxlearn  8 ปีที่แล้ว +1

      Thank you :)

    • @andreibalasa745
      @andreibalasa745 6 ปีที่แล้ว

      I have a problem... My webbrowser only shows a blank page. The address is correct.

  • @TERIHAX
    @TERIHAX 3 ปีที่แล้ว

    Thanks lol, but can you tell me how I can add an Icon to the tab?

  • @houseflippertuts5118
    @houseflippertuts5118 2 ปีที่แล้ว

    help! System.ArgumentOutOfRangeException: „Indeks 0 jest poza zakresem.
    Nazwa parametru: index”

  • @FanJapanStudios
    @FanJapanStudios 5 ปีที่แล้ว +1

    *Question*
    What is the difference between _System.Windows.Forms.WebBrowser_ and _Chromium Browser_

    • @foxlearn
      @foxlearn  5 ปีที่แล้ว +1

      Chromium building by chromium open source as same as google chrome

  • @Jaguarek62
    @Jaguarek62 6 ปีที่แล้ว

    The OutputPath property is not set for project 'WindowsFormsApp1.csproj'. Please check to make sure that you have specified a valid combination of Configuration and Platform for this project. Configuration='Debug' Platform='x64'. This error may also appear if some other project is trying to follow a project-to-project reference to this project, this project has been unloaded or is not included in the solution, and the referencing project does not build using the same or an equivalent Configuration or Platform. WindowsFormsApp1 i guess rip?

    • @foxlearn
      @foxlearn  6 ปีที่แล้ว

      Please select x64 platform, then rebuild your project again

  • @AngrejKumar
    @AngrejKumar 6 ปีที่แล้ว

    Its not working in WPF App. I'm try adding this.container.Controls.Add(chrome), then figure out I have to use container.Children.Add(chrome) for WPF. But still not working.
    Error:
    cannot convert from 'CefSharp.WinForms.ChromiumWebBrowser' to 'System.Windows.UIElement'

  • @tonywekesa2877
    @tonywekesa2877 4 ปีที่แล้ว

    Hw do u change background color

    • @icedwarm69
      @icedwarm69 4 ปีที่แล้ว

      It can be easily changed in the Property menu

    • @tonywekesa2877
      @tonywekesa2877 4 ปีที่แล้ว

      @@icedwarm69 am looking for code that can change background color of cef browser during runtime of the program

  • @tobihudiat
    @tobihudiat 4 ปีที่แล้ว

    Thanks! Finally C# and not C++

    • @foxlearn
      @foxlearn  4 ปีที่แล้ว

      Thank you !

  • @rolstonholas333
    @rolstonholas333 4 ปีที่แล้ว

    Hi Guys, thank you for the video but I am getting a few errors and I was wondering if you could help. 1) TabPage does not contain a definition for SelectedTab; 2) TabPage does not contain a definition for SelectTab & 3) TabPage does not contain a definition for TabCount.
    Do you have any plans to update this video to add extra Chromium features?

  • @mylo5641
    @mylo5641 6 ปีที่แล้ว

    so happy it is in c#, the only coding language i understand at the moment!

    • @foxlearn
      @foxlearn  6 ปีที่แล้ว

      That's great & thank you :)

  • @KK-rd5rx
    @KK-rd5rx 8 ปีที่แล้ว

    there is something that i did not get it.How may i make a key pressing enter in the textbox using chromium please???Cuz in this tuto you are using a button "Go" BUT IF i want to press just enter in the textbox how may i do it using chromium?

    • @foxlearn
      @foxlearn  8 ปีที่แล้ว

      Hi, You can copy all code in the button click to textbox key press event, check e.keychar == (char)13. thanks

    • @skiuileuf
      @skiuileuf 7 ปีที่แล้ว +1

      Use this in the "Key down" event of the button:
      if (e.KeyCode == Keys.Enter)
      {
      buttonGo.PerformClick();
      // these last two lines will stop the beep sound
      e.SuppressKeyPress = true;
      e.Handled = true;
      }

  • @locngo4556
    @locngo4556 5 ปีที่แล้ว

    hello plz help!
    when code: ChromiumWebBrowser chrome;
    hv 2 messages: Make field readonly
    and private member'form1.chrome' is unused
    thank you!

    • @foxlearn
      @foxlearn  5 ปีที่แล้ว

      Thank you !

  • @blutkraehe_official
    @blutkraehe_official 5 ปีที่แล้ว

    great nnice thanks ... i want with this browser work with my office 365 account , but he dont store the account
    and I always have to enter it again every time I start .... will the cache be emptied?

    • @bpittman1
      @bpittman1 4 ปีที่แล้ว

      There is no cache. Chromium Embedded Framework (CEF) is just Chrome's V8 JavaScript engine, a CSS parser, and an HTML renderer. It's not the entire Chrome browser. CefSharp is a C# wrapper for CEF (which is written in C++). A cache is something you have to program individually. So unfortunately, if you want a fully functioning browser this is not the way to do it.

  • @МаксИльин-в3ф
    @МаксИльин-в3ф 8 ปีที่แล้ว

    hi, in my project after adding packages i can not to find in configuration manager. And losing all links to librarys

    • @МаксИльин-в3ф
      @МаксИльин-в3ф 8 ปีที่แล้ว

      i m idiot - i thing that in configuration manager 2 rows...

    • @foxlearn
      @foxlearn  8 ปีที่แล้ว

      Hi, You need to add System.Configuration.dll to your project. Thanks

  • @cemrekaraibrahim9542
    @cemrekaraibrahim9542 6 ปีที่แล้ว

    is it possible to force chromiumwebbrowser to work like Internet Explorer 7

    • @foxlearn
      @foxlearn  6 ปีที่แล้ว

      i think it can

    • @cemrekaraibrahim9542
      @cemrekaraibrahim9542 6 ปีที่แล้ว

      @@foxlearn i couldnt find something about it. I need to support ie7 and chrome in different tabs at the same time.

  • @mohammed1406
    @mohammed1406 8 ปีที่แล้ว

    thank you fox for this lesson
    i try it but i get errors
    I added all Nuget we need put i get 4 error
    this is the message :
    The type or namespace name 'CefSharp' could not be found (are you missing a using directive or an assembly reference?)
    and the other error for chromiumwebform and addresschangedeventargs
    i but in Name spaces those
    using CefSharp.WinForms;
    using CefSharp;
    but it does not work yet
    please help

    • @foxlearn
      @foxlearn  8 ปีที่แล้ว

      Hi, You need install cefsharp, then select your cpu target, please try again. thanks

    • @mohammed1406
      @mohammed1406 8 ปีที่แล้ว

      Ok i'll try it then i see what's happening, thanks alot 😊

    • @henrykelsey7259
      @henrykelsey7259 8 ปีที่แล้ว

      Fox Learn

  • @anshuvishwakarma6020
    @anshuvishwakarma6020 2 ปีที่แล้ว

    How to automate WhatsApp throw cefsharp?

  • @Decurion
    @Decurion 7 ปีที่แล้ว

    how create delete tab?
    if i start watch video from my browser and closed tab video don't stop, how correctly closed tab?

    • @foxlearn
      @foxlearn  7 ปีที่แล้ว +1

      Hi, By default tab control don't support close button, you can make a custom tab by inheritance tab control. You can reference www.dotnetspider.com/resources/29206-Custom-drawn-Close-button-TabControl.aspx. Thank you

    • @HyperBassYT
      @HyperBassYT 3 ปีที่แล้ว

      @@foxlearni just want another button that can close the tab, instead of a close icon on the tab PLEASE REPLY

  • @kshitizbathwal7509
    @kshitizbathwal7509 8 ปีที่แล้ว +1

    Hey! Ur tutorial series is awesome. I just need a tutorial on how to connect a VB.NET or C#.NET application with mysql database to connect to a remote server like mysql in GODADDY cpanel or localhost mysql using WAMP or XAMPP. I will be highly highly grateful if you could provide a detailed tutorial on tht. It will help to learn real world app development. If u do so pls reply! I desperately waiting. I couldnt find it anywhere :( I have high hopes from u maam..'
    THANK YOU!

    • @foxlearn
      @foxlearn  8 ปีที่แล้ว +1

      OK. thank you for your suggestion. I'll make the tutorial soon !

  • @tampavedada
    @tampavedada 8 ปีที่แล้ว

    Dude, please with this CEFsharp component is it possible to get html or not?
    I tried and could not. :/

    • @foxlearn
      @foxlearn  7 ปีที่แล้ว

      Yes, You can use CefSharp API to get html, thanks

    • @tampavedada
      @tampavedada 7 ปีที่แล้ว

      I could not.
      Can you help me with an example please?

    • @RootShedz
      @RootShedz 5 ปีที่แล้ว +1

      @@tampavedada It's a web browser you goon

  •  8 ปีที่แล้ว

    Can I print CefSharp site text?

    • @foxlearn
      @foxlearn  8 ปีที่แล้ว

      Hi. You can view this video th-cam.com/video/cFvo48Ix_Xc/w-d-xo.html to know how to print a winform. thanks

    •  8 ปีที่แล้ว

      No. I am writing a text on the textbox cefsharp I want to print the site on the browser

    •  8 ปีที่แล้ว

      no. I want to print text cefsharpbrowser

  • @super_goal_app
    @super_goal_app 4 ปีที่แล้ว

    The size of project is 645 MB what the proplem??? help me please.

    • @foxlearn
      @foxlearn  4 ปีที่แล้ว

      Library need to run your application

  • @fernandoalejandrogonzalezr4813
    @fernandoalejandrogonzalezr4813 7 ปีที่แล้ว

    Que tal man, me puedes pasar codigo de como hacer autologin con webkitbrowser.. no logro k funcione

    • @foxlearn
      @foxlearn  7 ปีที่แล้ว

      Hi, What' your email? Thank you

  • @hotsoda46
    @hotsoda46 3 ปีที่แล้ว

    private void Chrome_AddressChanged(object sender, EventArgs e)
    {
    this.Invoke(new MethodInvoker(() =>
    {
    txtUrl.Text = e.Address;
    }));
    }
    e.Address gives me a red line, how to fix?

    • @hotsoda46
      @hotsoda46 3 ปีที่แล้ว

      forgot to put AddressChangedEventArgs instead of EventArgs, fixed it

  • @hereticstanlyhalo6916
    @hereticstanlyhalo6916 5 ปีที่แล้ว

    How to get address of currently selected tab?

    • @foxlearn
      @foxlearn  5 ปีที่แล้ว

      I think you should find url textbox in tab control, then you can get address tab

  • @JJKhng
    @JJKhng 7 ปีที่แล้ว

    hi, is there any possibility why "txtUrl.text" and "p.container" does not exist in my current context? it is highlighted in red.

    • @raphamasteryt5906
      @raphamasteryt5906 ปีที่แล้ว +1

      it is because the right is txtUrl.Text and pContainer, not txtUrl.text and p.container

    • @raphamasteryt5906
      @raphamasteryt5906 ปีที่แล้ว +1

      i hope that was what you were looking for

    • @raphamasteryt5906
      @raphamasteryt5906 ปีที่แล้ว +1

      also it depends on how you wrote it on your designer

    • @raphamasteryt5906
      @raphamasteryt5906 ปีที่แล้ว +1

      i dont know if this was useful since im replying from 5 years later but if you still have it, then i hope i could help in something

  • @457Deniz457
    @457Deniz457 4 ปีที่แล้ว

    Hi there ! :)
    I love ur tutorial ! But could you maybe anser me how I can get elements by #ByTagName ?
    And also get element #ById ?
    Bcs I want to read out a site and want to do simple things like push the button and put strings in for a login.
    In the "normal" browser with IE it's easy but I don't get it how I can handle it here.
    I searched and testet it nearly the whole day^^...
    I would appreciate any help a lot ! :)

    • @foxlearn
      @foxlearn  4 ปีที่แล้ว +1

      I think you should use html library to get element from website. I'll upload soon on my site. thank you for your suggestion !

    • @457Deniz457
      @457Deniz457 4 ปีที่แล้ว

      @@foxlearn :O !
      Thanks for uploading ! :)
      I invested 2 days and could not simply get any element/s and do a simple (mous-)click and a simple put in string value somewhere.
      I need that so much ! :D
      Thanks again for uploading and any help !

    • @cybercity93046
      @cybercity93046 2 ปีที่แล้ว

      @@457Deniz457 not find that video

    • @cybercity93046
      @cybercity93046 2 ปีที่แล้ว

      Video not find about getelement by id example

  • @RahulSri
    @RahulSri 8 ปีที่แล้ว

    nice tut

    • @aheartb
      @aheartb 8 ปีที่แล้ว

      Same here.

    • @RahulSri
      @RahulSri 8 ปีที่แล้ว

      Aheartb : simply change debuging mode to x86 nd it will run

  • @jarno2427
    @jarno2427 3 ปีที่แล้ว

    Please make webview 2 example

  • @kovoliver
    @kovoliver 7 ปีที่แล้ว

    And how can I close tabs?

    • @MCHealo9999
      @MCHealo9999 7 ปีที่แล้ว

      Add an option?

    • @icantthinkofaname6794
      @icantthinkofaname6794 6 ปีที่แล้ว

      This is the best i came up with
      ChromiumWebBrowser browser = tabControl1.SelectedTab.Controls[0] as ChromiumWebBrowser;
      if (browser != null)
      //to stop video from playing
      browser.Load("about:blank");
      tabControl1.TabPages.RemoveAt(tabControl1.SelectedIndex);

    • @HyperBassYT
      @HyperBassYT 3 ปีที่แล้ว

      @@icantthinkofaname6794 Hi, this is giving me errors...

    • @HyperBassYT
      @HyperBassYT 3 ปีที่แล้ว

      @@icantthinkofaname6794 It underlines "SelectedTab" specifically

  • @nhocmumble
    @nhocmumble 5 ปีที่แล้ว

    thank so much!

    • @foxlearn
      @foxlearn  5 ปีที่แล้ว

      Thank you !

  • @nahiandev
    @nahiandev 7 ปีที่แล้ว

    I made it all but need to know how to close a tab ? Anyone help please.

    • @foxlearn
      @foxlearn  7 ปีที่แล้ว

      Hi, The tab control doesn't support close button, you can custom tab control allows you to close a tab page

    • @skiuileuf
      @skiuileuf 7 ปีที่แล้ว

      Hey dude... don't know if you still need this but here it is (not my code, found on stack overflow):
      Set the DrawMode property of the Tab Control to OwnerDrawFixed. This property is decides whether system or developer painting the captions. Add the code in the DrawItem event of the Tab Control - This event will be invoked for painting each Tab Page.
      //This code will render a "x" mark at the end of the Tab caption.
      e.Graphics.DrawString("x", e.Font, Brushes.Black, e.Bounds.Right - 15, e.Bounds.Top + 4);
      e.Graphics.DrawString(this.tabControl1.TabPages[e.Index].Text, e.Font, Brushes.Black, e.Bounds.Left + 12, e.Bounds.Top + 4);
      e.DrawFocusRectangle();
      Now for close button action, we need to add the following code to the MouseDown event of the Tab Control.
      //Looping through the controls.
      for (int i = 0; i < this.tabControl1.TabPages.Count; i++)
      {
      Rectangle r = tabControl1.GetTabRect(i);
      //Getting the position of the "x" mark.
      Rectangle closeButton = new Rectangle(r.Right - 15, r.Top + 4, 9, 7);
      if (closeButton.Contains(e.Location))
      {
      if (MessageBox.Show("Would you like to Close this Tab?", "Confirm", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
      {
      this.tabControl1.TabPages.RemoveAt(i);
      break;
      }
      }
      }
      All credits go to andycted on Stack Overflow

    • @owenbell7032
      @owenbell7032 7 ปีที่แล้ว

      just made this code
      tabControl1.SelectedTab.Dispose();

    • @flame2385
      @flame2385 5 ปีที่แล้ว

      or tabControl1.TabPages.Remove(tabControl1.SelectedTab);

    • @HyperBassYT
      @HyperBassYT 3 ปีที่แล้ว

      @@flame2385 thank you for your help, but none of this is working for me!!!

  • @fuad1946
    @fuad1946 6 ปีที่แล้ว

    ty sir !

  • @SaifSMajeed
    @SaifSMajeed 4 ปีที่แล้ว

    can you give us the source code please

  • @solinymm
    @solinymm 7 ปีที่แล้ว

    Welcome to The Fox Lee air nne

    • @foxlearn
      @foxlearn  7 ปีที่แล้ว

      Thanks !

  • @bobilondon01
    @bobilondon01 4 ปีที่แล้ว

    can you show us the source link my guy

  • @IrfanAli-jw9wm
    @IrfanAli-jw9wm 6 ปีที่แล้ว

    i create browser install butt this error coming CefSharp.Core.dll please provide solution

    • @foxlearn
      @foxlearn  6 ปีที่แล้ว

      Please try to set the target framework for your application to x64 or x86

  • @MCHealo9999
    @MCHealo9999 7 ปีที่แล้ว +1

    0:01
    *welCOME to TEH FOUXLEIRN*

  • @Ara_vind797
    @Ara_vind797 4 ปีที่แล้ว

    Good video. source code please 😃

  • @solinymm
    @solinymm 7 ปีที่แล้ว

    Tip: Chrome uses Material Design

    • @foxlearn
      @foxlearn  7 ปีที่แล้ว

      Thank you for your suggestion !

  • @kamalennaji5970
    @kamalennaji5970 7 ปีที่แล้ว

    Please I cant use it in another device

  • @vapon
    @vapon 7 ปีที่แล้ว

    So all those robot movies will come true.

    • @foxlearn
      @foxlearn  7 ปีที่แล้ว

      Thank you. i haven't got record studio

  • @frizeio7915
    @frizeio7915 8 ปีที่แล้ว

    I installed cefsharp, And after I restarted visual studio, The designer broke. I removed cefsharp and it worked. 0/10.

    • @foxlearn
      @foxlearn  8 ปีที่แล้ว

      Hi, You need to rebuild your project, then select your cpu target (x86 or x64). thanks

  • @umidkurbanov5495
    @umidkurbanov5495 5 ปีที่แล้ว

    oh baby. I really love ur sweet voice

  • @innavasilyeva1217
    @innavasilyeva1217 6 ปีที่แล้ว

    WinForms in 2016... Hmmm...

    • @foxlearn
      @foxlearn  6 ปีที่แล้ว

      Thank you !