|
http://www.codeproject.com/useritems/csadoread01.asp
http://www.codeproject.com/useritems/csadodbintro01.asp
Nish
Regards,
Nish
Native CPian.
Born and brought up on CP.
With the CP blood in him.
|
|
|
|
|
Nish
Are you sick?
You always used to have the links click-able!
Rickard Andersson@Suza Computing
ICQ#: 50302279 (Add me!)
E-mail: nikado@pc.nu
I'm from the winter country SWEDEN!
|
|
|
|
|
Rickard Andersson wrote:
You always used to have the links click-able!
I am getting old, Rickard!
Nish
Regards,
Nish
Native CPian.
Born and brought up on CP.
With the CP blood in him.
|
|
|
|
|
Here's an article on a data abstraction component that'll help you out with connecting to and using a database.
HTH
Cheers,
Simon
"Every good work of software starts by scratching a developer's personal itch.", Eric S. Raymond
|
|
|
|
|
Hey everyone, I've seen a couple .NET programs with an interesting effect. When the WinForm loads it fades-in instead of just apearing. I've tried a couple different ways to acheive this effect for instance: I set the Winforms defualt opacity to 10 then I set up a timer in which everytime it ticked the opacity would be increased until it reaches 100. My problem is however it doesnt fade in it just apears as 100% opaque. The longer I set the interval the longer it takes for it to apear full opac (thats a givien). Is there a different way of doing this or am I just not doing it right?
|
|
|
|
|
My screen saver does that, (speaking of which, thats about all it does ) The opacity value needs to increment from 0 to 1. Try changing the value you are going up to, set it initially to 0. I would suggest that you increment your opacity value by .1f , the f is used to denote a floating point value.
HTH
Nick Parker
Actually, real programmers don't need the enter key- they just type in 00001101."
|
|
|
|
|
Yah, thats actually where I saw it;P thank you.
|
|
|
|
|
Hi,
I have a DataGrid that displays 5 rows per page.
The first column is a checkbox, that should be checked for the messages that should be approved.
The problem is that, each time I change the current page, all checkboxes are unchecked. Is there any way of making them keep checked, so I could mark all the messages in different pages and approve them with just a click?
thanks in advance
dosgrave
|
|
|
|
|
Do I have to import SendMessage from user32.dll or is there any similar method in C#?
It shouldn't because the WM_ messages aren't defined... but I ask anyway!
And if I import the function.. is WPARAM and LPARAM the same (maybe not the same) UINTs in C#??
Rickard Andersson@Suza Computing
ICQ#: 50302279 (Add me!)
E-mail: nikado@pc.nu
I'm from the winter country SWEDEN!
|
|
|
|
|
Yes, you'll have to P/Invoke it. If you look at the Message struct you'll see that WParam and LParam are defined as IntPtr, considering the way that it is used you may want to follow suit.
James
Simplicity Rules!
|
|
|
|
|
Okay!
So then I would import the SendMessage API like this:
int SendMessage(IntPtr window, UINT message, IntPtr wParam, IntPtr lParam);
Rickard Andersson@Suza Computing
ICQ#: 50302279 (Add me!)
E-mail: nikado@pc.nu
I'm from the winter country SWEDEN!
|
|
|
|
|
What is wrong here:
[DllImport("user32.dll")]
public static int SendMessage(IntPtr window, UINT message, IntPtr wParam, IntPtr lParam);
I get "Expected class, delegate, enum, interface or struct" error on the return type of SendMessage API...
Rickard Andersson@Suza Computing
ICQ#: 50302279 (Add me!)
E-mail: nikado@pc.nu
I'm from the winter country SWEDEN!
|
|
|
|
|
public static extern ...
James
Simplicity Rules!
|
|
|
|
|
What does that extern mean?
I have know that before but have formated my brain after installed Windows in it and lost my knowledge...
Rickard Andersson@Suza Computing
ICQ#: 50302279 (Add me!)
E-mail: nikado@pc.nu
I'm from the winter country SWEDEN!
|
|
|
|
|
I am working on an ASP.NET app. In my global.asax I have a publicly exposed SqlConnection. Everything was working fine until I changed the connection string. Now all the places I used it say "An object reference is required for the nonstatic field, method, or property 'Pharmacy.Global.sqlConnection'". All I did was change the connection string. It is still public. Thanks.
Steve
Not all who wander are lost...
|
|
|
|
|
Steve Severance wrote:
"An object reference is required for the nonstatic field, method, or property 'Pharmacy.Global.sqlConnection'
This error leads me to believe that sqlConnection is not a static field of the global.asax, the quick fix is to make it a static field (public static SqlConnection sqlConnection )
HTH,
James
Simplicity Rules!
|
|
|
|
|
In MFC we have OnSetFocus(CWnd *pOldWnd)
Thus we know which window had previous focus.
In .NET we only have this :-
protected virtual void OnGotFocus(EventArgs e)
So, how do we find out which window just lost focus???
Regards
Nish
Regards,
Nish
Native CPian.
Born and brought up on CP.
With the CP blood in him.
|
|
|
|
|
You use the LostFocus event?
Actually according to the docs you should use Enter /Leave for Control s and Activate /Deactivate for Form s; GotFocus /LostFocus should only be used for updating UICues .
Whew, that was a lot of <code> and </code>'s
James
Simplicity Rules!
|
|
|
|
|
James T. Johnson wrote:
You use the LostFocus event?
BLAST!!!
That's not what I asked at all!!!!
If my control gets focus, I need to figure out which control was previously focussed. I seriously don't see how I can use LostFocus of my control to figure out which other control previously had focus!!!!!
James T. Johnson wrote:
Whew, that was a lot of <code> and </code>'s
Oh yeah????
Blast again!!!
Nish
Regards,
Nish
Native CPian.
Born and brought up on CP.
With the CP blood in him.
|
|
|
|
|
Control lastFocused = null;
private void ControlLeave(object sender, EventArgs e)
{
lastFocused = sender as Control;
}
private override OnLoad(EventArgs e)
{
EventHandler eh = new EventHandler(lastFocused);
foreach(Control c in Controls)
{
c.Leave += eh;
}
} Then in the handler for the GotFocus event you can use lastFocused to see what control last had focus.
You could also use the WndProc and look for the WM_SETFOCUS message and use Control.FromHandle to get the corresponding Control object (returns null if one doesn't exist).
James
Simplicity Rules!
|
|
|
|
|
James T. Johnson wrote:
Control lastFocused = null;private void ControlLeave(object sender, EventArgs e){ lastFocused = sender as Control;}private override OnLoad(EventArgs e){ EventHandler eh = new EventHandler(lastFocused); foreach(Control c in Controls) { c.Leave += eh; }}
Jambo
That's not what I want at all!!!!
I don't have control over the other controls, okay?
I am writing my own control.
My control wont know what other controls are there in the form.
Nish
Regards,
Nish
Native CPian.
Born and brought up on CP.
With the CP blood in him.
|
|
|
|
|
Nish - Native CPian wrote:
I am writing my own control.
Well you didn't say that! That changes it completely, leaving you with the WndProc solution.
James
Simplicity Rules!
|
|
|
|
|
James T. Johnson wrote:
Well you didn't say that! That changes it completely, leaving you with the WndProc solution.
Regards,
Nish
Native CPian.
Born and brought up on CP.
With the CP blood in him.
|
|
|
|
|
I cannot believe the guys called it 'OnGotFocus'...
Why didn't they simply go all the way and call it 'OnGottenFocus'.
cheers,
Chris Maunder
|
|
|
|
|
Chris Maunder wrote:
Why didn't they simply go all the way and call it 'OnGottenFocus'.
I am glad someone actually finds some humor in all this
Nish
p.s. Am stuck at this real bad, Chris
Regards,
Nish
Native CPian.
Born and brought up on CP.
With the CP blood in him.
|
|
|
|