473,406 Members | 2,371 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,406 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 1834

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>...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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...
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
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.