I just had a breakthrough!
The code to write to the textbox was being called from my form's load event. Problem was that the textbox wasn't visible yet. Simply had to add a "me.show" statement prior to writing to my textbox so that it was actually drawn first.
Now the simple .SelStart method...
Thanks for the responses.
three57m's code works well. I'll have a closer look at it to see how to make use of it. Not sure why the simpler solution does not work. As for my code, it's pretty simple:
Private Sub txtStationTerm_Change()
With txtstationterm
.SelStart = Len(.Text)...
Hey all,
I've written an app with a textbox that I hope to have scroll to the bottom as I add information to it (a terminal window that shows processing information).
All the info I can find on this issue says to add
text1.selstart=len(text1.text)
and possibly
text1.selLength=0
This does...
Not exactly what you're looking for, but do a search for the comp.graphics.algorithms faq. This doc has lots of algorithms for computing things like this. Including some ideas for intersecting two polygons, calculating the intersection point of line segments and calculating centroids...
Robert,
Thanks, that makes sense.
I'm starting to feel better about creating objects. I'm sure I'd have my current project wrapped up with a pretty bow on it if I did it my usual way, but this exercise is informative.
I appreciate all the help from everyone. The resource of Tek-Tips is what...
Based on the advice of TheVampire and Chiph, I'm going to forego the UDT and stick with creating a second class. What's the point of trying to go OOP if you only go half way, right?
One additional question: I know that one of the big selling points of creating objects is encapsulation. My...
Here is a very simple example:
Create a new project with a command button and a picturebox. Paste this code:
Private Sub Command1_Click()
x_small = -5
x_large = 5
y_small = -5
y_large = 5
Picture1.Scale (x_small, y_large)-(x_large, y_small)
'draw polynomial...
Unless you have reams of data, why not draw on a picturebox? I have successfully done this plenty of times to graph many data points. It is some work, but you can write code to zoom-in and zoom-out, pan, etc. The redraw is surprisingly fast on modern computers, especially if you are only...
Here's a function that should do what you want. Just pass your string to this function and it should remove the duplicates and pass it back.
Private Function removedups(instring As String) As String
Dim holder() As String 'just a temp array to hold each line of text
Dim i As Long
holder =...
Gentlemen,
Thanks for the advice. It looks like I'm going to have to get a better handle on the 'set' and 'new' keywords. Strongm's suggestion was exactly what the doctor ordered. Thank you very much.
I looked up the friend keyword. The entry in MSDN under 'friend members' looks like...
Hi Chiph,
I accidentally posted this question twice (it is being discussed on two threads now). With some help, I have narrowed my problem somewhat.
Right now I'm having trouble passing an object through a function. For example:
Dim mypoint As New clsPoint2d
mypoint = ascii2pt(UserString)...
Thanks for the suggestions guys. We're getting closer, however I'm still not quite there.
My function now looks like:
Public Function ascii2pt(instring As String) As clsPoint2d
Dim holder() As String 'temp variable to hold split string
Dim i As Integer
Set ascii2pt = New...
Thanks for the suggestion. I made the change but still no success. The class now reads:
Public Property Let X(inval As Double)
m_X = inval
End Property
Public Property Get X() As Double
X = m_X
End Property
I am still having no luck creating a function that returns (or is) a class object.
I call the function here:
Private Sub mnuAddpoint_Click()
Dim message As String
Dim title As String
Dim UserString As String
Dim mypoint As New clsPoint2d
'just get point from user with...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.