473,425 Members | 1,671 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,425 software developers and data experts.

RichTextBox code to change the Insert/Overwrite mode does not work

I have a RichTextBox and I want to programmatically change the
Insert/Overwrite mode.

I tried the following but it doesn't appear to change the mode.

Pressing the Insert or Ins key does change the mode.

Any suggestions or verification?

Thanks

[DllImport("user32", CharSet=CharSet.Auto,EntryPoint="SendMessage")] public
static extern uint SendMessagezz (IntPtr hWnd , uint msg ,uint wParam , uint
lParam );

[DllImport("user32", CharSet=CharSet.Auto)] public static extern uint
MapVirtualKey (uint uCode , uint uMapType );

public static void FlipInsert(IntPtr Handle)

{

// uint WM_KEYDOWN = 0x100;

// uint WM_KEYUP = 0x101;

// uint VK_INSERT = 0x2D;

uint zz0 = MapVirtualKey(VK_INSERT, 0) * 0x10000;

uint zz1 = 1 | zz0;

uint zz2 = 0xC0000001 | zz0;

SendMessagezz(Handle, WM_KEYDOWN, VK_INSERT, zz1);

SendMessagezz(Handle, WM_KEYUP, VK_INSERT, zz2);

}
Nov 17 '05 #1
0 1836

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Bertrand P. | last post by:
I want use a RichTextBox to allow users to edit and modify complex report. I need to insert at runtime many optional fields wich comes from a database. I have think "well I will use the rtf...
0
by: DMD | last post by:
How do I determine the current edit mode within a RichTextBox control? The user may toggle the key to turn off/on insert, how do I quer the RichTextBox control to get this information Another...
1
by: johngilmer | last post by:
By default, when I type into a text box, it inserts the text into the existing text rather than overwriting the existing text. If I hit the "insert" key on my keyboard, it switches the mode to...
8
by: Dennis | last post by:
How can I tell if the Insert Mode is on or off? -- Dennis in Houston
3
by: josh.kuo | last post by:
Sorry about the subject, I can't think of a better one. I recently wrote some PHP classes that I think might be of interest to this group. Since I have been reaping the benefits of reading news...
0
by: Vincent | last post by:
Dear all, I have implemented a class to export the content of RichTextBox to image in WYSISYG mode so that line breaks on the screen are the same as exported. C# Code: public struct...
1
by: farrukhqadri786 | last post by:
Hi! I have an imageList and a richtextbox in a C# form. I want to insert image from imageList into a richtextbox. I have found the following code on net but it does'nt work. ...
2
by: JCCDevel | last post by:
Hello, I'm working on a pretty simple web app in which the user will be pasting in a list of values (letters and number - like "1V456") most likely from an Excel worksheet. I then want the...
7
by: paul_0403 | last post by:
I have the following XML file <?xml version="1.0" encoding="UTF-8"?> <CentralServerRequest> <RequestInfo> <ResponseFile Mode="Overwrite"></ResponseFile> <StatusFile></StatusFile>...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.