|
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
|
|
|
|
|
|
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("ClassLibrary1")]
[assembly: AssemblyDescription("caliculates the balance and amount")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("cnn technologies")]
[assembly: AssemblyProduct("ClassLibrary1")]
[assembly: AssemblyCopyright("Copyright © 2007")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("us-en")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("f5d5a4ac-9064-4829-a781-f90668feba4b")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
there is no assembly key file in this assembly
hi
|
|
|
|
|
Right click on the Project, select Properties, go to the Signing tab.
|
|
|
|
|
Hello,
Is there a way to find out if there is an opened data reader associated with a given connection. I searched through all properties of the SqlCommand and it's associated SqlConnection, but I could't find anything is there a way to find out?
Thank you!
drinking beer is fun
|
|
|
|
|
you can check it in sql server query analyser by using this query
SELECT * FROM master.dbo.sysprocesses<br />
WHERE DB_NAME(dbid) = 'DATABASE NAME'
Regards,
Sylvester G
If we don't succeed, we run the risk of failure
|
|
|
|
|
Hi
I assume you want to do this to prevent the error about Multiple Active Result Sets on one connection by checking if the connection already has an open DataReader, and if it does, closing it.
If this is the case set MultipleActiveResultSets = true in your connection string to allow you to have more than one open DataReader on a connection.
If it isn't please describe in more detail what you are trying to do.
There are 10 types of people in the world, those who understand binary and those who dont.
|
|
|
|
|
Indeed that was the reason i was asking for help
Thank you, regards!
drinking beer is fun
|
|
|
|
|
On changing the index of the combo box giving the following exception
Invalid operation Exception:
List that this enumerator is bound to has been modified. An enumerator can only be used if the list does not change.
why this exception is coming pls help me!
|
|
|
|
|
Somewhere in that code your enumerating through a collection. Whilst you are doing this you cannot change the enumeration in any way. If you do you'll get that error.
|
|
|
|
|
Hi everybody!!!
How I can use ErrorProvider in DataGrid??? (It is for notice when the input data in some field is failur. In this case you mast see blinking of ErrorProvider in some field)
|
|
|
|
|
Hello,
I need to be urgent.
I need a Solution for the Following Proble.
I need to Export Data in Excel but record size is mre then 65536
which is more than the predefined size of the excel.so i need to
add remaining record in sheet2 when record size is greater than 65526.
Thanks in Advance.
Regards,
Rahul
|
|
|
|