|
Well if you were using flash then maybe you would want user interaction? If so then the simple answer would be use a picture box now and a webcontrol when you need it.
Another suggestion, not tested, but you could try create a transparent panel that covers the webcontrol hopefully capturing any user interaction attempted.
Just like a piece of glass that stops passers by helping themselves to the pie that you left cooling on the side by the window.
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|
|
I've tried that panel idea and it doesn't get transparent because I have more than one layers so Windows can't process it.
|
|
|
|
|
SimpleData wrote: How can I make the webBrowser to seem like functioning just like a picturebox?
Then why not using Picturebox itself. Either download the Image from web site of set it to Picture Box. Or You can directly set the Picture box ImageLocation of that particular image.
Like
pictureBox1.ImageLocation = "http://www.codeproject.com/SiteRes/CP/Img/Std/logo225x90.gif";
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
I know it isn't the answer, but this snippet was great. I've used my own code to get an image and put it in a PictureBox for years, never noticing this property. Thanks
Between the idea
And the reality
Between the motion
And the act
Falls the Shadow
|
|
|
|
|
So you need help for turning a mediocre Control (WebBrowser) into a really bad one (PictureBox)?
I think I'll pass unless you manage to provide a reasonable explanation.
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
I am not actually trying to turn a webbrowser into a picturebox. I am just trying to make it feel like less webbrowser-ish
|
|
|
|
|
I'm guessing that there's more in the webbrowser then 'just' a logo. Text with markup, perhaps?
Maybe you could use the Control.DrawToBitmap function, to paint the contents of the webbrowser into a bitmap? You could then show the generated bitmap in a PictureBox [^].
|
|
|
|
|
Yes there might be more than just a logo in the webBrowser control, like text or flash animations.
For everything except the flash animation DrawToBitmap is a great solution. But not completely suitable for me.
Thank you all for your answers by the way.
|
|
|
|
|
Last option[^] that I'm aware of would be to override WndProc and eat all messages regarding the mouse
|
|
|
|
|
That could be a little bit much.
I will go for Picturebox.ImageLocation for now.
|
|
|
|
|
I like your thinking, keep up the good work
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|
|
Thanks
|
|
|
|
|
Hi SimpleData,
I think we're kind of "dancing" around here trying to guess what you are doing, but it seems to me that if your usage scenario is this :
1. I want a PictureBox, and under certain conditions I want a WebBrowser
Then why not write dynamic code so that when the right conditions are met you take the default control you are showing (either PictureBox or WebBrowser) and replace it with the other control.
You could pre-configure a WebBrowser, and hide it until required at run-time and then, when you make it visible, hide the PictureBox, or you could create a new WebBrowser on the fly, on-demand.
Why use a "heavy weapon" like a WebBrowser until you need it ?
If you've really got to make an un-clickable WebBrowser, use the very common JavaScript snippets that disable the click event and disable the context menu, etc.
best, Bill
"Many : not conversant with mathematical studies, imagine that because it [the Analytical Engine] is to give results in numerical notation, its processes must consequently be arithmetical, numerical, rather than algebraical and analytical. This is an error. The engine can arrange and combine numerical quantities as if they were letters or any other general symbols; and it fact it might bring out its results in algebraical notation, were provisions made accordingly." Ada, Countess Lovelace, 1844
|
|
|
|
|
Hello Everyone!
I am building a test application that plays video files. I found a tutorial and am importing WinMM.dll, and calling mciSendString to open the file and then play it back. It works great for almost all videos except MPEG-4. When I load an MPEG-4 file, MCI returns an error that the specified device is not open or not recognized by MCI. I originally thought this to be a codec issue, however I can open and play the file back in Windows Media Player just fine. I went and downloaded ffdshow just in case, but I still receive this error from the MCI device. Is there something I am missing to tie this together, or is it just not possible? If it is not possible, could someone please point me in the right direction to head so I can make an application that allows me to play back MPEG-4 video? I only need very basic control (Play,Stop,Pause,Seek). I am building an application that is going to view two video files side by side and display them simultaneously for evaluation.
Thank you in advance!
EDIT: I think they are using H.264 encoding on their MPEG-4 file if that helps, but none of the video inspectors that I have used on the file have been able to successfully tell me what codec exactly it is using.
|
|
|
|
|
i have multiple forms in C# desktop application,one of the forms contain timer control,if i close that form and open another form then would the timer control will dispose itself or should have to be disposed manually?
Regards
|
|
|
|
|
wasifmuneer wrote: would the timer control will dispose itself
Yes!
Manas Bhardwaj
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
sorry i couldn't get answer..properly..
what is meant by "yes"..
|
|
|
|
|
I qouted the part of question and thn said yes.
In between, once you close the form the timer control created inside that will dispose itself. You do not need to explicitly do this.
Manas Bhardwaj
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
thanks a lot..
Have a nice time..
Regards
|
|
|
|
|
Hi, I want to copy selected text (e.g. from Firefox) to clipboard using hot key.
This is part of my code:
switch (m.Msg)
{
case WM_HOTKEY:
if ((short)m.WParam == hotkey.HotkeyID)
{
Clipboard.Clear();
SendKeys.SendWait("^c");
SendKeys.Flush();
if (Clipboard.ContainsText())
{
string text = Clipboard.GetText(TextDataFormat.UnicodeText);
RichTextBox rtb = new RichTextBox();
rtb.Text = text;
rtb.SelectAll();
rtb.SelectionFont = new Font(new FontFamily("Verdana"), 9.0f, FontStyle.Regular);
Clipboard.SetText(rtb.Rtf, TextDataFormat.Rtf);
}
else
{
MessageBox.Show("Error!");
}
}
break;
default:
base.WndProc(ref m);
break;
}
When I use my application first time it is working fine, but later I recive message "Error".
Can anybody help me solve this problem?
Thanks...
|
|
|
|
|
jaro16 wrote: but later I recive message "Error".
What error your are gettng?
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
Well the error message your getting looks like the one you have in the messagebox in your else block. Which as every good programmer should no will only happen when your if statement (or any addition else if statements) fails. i.e. Clipboard.ContainsText() is returning false
Life goes very fast. Tomorrow, today is already yesterday.
modified on Friday, July 24, 2009 8:17 AM
|
|
|
|
|
I'm a bit puzzled about your intentions here.
So you are trying to convert text to formatted text, however when you execute Clipboard.SetText(rtb.Rtf, TextDataFormat.Rtf); the formatted test *replaces* the original text, hence the next time your code runs it doesn't find any text on the clipboard.
If what you want is having both unformatted and formatted text on the clipboard, there are ways to do that with DataObject IIRC; however even then executing your code twice wouldn't make much sense since it would replace the formatted text by the same formatted text.
Maybe all you need to do is remove the MessageBox?
or think about your functional requirements first and tell us about them.
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
My purpose is copy to clipboard selected text (for example in Firefox, Notepad, etc.) using hot key (for example (Ctrl+Shift+C).
I select text and use my hot key. Text is in clipboard, fine. But only if I use it first time. Later my clipboard is empty.
Why?
|
|
|
|
|
Hi. experts...
iam using bulk copy to copy l lac of records from one table to another table which was in a different servers ... when code goes evrey thing fine .... it was getting timeout error .... i checked for 10 thousand rows it was working fine.......... even i incresed the max pool size plz find the solution.........
|
|
|
|