|
This might also help.
Friend Enum EditMessages
GetSel = 176
SetSel = 177
GetLineCount = 186
LineIndex = 187
LineFromChar = 201
GetFirstVisibleLine = 206
CharFromPos = 215
PosFromChar = 1062
SetCharFormat = 1092
SetBgColor = 1091
GetCharFormat = 1082
SetScrollPos = 1246
GetScrollPos = 1245
End Enum
Sorry I forgot it in the first post.
Good Luck
Aaron Eldreth
TheCollective4.com
|
|
|
|
|
I really appreciate the help.
Thanks a Fortune.
|
|
|
|
|
|
Great!
The files for download are not availible. Is the code in the article all there is.
|
|
|
|
|
I'm really sorry about that. Another person pointed that out to me, and I fixed the links.
Again, sorry. It's my first article.
Aaron Eldreth
TheCollective4.com
My Articles
While much is too strange to be believed,
Nothing is too strange to have happened.
- T. Hardy
|
|
|
|
|
I have inherited the Winforms Textbox control and added a property called Format, which will format the Integers to either Integer or Double etc. This format works fine on the OnValidating event of the textbox. But I want to set the format as and when the user types the value into the Textbox.
For example, if my format is ###,###.00 and when the user starts typing something like 1234 (and still continuing), I should automatically set the format to 1,234.00. I can able to do this, but my real problem is I have to position the caret next to the last character (or integer in this case) typed!!
Please help me out, dear friends!
N.T.GOPALAKRISHNAN
|
|
|
|
|
Have you tried using the SelectionStart() property?
Try this code at the end of your validating sub:
txb.SelectionStart += 1
Good luck!
Aaron Eldreth
TheCollective4.com
|
|
|
|
|
Thanks for your reply, but this will not work. Reason is,
For example, let my format string is ###,###.00. When the user types 1234, the selection start will be 4. But due to the format happening, the string will be changed (while typing itself), to 123,4. Now I need to place the string at the 5th position and not in the 4th position. And since the format can be dynamic, I can't rely on SelectionStart, but I need to find the current caret position of the last character typed.
|
|
|
|
|
"I need to find the current caret position of the last character typed."
Ok, I understand now. Your first post wasn't very clear on what you needed. For finding the Caret position, there is an API call GetCaretPos().
Public Declare Function GetCaretPos Lib "user32" (ByRef pt As System.Drawing.Point) As Integer
And it is used like this:
<br />
Dim pt as System.Drawing.Point<br />
<br />
GetCaretPos(pt)<br />
<br />
Msgbox("The cursor is at X:" & pt.X & " Y:" & pt.Y)<br />
Basically, since the API call uses a ByRef variable, the variable passed to GetCaretPos() holds the X, and Y location of the cursor.
Another API function I think you'll find useful is SetCaretPos
Public Declare Function SetCaretPos Lib "user32" (ByVal x As Integer, ByVal y As Integer) As Integer
Hope this helps!
Aaron Eldreth
TheCollective4.com
My Articles
While much is too strange to be believed,
Nothing is too strange to have happened.
- T. Hardy
|
|
|
|
|
i want to make an Event Calendar in Windows Application by using vb.net. Also I have to retrieve the events ( the event name ) from the database and appear in the calender in the cell of specified date. Here i can add more than one events. what should i do ? is it possible to customize the month calendar tool or is it possible with 31 text boxes and labels to specify the date ?
|
|
|
|
|
I have two .txt files with information on them. I need to create a Random Access File with the data. How do I go about doing that? (As you can tell I’m a beginner)
My book doesn’t really cover this issue , and I really want to learn how to do it.
Doirs
|
|
|
|
|
why cant i create a data report..
|
|
|
|
|
Can't help you unless you get alot more specific about the problem. Error messages help alot...
RageInTheMachine9532
|
|
|
|
|
I feel like a complete idiot for asking this question, but I havnt programmed since high school ( been over 4 years ) so .NET is almost like im relearning everything. Anyhow, how on earth do you get input in a VB.NET console application?
|
|
|
|
|
Hi there. Use the System.Console object -
dim s as string
Console.WriteLine("Enter your name:")
s = Console.ReadLine()
|
|
|
|
|
In the property browser for a multi line textbox the lines property says: String[] Array and can't be edited in place, one has to use the editor. How do I do that for my classes which can be edited in a property browser so that it just says something which can't be changed and the user has to use the provided editor?
Rugby League: The Greatest Game Of All.
|
|
|
|
|
Hi,
Here's my problem. I want to open a form then check to see if there are any records present in the Access database that i'm connected to. If there are no records I want the form to close. I keep getting something like can't close the form while creating handle. To get over this I used the mouseMove event so that the correct code would be called after the form has loaded. This works but it's not ideal. Has anyone got any better suggestions as to how I do this.
Thanks in advance
|
|
|
|
|
I'm not sure where you're trying to close your form that's causing you to get this error, but the Form class has a HandleCreated event that you can handle and close if needed.
The ideal solution, however, would be to separate your application logic from your UI and show your form only after you've determined it's appropriate.
Charlie
if(!curlies){ return; }
|
|
|
|
|
I have a class that I want everything in it to ne shared, can events be shared? It allows me to write:
public shared event DoSomething()
but how do I subscribe to those events in my code? WithEvents gives an error.
Rugby League: The Greatest Game Of All.
|
|
|
|
|
WithEvents wouldn't make any sense here because you're not subscribing to an instance event, but rather an event of the class itself.
Use an AddHandler statement to add an event handler for a shared event.
' Note that you're subscribing to an event of MyClass itself,
' not an instance of MyClass
AddHandler MyClass.EventName, AddressOf NameOfMethod
Charlie
if(!curlies){ return; }
|
|
|
|
|
Thanks for that, I wasn't thinking straight
Rugby League: The Greatest Game Of All.
|
|
|
|
|
Im trying to access a Public Property in a form with name Principal(mdiParent) from another one (mdiChild) but i can't get acess whats wrong ?
Private _IDTechLOG As Integer
Public Property IDTechLOG() As Integer
Get
Return _IDTechLOG
End Get
Set(ByVal LeID As Integer)
_IDTechLOG = LeID
End Set
End Property
|
|
|
|
|
XGaMeS wrote:
i can't get acess
What does this mean?
Are you casting the parent form to the correct type? Post the code that's not working to get a more specific answer.
Charlie
if(!curlies){ return; }
|
|
|
|
|
I wasn't seeing the property, and yes it was c casting error
I am a newbie
|
|
|
|
|
Is it possible for a VBScript (i.e. test.vbs) to actually know it is called "test.vbs"?
I seem to recall something in VB Using "Application" "object" for finding out that kind of stuff.
~Mike Stanbrook
modified on Saturday, January 22, 2011 10:21 AM
|
|
|
|