|
Oh well. In that case, you are in for a world of hurt lol . The common controls interact with the *real* internal window scrollbar, not your external scrollbar control, so you need to customize the internal one. The internal window scrollbar is not a control, but rather painted as part of the WM_NCPAINT process, so you'll need to override that and do all your own painting for the ENTIRE non client area.
BE WARNED: There is a major gotcha that people don't know about until they try to implement this. I only know about it because I've done it in the past ...
You [B]***CANNOT***[/B] achieve custom scrollbars without API hooking. No way, no how, no workaround that. Reason being is that Windows implements the scrollbars like this:
case WM_NCPAINT:
{
// random code to do random stuff
DrawScrollBars();
// more random code to do random stuff
break;
}
Now, thats all well and good, you could override the WM_NCPAINT message and prevent the stock DrawScrollBars() function from getting called.
However, the internal scrollbar functions that the common controls use do not go through WM_NCPAINT , they call DrawScrollBars() directly and there is no way to bypass that without API hooking .
So what you'll get is you'll get your pretty new scrollbars 75% of the time and the stock scroll bars flashing through 25% of the time.
Like I said, switch to WPF (or find an API hooking library).
|
|
|
|
|
My c# console app calls a managed c++ dll. The dll is added as a reference to the c# project. If I try to start in debug mode it says error while trying to run project. unable to start program, unrecognized error in windows web service framework. It is not a web application. If I run without debugging, the console pops up and my dll produces an error that the hdf5 header files don't match the hdf5 library my c++ dll is linked to (though it compiles and builds just fine). Both c# driver and c++ dll are 64 bit on a 64 bit machine. Both the F5 and ctrl F5 errors are puzzling. Any ideas what i should do to fix?
thanks,
saroj
|
|
|
|
|
Hi,
I am using the following code to activate existing MDI child and refresh the grid at the same time. It was working fine until today but suddenly I am getting:\
System.NullReferenceException occurred
Message=Object reference not set to an instance of an object.
Source=Cure
StackTrace:
at cure_hospital_management.frmMain.repositoryItemFindFile_KeyDown(Object sender, KeyEventArgs e) in C:\Users\DELL USER\Documents\Visual Studio 2010\Projects\Cure\Cure\main_form.cs:line 1718
InnerException:
here is the code:
if (e.KeyCode == Keys.Enter && (sender as TextEdit).Text.Trim() != "")
{
this.Cursor = Cursors.WaitCursor;
is_form_exists = false;
foreach (Form search_resul_form in this.MdiChildren)
{
frmSearchResult search_form = search_resul_form as frmSearchResult;
if ((string)search_form.Tag == "BROWSE_PATIENTS")
{
search_form.find_what = "FILE";
search_form.find_text1 = (sender as TextEdit).Text.Trim();
search_form.find_text2 = null;
search_form.browse_result();
search_form.Activate();
is_form_exists = true;
break;
}
}
if (is_form_exists == false)
{
frmSearchResult SearchResultForm = new frmSearchResult(public_var);
SearchResultForm.Tag = "BROWSE_PATIENTS";
SearchResultForm.MdiParent = this;
SearchResultForm.Dock = DockStyle.Fill;
SearchResultForm.find_what = "FILE";
SearchResultForm.find_text1 = (sender as TextEdit).Text.Trim();
SearchResultForm.find_text2 = null;
SearchResultForm.Show();
}
(sender as TextEdit).Text = "";
this.Cursor = Cursors.Default;
}
Technology News @ www.JassimRahma.com
|
|
|
|
|
So, did you look at line 1718?
|
|
|
|
|
this the line:
if ((string)search_form.Tag == "BROWSE_PATIENTS")
Technology News @ www.JassimRahma.com
|
|
|
|
|
foreach (Form search_resul_form in this.MdiChildren)
{
frmSearchResult search_form = search_resul_form as frmSearchResult;
if ((string)search_form.Tag == "BROWSE_PATIENTS")
{
You will have to put in a break point and examine all the objects that may be null. Bear in mind that the error could have occurred before line 1718.
1) search_resul_form as frmSearchResult, will be null if search_resul_form is not a frmSearchResult or a derived type.
2) ((string)search_form.Tag == "BROWSE_PATIENTS" could fail for two reasons. Either search_form or Tag is null.
Alan.
|
|
|
|
|
I have noticed the following:
if I start the application and then invoke the searcH_form then invoke any other form then call the search_form it will be activated normally without a problem
but If I start the application then call anyother form and then try to call the search_form then thsi error will occur.
Technology News @ www.JassimRahma.com
|
|
|
|
|
Possibly something is not being initialised properly. Bear that in mind, but concentrate on determining what is causing the null reference exception as that will direct your search towards the mistake in your code. Use the debugger to find the null object and go and do it now!
Alan.
|
|
|
|
|
From the line number there are only two possibilities
frmSearchResult search_form = search_resul_form as frmSearchResult;
Either frmSearchResult is null or it is not a search_resul_form;
Either case will result in search_form being null. And that is the only possible cause of your error.
|
|
|
|
|
Hi Guys,
I need a console based program to read a gmail mail using c#(Unread only). please can any one send my the link and class library of POP3 or IMAP.
modified 23-Feb-13 1:27am.
|
|
|
|
|
OK, so write it! What? You didn't really think WE were going to do it for you, did you?
Or did you mean to ask a question? I don't see one in your post.
|
|
|
|
|
Is Google not working for you?
Or do you perhaps not know how to use it?
Hint: read a gmail mail using c#[^]
In future, please do at least basic research instead of wasting your time and ours.
If you get an email telling you that you can catch Swine Flu from tinned pork then just delete it. It's Spam.
|
|
|
|
|
|
|
can i make ant hacking software in C#
|
|
|
|
|
How the hell should we know?? We don't know anything about your skill set at all.
So, the default answer, since you're even asking the question, is no.
|
|
|
|
|
This is not a hacker site and I don't think anyone here will help you with this question.
Soren Madsen
"When you don't know what you're doing it's best to do it quickly" - Jase #DuckDynasty
|
|
|
|
|
No.
Ants are insects and are remarkably difficult to hack: they are very small, so hitting them with an axe is difficult, and they do not have internet access so virus code injection is next to impossible.
If you get an email telling you that you can catch Swine Flu from tinned pork then just delete it. It's Spam.
|
|
|
|
|
The perfect and complete solution is this!!!
|
|
|
|
|
it is not good to start learning with hacking......there is so many technologies that is best from hacking to learn.....and safe for career also...
|
|
|
|
|
Just to tell it to you: This is not Google and our services can only be used without sarcasm and dumb answers if you have searched Google before.
|
|
|
|
|
The fact that you ask the question
Member 9857415 wrote: can i make ant hacking software in C#
gives you the answer ! No you can't, otherwise you wouldn't ask.
|
|
|
|
|
i have a probleme with Fingerprint Identification iam using sourceafis to identify but i cant the Afis.Identify function
|
|
|
|
|
You can't WHAT?? Your post made no sense at all.
If you've got problems with a specific library, then your best source of information is the manufacturer of that library.
|
|
|
|
|
i cant get the afis.identify to work
and this is a free library
|
|
|
|