|
You could either write your own paint routine, or you can do the equivelant of a print screen by copying bits of the screen to a bitmap through API.
This is some VB code that I used in one of my other applications:
Public Function WindowCapture(ByVal form As Form) As Bitmap<br />
' Get this form's Graphics object.<br />
Dim me_gr As Graphics = form.CreateGraphics<br />
<br />
' Make a Bitmap to hold the image.<br />
Dim bm As New Bitmap(form.Width, form.Height, me_gr)<br />
Dim bm_gr As Graphics = me_gr.FromImage(bm)<br />
Dim bm_hdc As IntPtr = bm_gr.GetHdc<br />
<br />
' Get the form's hDC. We must do this after <br />
' creating the new Bitmap, which uses me_gr.<br />
Dim me_hdc As IntPtr = win32api.GetWindowDC(form.Handle)<br />
<br />
' BitBlt the form's image onto the Bitmap.<br />
win32api.BitBlt(bm_hdc, 0, 0, form.Width, form.Height, _<br />
me_hdc, 0, 0, win32api.SRCCOPY)<br />
bm_gr.ReleaseHdc(bm_hdc)<br />
<br />
' Return the result.<br />
Return bm<br />
End Function<br />
All calls to the win32api class are API calls or constants that can be found in the program APIViewer
Regards,
1tg46
Check out 3D Game Development with Dark Basic Professional [^]programming.
|
|
|
|
|
Hello,
I started an appl. for a touchscreen, where I designed a alphanumeric input pad.
When I now Click the Button for "a" I have to use the string.Insert Method to get the "a" in my text.
It would be much faster, if its possible to force this Event directly in the TextBox.
Thanks for your time,
Martin
|
|
|
|
|
It is impossible to fire an event on an object from code outside of that object. You might want to try calling the SendKeys.Send method.
Josh
|
|
|
|
|
First, thanks very much for your answer.
After the Buttonclick, I just had to set the .Focus() on my TextBox and then the .Send Method.
This works fine.
But is it also possible to simulate a cursor movement by using a Method like this?
Thanks again for youre time
Martin
|
|
|
|
|
You can use the Cursor.Position property to set the location of the mouse cursor.
Josh
|
|
|
|
|
Sorry,
What I meant was the "Cursor"-Key Up,Down,Left and Right.
This should influence the SelectionStart Property of my TextBox.
Thanks for your help,
Martin
|
|
|
|
|
What you are referring to is called the "caret" - the "cursor" is what the mouse moves. Outside of setting the SelectionStart property, I am not aware of any managed API which moves the caret. If SelectionStart does not do what you need, there might be some Win32 function that you can PInvoke. Check out www.pinvoke.net[^] for info about that.
Josh
-- modified at 7:58 Friday 9th June, 2006
Perhaps you can call SendKeys.Send and pass in a symbol representing one of the Arrow keys. That might move the caret, too.
|
|
|
|
|
Thanks a lot.
It was so simple just for example: SendKeys.Send("{UP}");
I think I have to parse my code now for cleaning all this dirty workarounds I made the last week.
Here I found a good list for the Symbols.
http://www.codeproject.com/cpp/sendkeys_cpp_Article.asp[^]
So again,
thanks a lot for your help and time,
Martin
|
|
|
|
|
hi
how can i auto install .net framework 2.0 and windows installer 3.0 if target system have not installed .net framework and windows installer 3.0
more :
i have a project that writed on c#.net 2005 !!!
please help me
|
|
|
|
|
Use NSIS [^]which will run on any system and you can use it as a bootstrapper for the actual installation.
Of course I'd say use NSIS from the start since you have complete control and it doesn't require anything special to run.
That's one way around it, I'm sure there are others.
You know you're a Land Rover owner when the best route from point A to point B is through the mud.
Ed
|
|
|
|
|
i add a custom action in my setup project for SQL MSDE but i don't know
the condition i write in the condition property.
the condition check if MSDE already exists don't setupo it else do
|
|
|
|
|
Hi there,
I'm looking for a .NET based sample application which is using the SkyWave
API functionality to get the tracking data (position data) from the SkyWave server.
Is there anybody here to know such this sample application?
I've asked it from SkayWave support center (support.skywave.com) but their supports are not too good.
Thank you in advance.
|
|
|
|
|
how con i check for the internet connection status changes?
every time the pc goes online/offline i want to make an action...
any ideas?
Thanks
VentoEngine corp.
Program your life ^^
|
|
|
|
|
See NetworkChange.NetworkAvailabilityChanged .
/ravi
My new year's resolution: 2048 x 1536
Home | Music | Articles | Freeware | Trips
ravib(at)ravib(dot)com
|
|
|
|
|
does it work if i have an usb modem? or a router?
VentoEngine corp.
Program your life ^^
|
|
|
|
|
|
Hello,
I am writing a windows form app using c#.
I would like to create a new data row in a regular c# class using the following code.
public void addWell()
{
DataRow row = new DataRow();
}
But I keep getting this error: "'System.Data.DataRow.DataRow(System.Data.DataRowBuilder)' is inaccessible due to its protection level"
Does anybody know how to change the protection level of the DataRow?
thanks!
rc
|
|
|
|
|
You can't instatiate a new DataRow object like that, it's constructor is protected and you can't do anything about that. If you want a new DataRow you must use your DataTable.NewRow() method which will return a new row that has been initalized with your tables schema (i.e. all the columns have been added).
|
|
|
|
|
that worked. thank you!!!
|
|
|
|
|
i am using it in the webpage is that ok
can you please suggest me as soon as possible
|
|
|
|
|
The solution of this problem is to use :
DataTable dt = new DataTable();
DataRow dr = dt.NewRow();
|
|
|
|
|
|
Hi all,
I am developping a program which capture a webcam view (like project CaptureNet included in the DShowNet Pack), and when you record your webcam preview the file created is not compressed. I have seen on this website another project which purposed to compress the rendered file. But i would like to use my codec. Actually, my codec take in parameter the avi filename non compress and compress it to another file.
I don't have any idea to use my codec when I record webcam preview.
If someone can explain how to do this ...
Thank you.
PS : sorry for my poor english =[
|
|
|
|
|
Hi,
I have two exactly identical classes. i would like to cast an object of one class to another. Normal casting did not work . Do somebody have some thoughts ?
James
|
|
|
|
|
(1) Have them share a common Interface than use the Interface.
(2) Create a copy constructor on one or both of the objects.
|
|
|
|