Dear freinds,

I have a big issue which I have been struggling with for days now.
I have a richtextbox where users Can input text and print it. My problem is that i don't want to allow more than one page to be printed so i need to prevent the users in inputting more text than what fits to one page. I have word wrap set to True which means that i really can't count the lines since they are determined by number of return/enter hits. I can't set the character to a max because blank Lines and spaces Can cause this to differ very much.

What i really need i a way to prevent the users in inserting more text than would fit inside the richtextbox frame and the frame may not be resizeble.

Please help me if any goods ideas rises in your heads.

Recommended Answers

All 2 Replies

who told you that you can't count lines ???? (he lied to you)

Private Sub Rich_SelectionChanged() _
     Handles Rich.SelectionChanged

    With Rich
        Me.StatusBar_Pos.Text = _
           String.Format("Col : {0}   Line : {1}", _
             .SelectionStart - .GetFirstCharIndexOfCurrentLine(), _
             .GetLineFromCharIndex(.SelectionStart))
        End With
End Sub

I'm sorry I used a lot of the sign _ to make the code locks good here so it don't wrap

hope this helps

I am telling you - i have searched all vb sites on the entire web for that piece of code you just gave me...

Seveal tutorials actually claim that it is not possible to do what your code are doing..

Once again - thank you soo much...

Kristian

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.