|
Because your problem is not very clear to me, I assume that your datagrid's data source is from a dataset.
You can try set an event handler for one of these dataset events.
1. RowChanged
2. RowChanging
3. ColumnChanged
4. ColumnChanging
For the changing event, it occurs when data is changing. You can cancel or accept the changes in this event.
For the changed event, it occurs when data has been changed successfully.
|
|
|
|
|
I mean with change the row not to change the value in the special cell. I mean that the cursor is after pressing the return key in the row below the row before.
Example:
Rows:
0
1*cursor* -> then pressing return --> event should fire
2
-->
0
1
2*cursor* (one position higher in the row collection)
I hope my English was understandable.
|
|
|
|
|
Hello,
I'm looking for a C# parser that can give me access to a C# program's code inside a running C# program. The parser should not just build an abstract syntax tree but also give a types hierarchy of the types created and used in the program and some further refinements. For example, it would be important to know the type of an object if an object's method is called. (the highest type in an inheritance hierarchy would be enough, of course).
Does anyone know about a library providing this? I only found some pure parsers that give me an AST. But with the tree alone there's much more work to do to get the required information out of the program.
Thanks
Stefan
|
|
|
|
|
|
I think reflection is not capable of getting information about the inside of a method. I need t know which classes' methods are called by a method. I want to create a call/use graph from a software (can be from source code).
|
|
|
|
|
|
Ok, I'm missing something fundamental here - I know it. Would one of you gurus be so kind as to point out my error, please.
I have a class Called ProcessInfo in the namespace Mycompany.Project that is used to store custom process information...
namespace MyCompany.Project
{
public class ProcessInfo
{
private string m_sStatus;
.
.
.
}
}
This class is used in two projects. Project A is a dll that uses the same (MyCompany.Project) namespace. Project B is an exe also uses the same namespace.
Project B dynamically loads and invokes the Project A dll. Project B passes an instance of an ArrayList to Project A, who adds instances of the ProcessInfo class to the ArrayList. Project B attempts to loop through the ArrayList to access the ProcessInfo instances as follows:
private void SomeFunction()
{
foreach (ProcessInfo oInfo in oArrayList)
{
.
.
.
}
}
I always get invalid cast exceptions on the foreach line. The debugger correctly show the oArrayList as containing instances of type {MyCompany.Project.ProcessInfo} and the contents of the individual ArrayList entries can be read (in the debugger).
What am I missing? I've tried various permutations of the above code - including fully qualifying the namespace, using IEnumerator, etc...
I have searched MSDN, but have had little luck specifying the correct query to find answers.
I would very much appreciate any help in solving this. I thank you in advance.
Peff
|
|
|
|
|
I want to retrieve the VID and PID of usb device,such as mp3 and u-disk.I know how to enum the device infomation by using some of windows API step by step.I just do not know how to define the GUID structure,how to pass the GUID as a parameter to the api,such as SetupDiGetClassDevs(),and especially how to marshal the type of those parameters.
Can you give me an detail example in C#?
|
|
|
|
|
Hi guys
Is there any way that I can set the small/large imagelists for a ListView control to the handle of the system's standard image list?
I know I can use SHGetFileInfo() function for retreiving the system image list, but how do I set it to ListView.SmallImageList? (ie. ListView.SmallImageList.Handle is READ-ONLY)
Any pointers would be appreciated
Thanks
|
|
|
|
|
Hi,
I'm trying to implement cd burning capabilities in my application with the open source console application cdrdao[^].
I'd like to run this application in the background (hidden from the user), but return all the status information "on the fly" to the user. That is, before cdrdao has terminated burning the cd.
How can I monitor what this console application is writing to the console? Also, would it be possible to simulate keystrokes in the console application, but from my code? For example, if the user clicks the Cancel button, I'd like to send a CTRL-BREAK to the console app.
Thanks!
Carl
|
|
|
|
|
Carl,
You might want to look at the System.Diagnostics.ProcessStartInfo class. The ProcessStartInfo class allows the redirecting of the standard output so that the calling application can read it. For example:
{
.
.
.
Process oProcess = new Process();
string sData;
oProcess.StartInfo.FileName = "cdrao.exe";
oProcess.StartInfo.Arguments = "-whatever";
oProcess.StartInfo.RedirectStandardOutput = true;
oProcess.StartInfo.CreateNoWindow = true;
oProcess.StartInfo.UseShellExecute = false;
oProcess.Start();
while (some condition)
{
sData = oProcess.StandardOutput.ReadToEnd();
.
.
}
I'm not sure about sending keystrokes. I know the SendKeys class will send keystrokes, but I believe it only sends them to the current app.
Hope this helps.
|
|
|
|
|
That will only work when the console app exits right? If that's the case, that's not what I want since I need to return feedback to the user while the cd is burning (especially since this can be a long process!)
Thanks!
Carl
|
|
|
|
|
Hi,
Here's some code I tried. However, the output isn't redirected to my app. If I make it open a standard console window, I can see the output on the screen (in the console window).
Process oProcess = new Process();<br />
oProcess.StartInfo.FileName = @"C:\Program Files\cdrdao\cdrdao.exe";<br />
oProcess.StartInfo.Arguments = "scanbus";<br />
oProcess.StartInfo.RedirectStandardOutput = true;<br />
oProcess.StartInfo.CreateNoWindow = true;<br />
oProcess.StartInfo.UseShellExecute = false;<br />
oProcess.Start();<br />
<br />
while (!oProcess.HasExited)<br />
{<br />
if (oProcess.StandardOutput.Peek() == -1)<br />
{<br />
System.Threading.Thread.Sleep(50);<br />
}<br />
else<br />
{<br />
char[] myOutput = new char[32];<br />
int nRead = oProcess.StandardOutput.Read(myOutput, 0, 32);<br />
if (nRead > 0)<br />
{<br />
textBox1.Text += myOutput;<br />
}<br />
}<br />
}
Any idea? I'm also interrested in knowing how to send key strokes to the console, for whoever reads this
Thanks!
|
|
|
|
|
I'm having massive difficulty trying to print weekly reports in the following way:
I have a report generated for a month, May for aregument sake. I want the data in the report broken up into 4/5 weeks, not simply flowing though the month. In other words:
Week 1:
data
data
data
Week 2:
data
data
data
Week 3:
data
data
data
Week 4:
data
data
data
Each set of data has a full DateTime variable with it. I've managed to get a week number from each date - but they're in relation to the year, not the month.
Any ideas?
|
|
|
|
|
I think you can just substract the week number u got,
with the last month week number.
This is a simple example (mm/dd/yy is the date format):
select convert(numeric(3,0), datename(ww, '02/24/2004')) - convert(numeric(3,0), datename(ww, '01/31/2004'))
The query will give u the week number relate to the month for 24th Feb 2004.
Hope this can help u,
|
|
|
|
|
Hi,
Can I actually disable alt-tab key combination, and windows key.
So the computer always stay focus on the application.
If it's possible, does anyone know how to do it?
Thank you very much in advance.
Anton
|
|
|
|
|
I don't know of a pragmatic solution, but you could try installing I Hate This Key[^] which lets you disable keys
--
Help me! I'm turning into a grapefruit!
Phoenix Paint - back from DPaint's ashes!
|
|
|
|
|
Thank you very much for the suggestion, but I need to disable alt-tab or windows key programmatically.
|
|
|
|
|
Thank you very much for the suggestion, but I need to disable alt-tab or windows key programmatically.
|
|
|
|
|
Hello I am working on a gamma adjustment program in c# and I have imported the gdi32.dll file as follows,
[DllImport("gdi32.dll")]
and have then declared getDeviceGammaRamp with
private static extern bool getDeviceGammaRamp(HDC hDC, LPVOID lpRamp);
But I get errors such as HDC could not be found etc. I have tried reading up on threads such as creating screenshots for some help as they are similar in nature to my program. I can't seem to get things going.
Could somebody please explain to me how import getDeviceGammaRamp and setDeviceGammaRamp correctly in c# to adjust gamma or possibly write a small tute just like the create screenshot bitmaps one except on how to adjust monitor gamma?
Thanks for your time people
|
|
|
|
|
You need to "translate" the Win32 data types, HDC & LPVOID, into CLR data types. You can use the System.IntPtr type in both cases.
private static extern bool GetDeviceGammaRamp(IntPtr hDC, IntPtr lpRamp)
Hope this helps!
Paul Lyons, CCPL Certified Code Project Lurker
|
|
|
|
|
Hi!Paul,
Thank you very much! It do me a big favour^_^
Thank you again!!!
Best regards!
momer
|
|
|
|
|
Yes thank you for the help Paul, now I just need to convert some c++ classes to c#. It is harder than I expected.
If somebody could write up a tutorial on gdi32 and setting gamma in c# then this would help me out alot, it seems that there is almost nothing on the subect at all.
I have been searching for days
|
|
|
|
|
I wanna this happen:Within a TabControl,when I click the "OK" button on the
tabpage "OPTIONS",it automatically turn into the
tabpage "SETTINGREPORT". In other words,when I click the "OK" button on one tabpage it automatically turn into another tabpage in the same TabControl.
What code should I write with C#?
|
|
|
|
|
momer wrote:
What code should I write with C#?
If you know the index value of the tab page, you can simple use the SelectedIndex property of the TabControl . If your clicking a button, your code might look something like this:
private void button_Click(object sender, System.EventArgs e)
{
this.tabControl1.SelectedIndex = 3;
}
- Nick Parker My Blog | My Articles
|
|
|
|