Hi i am developing an application in which i have required to get the print of panel control along with other control that are placed in panel control. I am able to take the print but there is a problem that i want that there should occur an Print Dialog befor printing but print Dialog does not occur so how can Print Dialog shows before printing...
PrintDocument printDocument1 = new PrintDocument();<br />
AT FORM LOAD this.printDocument1.PrintPage += new PrintPageEventHandler(printDocument1_PrintPage);
I am using an Image Control that i found here:
It is really good and very useful. I am building a map based system and need to retrieve the mouse coordinates on the map. The 'onclick', 'onmousedown','onemouseup' etc events are not working on this 'imagecontrol'. It doesnt trigger when i click anywhere on the map except for the border near the scrollbar. I tried with the normal picturebox control and it worked perfectly. But I obviously need to use this control because of the great features.
What should I do? why doesnt the event trigger on the image. I tried what someone (splater) had suggested on the messageboard of that page but to be honest i couldnt exactly understand what he meant........ mebbe coz im using VC# and some stuff might be diff from VB. I didnt understand what the drawingboard etc was.....I even tried getting the email id of the creator of that control but wasnt able to find it anywhere.
his is what i have been doing....... but it seems the events themselves are not firing..... nd i have no clue why
//imagecontrol name: img_Map
//clickPos is a global variable
I am doing this as the control also has panning feature when we click the mouse and move it. So i want it to give the coordinates only when the mousedown and mouseup occur at the same position (else it is panning).
But BOTH these events do not fire when i click on the image in the control. but it does work when i click on the border near the scrollbars.
I might be asking for a little too much, but if anyone could download that control and check it out, it would really be a huge favor.
Which makes it ridiculous for you to be building a 'map based system' in C#. Someone is paying you to learn C# on the job ?
I answered this yesterday, but it looks like you're trying to take my advice ( well, it was the advice of someone who used the control before ). Assuming what they said had worked for them, I have to assume you're not hooking the events up ( in VB, they can be hooked up inline, in C# you need to do it in the designer, or in the constructor or load event ), or you're hooking them up to the wrong thing.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
I would consider two things.
First would be performance of return (T)_dataReader.GetValue(i);, I don't know exactly how GetValue works internally but I think that it is a bit slower than type specific method like GetInt32 becase there is more type conversion stuff. Plus by using type specific Get method you would save one of your type conversion return (T)_dataReader.GetValue(i). Disadvantage is that you would have to use IF statement to determine which specific Get method to call.
Second thought is that I'm not sure if it is a best practice to have GenericDataReader to create businness objects. In my opinion objects like data readers should just get you a data and that is it. They should not be creating any business objects. Also I think that Business object should not work directly with data reader. It has lot of other work to do anyway. So I would suggest to create some BusinessDataObject that would take care of getting data from database, using GenericDataReader. And then any business object would just use relevant BusinessDataObject to load data.
Looking at System.Data.OleDb implementation through Reflector, GetInt32 and GetValue returns values based on column types, so I think both have similar performance. And, if I had to code an IF inside that generic method, I prefer to stick with current ADO.NET implementation
About your second thought, I share your feelings. My main point is to define a simple pattern for data fetch, probably in a structure like Entity (get/set/read) >> Data (DAL/.executeXXX) >> Business (work with loaded data) >> and so on.
Thank you for your comments, I really appreciate them.
1. Do you have a firewall enabled...maybe blocking port 30 on the client or on the server side.
2. Check the return of the Connect() function.
3. Is the client on the same machine as the server?....that will definitely make the sending of data seemless! (you said that bytesSent = bData.Length...therefore the data is being sent somehow...)
Well a good thing to do (if you have the server code) is to display the received data to make sure if the data is being received.
in string + something if something is not a string, the compiler will
replace it by something.ToString() automatically.
Luc Pattyn [Forum Guidelines][My Articles] This month's tips:
- before you ask a question here, search CodeProject, then Google;
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get;
- use PRE tags to preserve formatting when showing multi-line code snippets.
Hi I’m developing an internet ASP.NET application, which needs to interact with Microsoft Certification Authority Server, the
client (browser) will request a certificate to sign a file (word, pdf) later.
I'm really disoriented. Must I use CAPICOM? Signing in the server, and sending the certificate through an SSL connection? Is
there any class in the .Net Framework to interact with Certification Authority Service without CAPICOM or an external Api?
I've been using a COM component for audio recording/editing in my forms application. Now since it does not work on Vista I must find a replacement.
Can anyone here hint me of a component, COM or pure managed code that fulfils the following needs:
* Recording direct to disc to wav-files
* Converting to/from Wav and OGG
* Audio editor for editing the sound file
* Plying sound in OGG and Wav files.
The component I’ve been using is from NCTsoft (www.nctsoft.com - > the link almost dead )
i need help with a quick program i am making, how would i exit a block of code in an if statement for example
private void button1_Click(object sender, EventArgs e)<br />
code to be run here<br />
if (x ==5)<br />
run more code<br />
exit this block<br />
more code here<br />
this is hard to explain but there is no other way i can think of doing this i know in visual basic there was something called exit sub (or something similiar been a while) that would leave it