Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Putting a tranparent panel of lable over a web browser control

Status
Not open for further replies.

flbos

Programmer
Sep 15, 2005
41
NL
In my application I use the 'windows webbrowser component' (com component) to preview .doc .pdf .xls and .txt files on my form. This works fine but I don't want my users to be able to edit the documents. They can when I use the webbrowser control because the control loads (for example) ms word when opening a .doc file and then the user is able to edit the text and save it using ctrl-s

To prevent users from doing this I thought it would be a nice solution to lay a transparent lable or panel over the webbrowser control (only not over the area where the scrollbars are) so that the user would not be able to enter the part of the webbrowser control that allows the user to edit anything.

However, I can't get this to work. I try the following (in form load):

pnlWebbrowser.Parent = AxWebBrowser
pnlWebbrowser.BackColor = Color.Transparent

axwebbrowser is the webbrowser control and pnlwebbrowser is the panel that is placed over the webbrowser control and should be transparent. But when I try the above the panel just doesn't become transparent. It lays over the webbrowser conrol but keeps its grey color and thus prevents the user from reading the previewed document.

When I try the above solution by laying the panel over a textbox it works perfectly. I can see the textbox but can't enter it because the transparent panel lays over it. I don't quite understand why the solution doesn't work with the webbrowser control.

Anyone who has an explanation and, even better, a solution (or alternative solution) for my problem??
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top