2 Replies - 215 Views - Last Post: 26 July 2012 - 10:54 PM Rate Topic: -----

#1 Vishal1419  Icon User is offline

  • D.I.C Head

Reputation: 4
  • View blog
  • Posts: 141
  • Joined: 19-May 12

Proper Case in vb.net

Posted 26 July 2012 - 09:06 PM

Hello Everybody,
I got another problem as always

I know how to convert a string or text of textbox to Propercase
But the problem is that when some words like "in" "is" , etc. comes they should not be converted to propercase
How do I do that

Thanks for any help
Is This A Good Question/Topic? 0
  • +

Replies To: Proper Case in vb.net

#2 DimitriV  Icon User is offline

  • Don't try to save yourself… the circle is complete
  • member icon

Reputation: 544
  • View blog
  • Posts: 2,632
  • Joined: 24-July 11

Re: Proper Case in vb.net

Posted 26 July 2012 - 10:36 PM

How are you capitalising? Are you splitting the string at the spaces and then capitalising those individually? Could I see the code please, so that I can understand the way you're doing it and then find the best way to change the code round.
Was This Post Helpful? 0
  • +
  • -

#3 Vishal1419  Icon User is offline

  • D.I.C Head

Reputation: 4
  • View blog
  • Posts: 141
  • Joined: 19-May 12

Re: Proper Case in vb.net

Posted 26 July 2012 - 10:54 PM

ya sure

I call it from the module

Module modProperCase

    Public Sub ProperCaseTextChanged(ByVal sender As Object)

        Dim x As TextBox = CType(sender, TextBox)
        Dim sel_Start As Integer
        Dim sel_Length As Integer

        sel_Start = x.Selectionstart
        sel_Length = x.SelectionLength
        x.Text = StrConv(x.Text, VbStrConv.ProperCase)
        x.Selectionstart = sel_Start
        x.SelectionLength = sel_Length

    End Sub

End Module



I call this code in textchange event of textbox

Thanks for your reply
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1