|
liqnit wrote: am missing something here...
yes :P
liqnit wrote: I red the page but couldn't get an answer...
Seriously? Did you check out the members on the class? That link was to the main page for the class, the links at the bottom provide more information such as details on the Members of the class.
If you had "StandardOutput", "Start" and "GetProcesses" are pretty obvious.
GetProcesses will retrieve a list of all running processes from which you can get the one you want. Or you can use Start to run it if it's not already running.
Then StandardOutput gives you access to the output stream.
|
|
|
|
|
Thanks a lot
i guess i am not as good as i thought...
will definitely try this
thank you very much
Have a nice Day
|
|
|
|
|
No probs.
I'd highly recommend getting used to the MSDN as its very handy for checking out classes. If your using Visual Studio the intellisense can be invaluable as it can be used to see everything accessable on an object and provides comments.
|
|
|
|
|
Can i change the font of a string variable?
I am working on C#.net window application, In this header part appear on each page which we print.
Now its hard for an end reader(user) to distinguish between header part and content of page as font is same.
So, can i change the Font of header to Italic or anything?
I am storing the content of header part in string variable.
|
|
|
|
|
You need to provide a bit more information than this. How are you controlling the print page? Is this a report that you render out using GDI+?
In any case, the answer is yes - you can change the font. Assuming that you are drawing the text using GDI+, you need to supply a different font object to the text output.
public override void Paint(Graphics g)
{
Font myFont = new Font(base.Font, FontStyle.Bold);
StringFormat sf = new StringFormat();
sf.Trimming = StringTrimming.EllipsisCharacter;
Brush textBrush = new SolidBrush(Color.Black);
g.DrawString("Heading", myFont, textBrush, MyHeaderRectangle, sf)
}
|
|
|
|
|
hi all
i did this a while ago but lost everything on my comp and now cant remember how I did it. I remember it was fairly simple but I cant for the life of me remember what or how I did it.
Basically I want to get the colour of the pixel under my mouse pointer. I've loaded the image into the picturebox (picLayout) and have the mouseevent being handled I just can't remember how to get the colour of the pixel.
any pointers well appreciated
TIA
tim
|
|
|
|
|
Hello,
I think it is a good way to use the Bitmap.GetPixel function.
using(Bitmap bm = new Bitmap(pictureBox2.BackgroundImage))
{
actColor = bm.GetPixel(e.X,e.Y);
}
Hope it helps!
All the best,
Martin
|
|
|
|
|
hi martin
thanks for that but I'm getting an error (im probably being a bit thick here but.....)
i have this when the image loads:
this.picLayout.MouseDown += new MouseEventHandler(this.HandleMouseDown);
and then:
<br />
public void HandleMouseDown(object sender, MouseEventArgs e)<br />
{<br />
using(Bitmap bm = new Bitmap(picLayout.BackgroundImage))<br />
{<br />
label2.Text = bm.GetPixel(e.X,e.Y).ToString();<br />
}<br />
} <br />
and it just crashes it, any thoughts (apologies ofr my dimwittedness - brain just isn't functioning atm)
also i was thinking about having this as a mouseover event, if its creating bitmaps on every mousemove event wont it just explode ? I wish I could remember what I did before, it was fairly simple and something along the line imgName.R.ToString();
ta
|
|
|
|
|
going_mental wrote: but I'm getting an error
Standard Question No.?: What does the error say?
going_mental wrote: and it just crashes it
runtime or designtime?
All the best,
Martin
|
|
|
|
|
hmmm, told you my brain wasn't working....
i should have used picLayout.Image rather than picLayout.BackgroundImage.
it was throwing an unhandled exception (which confused me as tried to catch it but it was happening before it got to my try/catch) over the lack of background image in the picturebox.
thanks, all working now, but it would be nice to be able to do this as a mouseover event rather than just mousedown. I just tried it as mouseover event and the cpu load kinda went a bit mad. Any thoughts ?
when i did it before it was fairly simple and something along the line imgName.R.ToString();
tim
|
|
|
|
|
Glad I could help!
All the best,
Martin
|
|
|
|
|
hi martin
just to pick your brains a little further.....it would be nice to be able to do this as a mouseover event rather than just mousedown. I just tried it as mouseover event and the cpu load kinda went a bit mad.
when i did it before it was fairly simple and something along the lines of imgName.R.ToString(); or something like that. is that something you've heard of ? I can access the RGB values for the background but obviously thats not much use (as its just grey) but it wont let do the same for the Image.
Any thoughts ?
|
|
|
|
|
Hi,
why would you need a new Bitmap in your MouseDown handler ?
This is what I would try:
public void HandleMouseDown(object sender, MouseEventArgs e) {
Bitmap bm = picLayout.Image as Bitmap;
string s= bm==null ? "Not a bitmap" : bm.GetPixel(e.X,e.Y).ToString();
label2.Text = s;
}
And since this is a cheap operation now, you could try it in MouseHover handler also.
|
|
|
|
|
All the best,
Martin
|
|
|
|
|
excellent, that does the trick nicely.
thanks to you both
|
|
|
|
|
hello everyone,
i m new in this discussion board,
I develop an application which handles the Word files, i use the class Microsoft.Office.Interop.Word, this class has an object named application which contains the documents, the problem is when I turn my application in a specific machine, with closing the application, word.exe remains always in éxécution
, but in my machine all goes well,
to open a word document :
<br />
<br />
Microsoft.Office.Interop.Word.Document document;<br />
Microsoft.Office.Interop.Word.Document.ApplicationClass wd = null;<br />
wd = new Microsoft.Office.Interop.Word.ApplicationClass();<br />
document = wd.Documents.Add(ref missing, ref missing, ref missing, ref missing);<br />
<br />
to close the document and my application:
object dummy=null;<br />
object dummy2=(object)false;<br />
document.Close(ref dummy, ref dummy, ref dummy);<br />
wd.Quit(ref dummy2, ref dummy, ref dummy);<br />
Marshal.ReleaseComObject(wd);<br />
how can we be sure that the application(winword.exe) is closed?
Thanx
Morad SAJID
|
|
|
|
|
I think this could all be done easely over the System.Diagnostics.Process class
All the best,
Martin
|
|
|
|
|
I don't want to close the others ducuments open out of my application ,
Martin# wrote: System.Diagnostics.Process class
I want to close only that which opened the WORD documents in my application
Thanks
Morad
|
|
|
|
|
Remember that as soon as you open one of the programs of MS Office,
it starts a background process called WinWord.EXE. This is to help
decrease the load time for the Office framework. You can kill it without
harm. Unless you are actual doing something with Office.
God Bless,
Jason
Paul Conrad wrote:
Chuck Norris keeps the hamsters going whenever Chris is gone on vacation. Just stares them down and they keep the servers going
|
|
|
|
|
the difficulty is to kill the only process that i used for my application,
how to identify the WinWord.exe process that i uses ?
Thanks
Morad
|
|
|
|
|
I have this warning :
warning CS0467: Ambiguity between method 'Microsoft.Office.Interop.Word._Document.Close(ref object, ref object, ref object)' and non-method 'Microsoft.Office.Interop.Word.DocumentEvents2_Event.Close'. Using method group.
how can i eliminat it ?
Thanks
Morad
|
|
|
|
|
trough my application I want to create a new user and i want to create a new sqllogin for him in the database. To do this what i'm expecting is to create a new user login in the sql server with out login to the sql server, just using the codes of the application.So is this possible to do (I know it might be very advance).
|
|
|
|
|
From your code you will still have to log in as a user with admin rights in order to create a new login and user. The login information will go in the connection string (or it can be set to a trusted connection, in which case the user running the application will need the rights to create logins in the database)
You can run pretty much any SQL code through the SqlCommand object, so the commands will be the same.
Upcoming events:
* Glasgow: Mock Objects, SQL Server CLR Integration, Reporting Services, db4o, Dependency Injection with Spring ...
"I wouldn't say boo to a goose. I'm not a coward, I just realise that it would be largely pointless."
My website
|
|
|
|
|
OK - I give up. I really don't see why this would be voted 1. It answers the question without handholding this guy through a set of commands he probably wouldn't understand.
|
|
|
|
|
I just reported is in the suggestions.
There are really "small" people around here!
What makes it even poorer is that it has to be a gold member of the community!
All the best,
Martin
|
|
|
|