CefSharp change scroll position and hide scroll

Do not post support requests, bug reports or feature requests. Discuss CEF here. Non-CEF related discussion goes in General Discussion!

CefSharp change scroll position and hide scroll

Postby bogdanch » Tue Apr 26, 2016 9:46 am

How can you change the scroll posițion and how can you hide the scroll bars?

In the default webbrowser in C# i used:
webBrowser1.ScrollBarsEnabled = false;
webBrowser1.Document.Window.ScrollTo(185, 400);

I can't find any equivalent in CefSharp for either of them!
bogdanch
Newbie
 
Posts: 4
Joined: Tue Apr 26, 2016 2:02 am

Re: CefSharp change scroll position and hide scroll

Postby amaitland » Tue Apr 26, 2016 4:51 pm

There is no direct equivalent that I'm aware of, you'd have to execute some javascript to change the scroll position and set some css to disable the scroll bars.
Maintainer of the CefSharp project.
amaitland
Master
 
Posts: 874
Joined: Wed Jan 14, 2015 2:35 am

Re: CefSharp change scroll position and hide scroll

Postby bogdanch » Wed Apr 27, 2016 2:34 am

amaitland wrote:There is no direct equivalent that I'm aware of, you'd have to execute some javascript to change the scroll position and set some css to disable the scroll bars.


How can I do that? I'm new to programming.
If it's any help, here's my code:

Code: Select all
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using CefSharp;
using CefSharp.WinForms;

namespace CefTest
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
            Init_Chrome();
        }


        private void Init_Chrome()
        {
            Cef.Initialize();
            ChromiumWebBrowser myBrowser = new ChromiumWebBrowser("http://www.lipsum.com/");
            myBrowser.Dock = System.Windows.Forms.DockStyle.Fill;
            this.Controls.Add(myBrowser);
        }



    }
}


Thanks!
bogdanch
Newbie
 
Posts: 4
Joined: Tue Apr 26, 2016 2:02 am

Re: CefSharp change scroll position and hide scroll

Postby amaitland » Wed Apr 27, 2016 6:47 am

If you installed `CefSharp` through `Nuget` it would have opened https://github.com/cefsharp/CefSharp/bl ... me.txt#L36

Try reading through the `FAQ`, browsing the source, it has examples projects.
Maintainer of the CefSharp project.
amaitland
Master
 
Posts: 874
Joined: Wed Jan 14, 2015 2:35 am


Return to CEF Discussion

Who is online

Users browsing this forum: No registered users and 3 guests