|
Hello
You can using API function calls, but why the effort?!! You can inherit your own custom MessageBox from that class, or make your own form to simulate the MessageBox you want to display.
Regards
|
|
|
|
|
Nader Elshehabi wrote: You can inherit your own custom MessageBox from that class, or make your own form to simulate the MessageBox you want to display
Yes, but then I have to make one for every language version of Windows the user might be using.
|
|
|
|
|
No! All you have to do is to make a public text property that will take the text depending on the user's language, then you wupply it with the text according to the current culture. You can store your texts in a string table, or even an array for whatever it's worth!!
Another approach is to make an API call to MessageBoxEx() function. I think it does exactly what you want.
Regards
|
|
|
|
|
Nader Elshehabi wrote: You can store your texts in a string table, or even an array for whatever it's worth!!
The point is that I do not know WHICH languages I will encounter. Therefore, I can never make a 'complete' list of button texts (if I had that many dictionaries anyway). In order to make it work for ANY language I will need to ask Windows for the button texts.
Anyway, Guffa has pointed me into another direction. Thanks though.
|
|
|
|
|
Perhaps that is possible, but why do you want to present a translation table to the user?
You should use a custom dialog so that you can put a meaningful text on the buttons, instead of telling the user that "Yes" means "Continue" and "No" means "Quit".
---
b { font-weight: normal; }
|
|
|
|
|
Guffa wrote: but why do you want to present a translation table to the user?
Perhaps my example wasn't really appropriate. Try this message:
"The item aleady exists in the list. Do you want to overwrite it? If you press 'No' the item will be lost."
Now, if the user has, say, a French version of Windows I would like to replace the string 'No' with 'Non', because that is the text the French OS will display on the MessageBoxButton.No . Or if he has a German version I want to replace it with 'Nein'.
Guffa wrote: You should use a custom dialog so that you can put a meaningful text on the buttons
Perhaps that is the better solution. Still, if anyone knows a method to query Windows for its standard texts, I am very interested.
Thanks for your responses, all of you.
|
|
|
|
|
jjansen wrote: Perhaps my example wasn't really appropriate. Try this message:
"The item aleady exists in the list. Do you want to overwrite it? If you press 'No' the item will be lost."
Why not use a sentence that does not reference the text of the button at all? You can also make it clearer which of the items that will actually be lost:
"An item with that name already exists in the list. Do you want to replace it? If you choose not to, the new item will be lost."
---
b { font-weight: normal; }
|
|
|
|
|
You're right, that would work too. If the question gets too complicated (or potentially confusing) to answer with a simple Yes or No you should go for the custum dialog anyway. Thanks.
|
|
|
|
|
i'm using CrystalReportViewer control from standart C# and his export option. After i export my report and i return to my application i get a error message because he cannot find my acces_file.mdb
what to do??
|
|
|
|
|
In Asyn Callback if some error happens and it enters into a infinite loop then all other calls will be hanged or these request will get result.
|
|
|
|
|
Question?
modified 12-Sep-18 21:01pm.
|
|
|
|
|
hi
i m writing code for a Client/Server mechanism, here many users can connected and get some data. Now in some connection there might be some errors and that particular asyn call may enter in a infinite loop. So in this case the other users connected are able to make request and get data or server will stop responding to them also.
Thanks in advance.
|
|
|
|
|
If you don't create a seperate thread for all your incoming connections then an infinite loop will hang your entire program.
But even if there's some errors in the data your application should never, under any circumstances, fall into an infinite loop. Also not, when it uses multiple threads. Try to handle this error so your app won't create and infinite loop, check the incoming data for errors etc.
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
I think you are asking:
"In Asyn Callback if some error happens and it enters into a infinite loop then will all other calls will be hanged or will these requests be processed?".
I beleve the answer is that they will hang.
|
|
|
|
|
Hi
As per ur believe it will hang and it is really so. So now how can i achieve this. Say in ATM a user comes and checks his balance now if there is some error in server them it is particular for that request all other users are not affected.
My requirement is same the if a asyn call enters into infinite loop it should be for that call only not for all the subsequent request.
thanks in advance
|
|
|
|
|
Create a Thread for each incoming connection, you may want to use a ThreadPool for this. But see my answer above, don't let your app fall into a infinite loop at all!
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
How can i add password to a pdf file in C#.
|
|
|
|
|
Hello
This depends on the library -if any- you are using. No classes in C# deals directly with pdf files.
Regards
|
|
|
|
|
hi
Do CodeProject has some example of writing pdf with passsword protection.
pls guide me with some examples to how to get this done.
thanks in advance.
|
|
|
|
|
You won't find examples for "writing pdf with passsword protection" straightforward. Searching for that won't get you anywhere. What you are looking for is a pdf writing library. Some commercial libraries are out there. As I told you, search CodeProject's articles areas for "pdf", or google for "pdf C# library". That might get you closer.
PS.
Elcomsoft has a program called Advanced PDF password recovery by the way. So, if your documents isn't that value, don't make the effort. Good luck!
Regards
|
|
|
|
|
|
Hi,
I have an ArrayList which was populated by a text file with no column headers. What I want to do is split the ArrayList into columns then display it in a datagrid. The ArrayList is made up of lines such as
0168EH1X.PA0 020 1 GRA_ 08/14/06 12:16:42
I need to split this into 5 columns under the headings ID, Duration, Status, Channel and DateTime.
I've been trying to do this with the .SubString method but no luck. I know how to define the columns in the grid but I can't split the ArrayList up. Please can anyone help?
Thanks
Scott
|
|
|
|
|
Hello
Is your ArrayList an array of strings each on the above format?
Regards
|
|
|
|
|
Hi,
Yes, it is. Anywhere between 10 and 150 strings. The format for each string is identical.
|
|
|
|
|
scotlandc wrote: 0168EH1X.PA0 020 1 GRA_ 08/14/06 12:16:42
I need to split this into 5 columns under the headings ID, Duration, Status, Channel and DateTime.
Simple! use
MyArrayList[X].ToString().Split(' ');
to get an array of strings of each column.
Regards
|
|
|
|