Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to set scrollbar to web browser control when document.body size increases?
    primarykey
    data
    text
    <p>I am working on C# win from.I am created one user control which is holding the HTML type of information and displaying it in web browser control(web browser control placed in user control)all user control filled with information and display to the users as per requested(by date &amp; time). but i fixed the size(Height &amp; width) of web browser. when information is larger then web browser it should show the scroll bar so user can scroll it. this all user control i filed with information and placed in table panel.then table panel object reference is given to other table object (which is in another C# project). and then this table panel is added with panel control and display it.</p> <p>Problem is that when size of user control's web browser control changed(I checked sized in Document Completed event and set the web browser.Scroll Bars Enabled = true;) the information which is holding by web browser will not displaying.</p> <p>Following is my code</p> <pre><code>private void wbContainer_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e) { if ((this.wbContainer.Document.Body.ScrollRectangle.Size.Height &gt; this.wbContainer.Size.Height)) { this.wbContainer.ScrollBarsEnabled = true; this.wbContainer.Refresh(); } } </code></pre> <p>User control is added in table panel</p> <pre><code>public TableLayoutPanel createInfoSection(string arg_startDateTime, string arg_endDateTime) { Control objControl = null; int Rows = 3; objTablePageNotes = new TableLayoutPanel(); // Initialized tableLayoutPanel property objTablePageNotes = setTablePanelProperties(objTablePageNotes); //returning the collection of html information InformationCollection objInformationCollection = new InformationCollectionManager().GetInformationCollectionData(arg_startDateTime, arg_endDateTime); if (objInformationCollection != null) { if (objInformationCollection.Count &gt; 0) { foreach (InformationList objList in objInformationCollection) { //this will return control with filling the html information objControl =ControlFactory.getControl("InfoTemplate",objList.HtmlInformation); objControl.Dock = DockStyle.Fill; objTablePageNotes.SetColumnSpan(objControl, 1); objTablePageNotes.Controls.Add(objControl, 1, Rows); objTablePageNotes.ResumeLayout(true); objTablePageNotes.RowStyles.Clear(); objTablePageNotes.RowStyles.Add(new RowStyle(SizeType.AutoSize)); objTablePageNotes.RowCount = Rows; Rows++; } } } return objTablePageNotes; } </code></pre> <p>then this table panel object ref is assigned to </p> <pre><code> tbPanelNoteSection = new CanvasDesignHandler().createInfoSection(_STARTDATE, _ENDDATE); </code></pre> <p>finally it added to panel control</p> <pre><code> this.pnlPage.Controls.Add(tbPanelNoteSection); </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload