Two things i have to do.
RTB->Rich Text Box 1. Listbox(Or list view) should follow the cursor position. 2. Important: Get the word of deleting char in RTB Text. (Not in the end of RTB text).
Ex: Clicking any word in RTB text and delete any char in that word, here i want the word before deleting any char.
any help will be a good clue for me. Thank You
I got the solution for my listBoxControl move over the cursor Position. -
Private Declare Function GetCaretPos Lib "user32" (lpPoint As POINTAPI) As Long
-
Private Declare Function ClientToScreen Lib "user32" (ByVal hwnd As Long, lpPoint As POINTAPI) As Long
-
Private Declare Function ScreenToClient Lib "user32" (ByVal hwnd As Long, lpPoint As POINTAPI) As Long
-
Private Type POINTAPI
-
X As Long
-
Y As Long
-
End Type
-
-
Private Sub RichTextBox1_KeyPress(KeyAscii As Integer)
-
Dim tCaret As POINTAPI
-
GetCaretPos tCaret 'get the Caret Position in RichTextbox Coords
-
ClientToScreen RichTextBox1.hwnd, tCaret 'get the Coords in Screen Coords
-
ScreenToClient hwnd, tCaret 'get the Coords in Form Coords
-
List1.Move ScaleX(tCaret.X + 3, vbPixels, vbTwips), ScaleY(tCaret.Y + (RichTextBox1.SelFontSize * 1.3), vbPixels, vbTwips)
-
End Sub
-
Now looking for my second solution, i.e, Get the word of deleting(Or backSpace) char in Rich Text Box control. Thank you.
I done my second problem like below -
RichTextBox1.UpTo " ", False, False
-
RichTextBox1.Span " ", True, True
-
1 1845
I got the solution for my listBoxControl move over the cursor Position. -
Private Declare Function GetCaretPos Lib "user32" (lpPoint As POINTAPI) As Long
-
Private Declare Function ClientToScreen Lib "user32" (ByVal hwnd As Long, lpPoint As POINTAPI) As Long
-
Private Declare Function ScreenToClient Lib "user32" (ByVal hwnd As Long, lpPoint As POINTAPI) As Long
-
Private Type POINTAPI
-
X As Long
-
Y As Long
-
End Type
-
-
Private Sub RichTextBox1_KeyPress(KeyAscii As Integer)
-
Dim tCaret As POINTAPI
-
GetCaretPos tCaret 'get the Caret Position in RichTextbox Coords
-
ClientToScreen RichTextBox1.hwnd, tCaret 'get the Coords in Screen Coords
-
ScreenToClient hwnd, tCaret 'get the Coords in Form Coords
-
List1.Move ScaleX(tCaret.X + 3, vbPixels, vbTwips), ScaleY(tCaret.Y + (RichTextBox1.SelFontSize * 1.3), vbPixels, vbTwips)
-
End Sub
-
Now looking for my second solution, i.e, Get the word of deleting(Or backSpace) char in Rich Text Box control. Thank you.
I done my second problem like below -
RichTextBox1.UpTo " ", False, False
-
RichTextBox1.Span " ", True, True
-
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Matt |
last post by:
Is there any way to display one routine only in the Code Editor,
like it was possible to do in VB6?
Or is there an Add-in free or on-sale that does this?
Or is it possible to create ourselves...
|
by: Alexander Muylaert |
last post by:
Hi
Does anyone know a good starting point about high speed string processing in
C#?
What I need is a very fast routine for a case insensitive "contains". e ==
E == é == ë == ...
Kind...
|
by: Groide |
last post by:
Hello, I'm crazy but I want create an editor with c# and
System.Windows.Forms.RichTextBox.
I have many difficult to create the effect to highlights the text and to
close the tags.
This is my...
|
by: Vinay Agarwal |
last post by:
Hello,
I would like to maximize efficiency of string processing in my C#
application that works with Skype API. Actually, these "strings" are made of
"chars" that are all 8-bit values except 0...
|
by: zoro |
last post by:
Hi,
I am new to C#, coming from Delphi. In Delphi, I am using a 3rd party
string handling library that includes some very useful string
functions, in particular I'm interested in BEFORE (return...
|
by: Eric |
last post by:
Using the 1.1 framework. We are using a newly created instance of a
RichTextBox Class in our server code to manipulate RTF that is stored
in the database. To clarify, we are not using or...
|
by: billpaterson2006 |
last post by:
I've been working on some code to search for specific textstrings and
act upon them insome way. I've got the conversion sorted however there
is 1 problem remaining.
I am trying to work out how...
|
by: Bryan |
last post by:
I am developing a VB project in VS2005 that has SP2 installed. This
is the process that is causing a problem:
Open VS2005, open the project
Write some code in the code editor
Run the project in...
|
by: YASIN786 |
last post by:
hi all
i am helping a friend to develop a java program to implement the following features but i cannot understand how to go about this problem.
A text file contains a number of English...
|
by: doznot |
last post by:
Let's say you want to use Moodle to teach an introductory class in PHP
programming. Some of the students have little or no computer experience.
In addition to background reading and...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
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...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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,...
|
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...
|
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...
|
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...
|
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...
| |