|
repost. same question in two forums. decide the forum and please ask once.
|
|
|
|
|
|
Hi
I have been given the task of making an application thumbnail viewer. I would like to be able to put a thumbnail in a container when an applications main form passes over the widget. Can someone please help me get started? The main problem I am facing is how to recieve a drap over or drag drop event in a container from an appliation that passes over it. Its not just any application. I do have the source code for the applicatoins I want to minimize in this thumbnail viewer and can send them messages that tell them to make a thumbnail file out of there focused window. The problem I am having is
1. What container can recieve drap drop events from an applicaton that passes over it? (I tried a flowlayout which can only recieve events from and object derived from a windows control which doesn't include forms)
Please can someone point me to some documentation or example code that may get me started?
The basic behavoir I want is like what google chrome does to minimize an application in its thumbnail veiwer and then restore it
|
|
|
|
|
Drag & Drop must be somehow initialized. When you drag an application window on your desktop, that initialization does not take place, hence you cannot get a DragOver or DragDrop event from that action.
Consequently, you must try a totally different approach. When a foreign window is dragged over your application window, some regions become hidden, and with dragging along, some regions will become visible again, and must be repainted. The Invalidated or Paint events could be useful. Check there whether there is another window overlapping with your application's main window, take a screen shot of that window, and add it to your list of images/thumbnails.
|
|
|
|
|
Hi Everyone, i just managed to get a snapshot from a camera (tnx to DSHOW.NET and Directx.capture ) ... and I want to have date and time in that picture (obviously the camera can't display it int he stream) ... so ... does anyone knows how to do it? been looking for a while in the forums and stuff with no result at all ... tnx in advance!
--
Juan Pablo Herrera
|
|
|
|
|
yep:
1. Image.FromStream() or Image.FromFile() if the image starts of on disk
2. Graphics.FromImage()
3. Graphics.DrawString()
4. Image.Save()
warning: #4 will fail if FromFile and same filename.
Any of the above are popular with Google and in the CodeProject articles.
Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.
|
|
|
|
|
|
you're welcome.
Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.
|
|
|
|
|
Hallo
I have the typical case of a form with some controls bound to a bindingsource (backed by a database).
If the control default value is somewhat acceptable for the user (eg. a dtp shows the current date or a check box is unchecked) he lets them untouched, assuming their values will be written as is in the database.
But this doesn't happen: if a control isn't touched by a user, it is ignored by bindingSource's EndEdit method.
How can I avoid this?
(I suppose this have already been discussed in many places, but I cannot find references, maybe I'm Googling with wrong keywords)
|
|
|
|
|
I found the answer at http://www.dotnetmonster.com/Uwe/Forum.aspx/dotnet-ado-net/18455/Binding-DateTimePicker[^]
Specifically:
"Bart Mermuys - 28 Dec 2006 12:06 GMT
[...] well it's the Binding that has a (private) modified flag which
is triggered by the Control property-Changed event (eg.
TextChanged/ValueChanged). The value isn't persisted if the modified flag
hasn't been set.
[...]Try to set default values on the DataSource.
[...]If you're using NET2.0 you can use the DataTable.TableNewRow event.
"
|
|
|
|
|
thanks for sharing this.
Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.
|
|
|
|
|
you're welcome.
For completeness sake, I'm posting a snippet about it:
void defValues(DataTable dt)
{
foreach (DataColumn dc in dt.Columns)
{
switch (dc.DataType.ToString())
{
case "System.DateTime":
dc.DefaultValue = DEFAULT_DT;
break;
case "System.Boolean":
dc.DefaultValue = false;
break;
default:
break;
}
}
}
|
|
|
|
|
hi pleas help
I want to convert a string to an System.Windows.Forms.HtmlDocument object.
Is there a way to go about it?
Thank you very much.
WebClient myClient = new WebClient();
string webPageString = myClient.DownloadString(Url);
modified on Monday, March 14, 2011 7:20 AM
|
|
|
|
|
rather than WebClient, use WebRequest.GetResponse() or use a WebBrowser.Document
Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.
|
|
|
|
|
thank you
i dont use webbrowser because speed low
How to use WebRequest.GetResponse() Scale is explained
Please
|
|
|
|
|
you could google the methods/class names I provided.
you would then find things such as this[^].
Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.
|
|
|
|
|
Alternatively, he could just view the link I put in. It seems that he's too tired to move the mouse down the screen enough to open up the URL where I directed him to the answer.
|
|
|
|
|
It looks like we have a long week ahead of us...
Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.
|
|
|
|
|
Luc Pattyn wrote: It looks like we have a long week ahead of us...
Doesn't it just. You try to help them, but they just can't quite take that next step themselves.
|
|
|
|
|
well, someone managed to move the mouse all the way to the 1-vote. My mouse is heavier though.
Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.
|
|
|
|
|
Unfortunately I could not find
return WebRequest.GetResponse() as HtmlDocument
|
|
|
|
|
Use the Write[^] method of the HtmlDocument class taking care to follow the recommendations to use OpenNew first.
|
|
|
|
|
I have a project about the media player(wav file),which must show the play progress.
Now i can get the total play time(264s).
my method is using "timer".
The progressbar.value+1 per second.when the file play end,the progressbar's value=time.
Because of the timer control is imprecise,so the file play end and the progressbar is not come to the end .
so ,how can i get a precise prgressbar.
thank you very much!
|
|
|
|
|
Do it by percentage of time.
ie 264 seconds is 100%, so 1 second is 0.38%, so just increment by that value each second.
------------------------------------
I will never again mention that I was the poster of the One Millionth Lounge Post, nor that it was complete drivel. Dalek Dave
CCC Link[ ^]
Trolls[ ^]
|
|
|
|
|