|
I would like to read unicode from INI in my application. Reading from GetPrivateProfileString is ????
For example..
I want to read and display Thai Words in my application.
[Thai]
Card=บัตร
Thanks in advance.
|
|
|
|
|
You can P/Invoke the GetPrivateProfileString as I did below, string 's in .NET are unicode.
[DllImport("kernel32.dll")]
static extern uint GetPrivateProfileString(string lpAppName, string lpKeyName, string lpDefault, StringBuilder lpReturnedString, uint nSize, string lpFileName);
- Nick Parker My Blog | My Articles
|
|
|
|
|
Hi
Use GetPrivateProfileStringW (notice the W)
That's the unicode version.
|
|
|
|
|
I have a network application. These two application has a form on which two label controls are present.
Please see the diagram...
Host1 Host2
Form1.cs Networkoperation.cs Form1.cs
Networkoperation.cs class actually handles the communication between the two applications.
What I Want? I want to have button on each form If I click the button the text present in a textbox on the form has to go the same label control and should be assigned to the Text property of the control.
I am unable to do this, Because how to get the handle of label control of form1.cs class in networkOperation.cs Class?
Any one who knows it Please help to me.
|
|
|
|
|
Hi!
I'm wondering if there are any free texteditor components out there where you can have syntax hightlighting for multiple languages?
If not, any good articles on how to acomplish this yourself?
Thanks in advance!
~~~~~~~~~~~~~~
Martin Lundberg
Student, Sweden
I have to thank every member of the Code Project for making it such a great place for a beginner to learn!
|
|
|
|
|
Martin Lundberg wrote:
If not, any good articles on how to acomplish this yourself?
There are articles online that cover how to do this using a RichTextBox class. This[^] one should get you started.
- Nick Parker My Blog | My Articles
|
|
|
|
|
|
Hi,
I want to select a member of TabControl by stroking keyboard but not by clicking the mouse on it.So,I think I have to create a shortcut key for that member.Can you tell me how to create it?
Thanks!
|
|
|
|
|
i'm not certain what you mean. but if i understandyou properly you want a control to gain focus when a button is pressed?
well i havn't done anything with tabs (never needed to) but here's the general code.
goto the events list on the form that the tabs are on and create a KeyDown handler by double clicking on it.
in the handler do something like this...
if(e.KeyCode == Keys.____)
{
tc.focus();
}
e being keyeventargs, tc being your tab control.
i hope that helped a bit
|
|
|
|
|
Here[^] is an article on creating keyboard accelerators in C#. This should get you started.
- Nick Parker My Blog | My Articles
|
|
|
|
|
After this code EndofHeader is still zero.
Why?
FİleInfo fp = new FileInfo(path);
FileStream file = fp.Open(FileMode.Create);
StreamWriter sw = new StreamWriter(file);
sw.WriteLine("{0} {1} {2} {3} {4} {5}",m,0,-1,1,1;
EndofHeader = file.Position;
balkan
|
|
|
|
|
You could try
sw.WriteLine(String.Format("{0} {1} {2} {3} {4} {5}",m,0,-1,1,1,1));
one argument is missing, and String.Format too...
try adding sw.Flush(); after WriteLine
Hope it'll help...
Robin Panther
|
|
|
|
|
i need some help in validating the contents in property grid in c#.
if anyone knows about this kindly answer the question.
sundar
writesundar@yahoo.com
|
|
|
|
|
hello i want to trap enter/return keystrokes in my custome control no matter wich control withint the custom control has focus i basicly want my control to have an ok button that always reacts to the enter key how do i make this happen?
|
|
|
|
|
your custom control needs to have a keydown handler.
if possible make it extend the Form class, then you can just set the AcceptButton.
|
|
|
|
|
i guess my main problem is is that a my control uses a text box thats not multiline i can trap the enter keystrokes but it beeps every time i have it set to accepts return but since its not multiline it beeps how can i get around this without making it multiline
|
|
|
|
|
i don't understand what you're saying. could you explain exactly what you're doing? if you have a regular single line text box, it will always beep for return strokes unless you use a keyboard hook that intercepts the enter keystroke but that's icky.
From what i understand you might HAVE to use keyboard hooks though. the additional problem is that you don't want the keyboard hook to trap EVERY enter keystroke (per se if you're in another app). to solve this you have to run the hook, when WndProc is called you have to check if your control has focus. if it doesnt you have to pass the message on to the next window handle in the chain to recieve the message. If your control has focus you do whatever you want it to do and don't pass on the message.
|
|
|
|
|
i have a control with a text box and a button and when the user hits enter in the text box im making it trigger the button click event but it always beeps :P
|
|
|
|
|
allright. so lets take a look at it as a timeline.
-You click on the textbox.
-you type something
-press enter. ->
-the KeyPressed message gets sent to a list of handles ending in the text box.
-text box recieves it, it's not multiline so it error-beeps.
your goal is to intercept the message, handle it yourself, and stop it from being passed.
do you need some help writing a global hotkey / keyboard hook?
|
|
|
|
|
i can get the keystroke just fine and make it do what i want i just cant stop it from beeping
|
|
|
|
|
You have to catch the keystroke another way, that's the point. as long as a single line messagebox recieves the enter-press, it will beep.
you have to stop it from getting it, or you can write your own control
|
|
|
|
|
hello
hellp me scan port in c#
|
|
|
|
|
aren't you the same guy that wanted to know how to write a hacking program in c#??
This posting is provided "AS IS" with no warranties, and confers no rights.
Alex Korchemniy
|
|
|
|
|
|
hey im running xp and im creating some dialogs and stuff in C#.net but they have the old style look even when i run the program how do i get them to have the xp style?
|
|
|
|