Draw Control like Webbrowser ?!
If you need help with a project or need to know how to do something specific in VB.NET then please ask your questions in here.
Forum rules
Please LOCK your topics once you have found the solution to your question so we know you no longer require help with your query.
Please LOCK your topics once you have found the solution to your question so we know you no longer require help with your query.
5 posts
Page 1 of 1
Hey Guys,
i would like to know how i can create a Control like Webbrowser that i can import into the Toolbox and drop it to my Form, i want it with white background and i can resize it like the WB Control, how i can draw such control ? with rectangle anyway ?
Greetz PayneStudios
i would like to know how i can create a Control like Webbrowser that i can import into the Toolbox and drop it to my Form, i want it with white background and i can resize it like the WB Control, how i can draw such control ? with rectangle anyway ?
Greetz PayneStudios
Do you want custom web browser? Or just white control in toolbox ?
I wonna do a custom browser, but first i need a white resizeable control
Under your own class (example Form1) - after "End Class"
Add this:
Add this:
Code: Select all
So, it should look like this, then add control from toolbox ;)
Public Class MyWhiteControl
Inherits Control
Protected Overrides Sub OnPaint(ByVal e As System.Windows.Forms.PaintEventArgs)
e.Graphics.FillRectangle(Brushes.White, e.ClipRectangle)
MyBase.OnPaint(e)
End Sub
End Class
Code: Select all
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
MsgBox("Hello")
End Sub
End Class
Public Class MyWhiteControl
Inherits Control
Protected Overrides Sub OnPaint(ByVal e As System.Windows.Forms.PaintEventArgs)
e.Graphics.FillRectangle(Brushes.White, e.ClipRectangle)
MyBase.OnPaint(e)
End Sub
End Class
5 posts
Page 1 of 1
Copyright Information
Copyright © Codenstuff.com 2020 - 2023