|
See the documentation for the Process[^] class in the .NET Framework SDK.
As a simple example:
Process p = Process.Start("calc.exe");
Thread.Sleep(1000);
p.Kill();
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Hi Heath,
Thanks for the reply. Is it possible to make the window of the application invisible. For example if I am starting some "x.exe" using Process.Start(), can I make that x.exe's window invisible, so that user won't know that some exe has been started in the back ground. If you have any idea please let me now.
Thanks and Regards,
Satya Prasad
|
|
|
|
|
Prcess class has a StartInfo property, look into it and you will find it.
Mazy
"A bank is a place that will lend you money if you can prove that you don't need it." - Bob Hope
|
|
|
|
|
Thanks Got it.
Regards,
Satya Prasad
|
|
|
|
|
i dont know how to start
if you have any usufull information about avi to mpeg compression please send it to me
1-how can i read a film and convert it in frame and then store it in amatrix !!!!!
please help me
|
|
|
|
|
first of all how do i display a .tif file on a form
second i need to know how to filp,rotate,zoom in ,zoom out
useing the .tiff image so if come body could give me example code to do this that would be great
chad
|
|
|
|
|
Put a System.Windows.Forms.PictureBox on a form, then set the .Image property to the image file on disk. You can create a System.Drawing.Image using System.Drawing.Image.FromFile. For zooming and flipping, you need to do it yourself most likely. Grab some of the pixels using Bitmap.GetPixel then draw it in a larger fashion (say, 4 pixels for every 1 you read in).
---------------------------
He who knows that enough is enough will always have enough.
-Lao Tsu
|
|
|
|
|
Or better yet, use the Graphics class and call any one of the many transformation methods, like ScaleTransform , RotateTransform , et. al. You can find more information about these in the .NET Framework SDK.
In this case, you can either create a new image from the existing one (see Image.Clone ) and use Graphics.FromImage to get a new Graphics object for it and then assign that to PictureBox.Image , or paint the image yourself in your Form 's OnPaint override. Read the .NET Framework SDK for more information.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
is there a way if the picture is too big for the picturebox for the picturebox to scroll throw the picture because it dose not have a scroll on it now
chad
|
|
|
|
|
Not the picture box itself, no, but there are workarounds. Set PictureBox.SizeMode to PictureBoxSizeMode.StretchImage if you want the image resized. If you don't, put the PictureBox in a Panel and set PictureBox.Bounds to the containing Panel.Bounds (do not dock). Also set the Panel.AutoScroll to true . Then, set PictureBox.SizeMode to PictureBoxSizeMode.AutoSize . This will resize the PictureBox to the size of the image. Since the control is docked inside a Panel with auto-scrolling enabled, the panel will provide scrolling.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Hi,
I have a textbox I am using to allow editing of cells in a custom ListView-type control. However, when I call the Focus() function of the textbox, it gets the focus for a fraction of a second, and then goes back to the ListView.
How can I keep the focus on the textbox to allow the user easy cell manipulation?
Thanks!
Yaron
|
|
|
|
|
Sorry, ignore that question. I just got it =)
Thanks
|
|
|
|
|
You might want to click on the delete button of your post if you've solved it.
---------------------------
He who knows that enough is enough will always have enough.
-Lao Tsu
|
|
|
|
|
Hi, I am trying to subscribe to the KeyDown event on a datagrid so that I can write a function depending on what key the user has pressed, eg, update the dataset and focus on another control when the user presses the + key. I have subscribe to the event and created a event handler. But the event will only be raised if the user is NOT focused on any cell in the datagrid. How can I raise a KeyDown event while the user is focus on a cell within the datagrid?
Can anyone help?
|
|
|
|
|
The DataGrid comprises many child controls, all of which handle keyboard events and will almost always return that the event was handled so that it isnt' bubbled up to the parent (the DataGrid ). The work around would be to pretty much extend each class related to the DataGrid and bubble the events yourself.
If the DataGrid is hosted in a Form , however, there is another way. Set Form.KeyPreview to true and handle the KeyDown , KeyPress , or Keyup events, setting KeyEventArgs.Handled to true or false depending on whether or not you handle the key and don't want the child controls to handle it. This gives your form a chance to handle the keys before the control with the focus.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Thanks Heath, I'm new to OOP and C#, could you let me know what are some of the many child controls contained in the datagrid? Thanks again, Jared
|
|
|
|
|
Read the .NET Framework SDK for the DataGrid . You can also use tools like ildasm.exe - the IL Disassembler - that comes with the .NET Framework SDK to read the Intermediate Language and see what's used. Don't know what IL is? Read about it. Since you're new to C# (and obviously .NET, since C# is one of many languages that use the .NET Framework class libraries (FCL) and target the Common Language Runtime (CLR)), be sure to read. IL (Microsoft IL, or MSIL, to be exact) is what is produced when you compile ANY managed language (at least in pure mode, since Managed C++ can use native instructions under mixed mode compilation) so the original source language of an assembly does not matter.
You can also use tools like .NET Reflector[^] to reflect, disassemble, and even decompile (though it's not 100% accurate in some cases) the assemblies (like System.Windows.Forms.dll) to see how things work. You'll discover there's a lot of controls in use by the DataGrid . Even looking at it would tell you that a TextBox - which can receive the focus - is used. The CheckBox control, however, is not used for a DataGridBoolColumn - the checkbox and its states are drawn by the ControlPaint class.
I'm not trying to be an ass, but being a newbie you really need to read. You won't find much about the internal workings of the .NET Framework documented, but that's where self-exploration comes in and will teach you more than the documents ever can (although reading them is important because just guessing at what to use and relying on IntelliSense is a bad way to develop anything).
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Thanks Heath, You have pointed me in the right direction. Now I've got to do some research. There is so much to learn, but its all good stuff. Jared.
|
|
|
|
|
I've got to the point where i'm handling unalocation of COM objects, but i'm curious, i've seen examples using both IMalloc wrapped objects and Marshal.Release / ReleaseComObject to handle disposal.
Which one is best protocal? Is IMalloc really nesscesary?
I get the impression that the Marshaler is actualy an IMAlloc wrapper, in which case, i don't actualy need to build and worry about an IMalloc object for things like Freeing and assigning memory to pointers.
Cata
|
|
|
|
|
"unalocation"....that seems wrong to me grammatically, somehow
Anyways, I've always taken the approach of using the "ReleaseComObject" method, and I've never noticed any substantial memory leakage. I'm fairly certain you shouldn't need the IMalloc style unless you're using a custom marshalling approach.
I may be right, may be wrong, who knows
Jeremy Kimball
|
|
|
|
|
Jeremy Kimball wrote:
"unalocation"....that seems wrong to me grammatically, somehow
That theres won of them werds we amerIcans like to yous. yall know what im talkin bout. <lived in the south for 5 years>
---------------------------
He who knows that enough is enough will always have enough.
-Lao Tsu
|
|
|
|
|
Heh...spent a good deal of my childhood a bit south of Macon Georgia
|
|
|
|
|
Wow ok I lived in Kennesaw Georgia for 2 years. Down town was a place called "Wild Man Dent Myers" where you could go in and buy a KKK outfit plus all the stars and bars your heart could desire. Outside the shop was a sign, "Olypukes go home" (as the 1998 Summer Olypics were being held in Atlanta).
Scary stuff. Never did get to see Wild Man Dent Myer in person though. Maybe that's a good thing heheh.
---------------------------
He who knows that enough is enough will always have enough.
-Lao Tsu
|
|
|
|
|
My bad. Unallocation.... perhaps not the best word to use.
Anyhoo... glad that i'm on the right (gramaticaly retarded) track!
I'm from england, and i'm also a writer... so i am feeling somewhat foolish. I blame the alcohol!
Cata
|
|
|
|
|
Deallocate is the the correct term methinks. However, dictionary.com doesn't know what deallocate is . Well, in the unmanaged realm of programming, we'd always use "deallocate". MSDN has several articles on "deallocating memory" from unmanaged code, too.
---------------------------
He who knows that enough is enough will always have enough.
-Lao Tsu
|
|
|
|