Thursday, September 9, 2010

Selecting word by right clicking richtextbox vb.net

Recently I've searched internet to find a way to select a word in richtextbox by right clicking the word. But ended up with nothing. May be I've not used right key words to search. Anyways here is what i did by referring to the resource. I hope these would be useful to sum1 like me.

Use these line of codes at mouse down event of richtextbox.


Private Sub rtbInput_MouseDown(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles rtbInput.MouseDown



        ' Getting the word under the mouse clicked loaction
        If e.Button = MouseButtons.Right Then
            Dim CharIndex As Int32
            Dim StartPos As Int32
            Dim EndPos As Int32

            'location of mouse clicked
            CharIndex = rtbInput.GetCharIndexFromPosition(New Point(e.X, e.Y))
            'Locating the end point of the selections
            EndPos = rtbInput.Text.IndexOf(" ", CharIndex)
            'Locating the start point of the selection
            StartPos = rtbInput.Text.LastIndexOf(" ", CharIndex)

            'Checking if the mouse clicked on word 
            If EndPos = -1 Then
                EndPos = 0
            End If
            If StartPos = -1 Then
                StartPos = 0
            End If
            If StartPos > EndPos Then
                Exit Sub
            End If
            'selecting the word under the clicked location
            CharIndex -= StartPos
            rtbInput.Select(StartPos, EndPos - StartPos)
        End If
    End Sub







Wednesday, September 8, 2010

Revised SFYD :Logo


Following are the revision made to SFYD logo and bedge. These designs are made while taking consider the feedbacks and suggestion provided by the team.

SFYD Proposed volley team bedge
SFYD proposed football team bedge
SFYD Proposed bedge
SFYD proposed logo

Sunday, September 5, 2010

Proposed SFYD Logos


These are the proposed design for SFYD logo.
leave any comment or ur thought on these logos.


Design1

Design 2

Design 3