|
If, as you admit, you haven't tried to find the answer out for yourself, I'm not sure why you should expect others to give up their time to solve the problem for you.
Paul
|
|
|
|
|
akkram wrote: I would if i could, but at the moment im at work and have no way of testing it.
Use Snippet Compiler[^]
|
|
|
|
|
|
Oh, Mac, there's your problem.
|
|
|
|
|
Nice. This is a new one for me.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
You can't really blame this guy for not wanting to try anything out for himself, it's an extremely easy route to try in life.
I blame it on the parents.
|
|
|
|
|
althamda wrote: I blame it on the parents.
You think they should have exercised some self-restraint?
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
One of the greatest things about "software engineering" is that you can try out all sorts of strange things and no matter how bad the result is, you're unlikely to do any real damage to anything.
Never be afraid to just try; we learn more from our mistakes than from getting it right the first time.
|
|
|
|
|
hello
i have a form in c#.net windows application.
in this form a dataset and a table adapter is used.so is a grid.
this form shows a grid that contains the records that are retrieved from a table in my database
how can I change the color of a row in a grid ???????
plz help me
|
|
|
|
|
Try the following code
dgView.Rows[1].DefaultCellStyle.BackColor = Color.Yellow;<br />
dgView.Rows[1].DefaultCellStyle.ForeColor = Color.Black;
Regards,
|
|
|
|
|
|
|
Now if I can only figure out why, and see if there is a method of controlling it.
I bet it has something to do with the byte[] array, since there is always 4 numbers. Either that or its the buffer that comes from said length. If its possible to record either one, and then store that instead in memory then I think I might have a workeable solution.
|
|
|
|
|
Jeremy - please don't start new threads off that detail solutions to recent threads. You've posted multiple times today, so it would seem reasonable that you continue these ideas on the old threads. You may know what this all relates to, but the casual browser doesn't.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Hi, if anyone could point me in the right direction on how to obtain the actual text from within an editor control of an external application. I'm currently looping through the classes until i find the VSTextEditPane handle, but what now.. How do I read the text. Is there some kind of text buffer one uses and how do i accomplish this? The objective is to read queries from within SQL management studio. Your expertise and suggestions would be appreciated.
Thank you Guru SIR
Izak
|
|
|
|
|
Hi,
you will need a couple of P/Invoke operations to call some Win32 functions.
First you need to somehow find the right Window, maybe based on its title;
then ask for the text it contains (give the StringBuilder sufficient initial capacity!).
The following may help you:
[DllImport("user32.dll", CallingConvention=CallingConvention.StdCall)]
public static extern int EnumWindows(LP_EnumWindowsProc ewp, object lParam);
public delegate bool LP_EnumWindowsProc(IntPtr hWnd, int lParam);
[DllImport("user32.dll", CallingConvention=CallingConvention.StdCall)]
public static extern int EnumChildWindows(IntPtr hParent,LP_EnumWindowsProc ewp, int lParam);
[DllImport("user32.dll", CallingConvention=CallingConvention.StdCall)]
public static extern void GetWindowText(IntPtr hWnd, StringBuilder sb, int capacity);
[DllImport("kernel32.dll", CallingConvention=CallingConvention.StdCall)]
public static extern int GetLastError();
Good luck!
Luc Pattyn [Forum Guidelines] [My Articles]
this weeks tips:
- make Visual display line numbers: Tools/Options/TextEditor/...
- show exceptions with ToString() to see all information
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
Thx buddy,
I've done all of that already.. The problem lies within me not knowing how to obtain the text or the actual queries that resides withink SQL mng Studio.. I've obtained the handle of the app, then enum through the lot until I struct the VsTextEditPane that is used by Mgnmt studio.. Now what??
There must be some kind of way to use p-invoke to then extract either all text via a sendmessage or the line at which the carret is focussed?? dunno.. A low-level keyboard hook is not my ideal as i'm interrested in the text.. at any point i want to read queries..
Thanks mate
|
|
|
|
|
Hi,
I don't know about database stuff; getting text from a window is what GetWindowText does.
Hope that helps.
Luc Pattyn [Forum Guidelines] [My Articles]
this weeks tips:
- make Visual display line numbers: Tools/Options/TextEditor/...
- show exceptions with ToString() to see all information
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
I am trying to create a win app that will get UK lottery results from the web and store them in the application. Via regular checking the application will than always be up to date with the results.
What would be the best approach to achieving this?
My first thoughts were to access a rss feed, but ive had no success.
Any ideas welcome.
|
|
|
|
|
You could always read the page and parse it. There is an SGML parser on Code Project I used a while back.
The problem with this approach is that the web page is designed to be human readable so the structure of the HTML may change at the whim of some marketing department somewhere.
|
|
|
|
|
hi.
every time i build the solution, a command prompt window appears (black window). How do i go about not making the window appear. I only want the form to show not the black window too ???
"Many of life's failures are people who did not realize how close they were to success when they gave up." Thomas A. Edison
|
|
|
|
|
Oh sorry... i found it
when i added a project i said empty project and not window application. Thank you anyway
"Many of life's failures are people who did not realize how close they were to success when they gave up." Thomas A. Edison
|
|
|
|
|
Hi, is there a problem when i use an object instance like this ?
( new AnyClass() ).SomeMethode(); instead of
AnyClass ac = new AnyClass();
ac.SomeMethode();
The compile dont have a problem with it but i asking me whether it is good or bad
|
|
|
|
|
Hello,
No problem, but:
I wouldn't want to see code like this in one of my projects.
If it makes sence to do this:
MarkPhB wrote: ( new AnyClass() ).SomeMethode();
,there is not need to use a class at all, I guess.
You could simply use a static method.
All the best,
Martin
|
|
|
|
|
Thanks for the answer =)
i use this sometimes when i have a class with have a methode that i need only one time. Like
( new Form1() ).ShowDialog() or
( new RNGCryptoServiceProvider() ).GetBytes( randomBytes );
|
|
|
|