Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7903741
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T09:49:40+00:00 2026-06-03T09:49:40+00:00

if creating a dictionary program. when use copy some text on clipboard it will

  • 0

if creating a dictionary program. when use copy some text on clipboard it will give the meanings of copied text in a form visible on system try. i want to close the form when user click any where on his/her screen. but if user want to copy some text from meanings from will not close i added more then one dynamically created richtextboxes in a tab control to show number of meanings. my code is working great accept one thing when user scroll the richtextboxes form will close itself. it seems scrollbars are not the part of richtextbox. Help me to solve this problem my code is below.

Dim s As Boolean = True

Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
    If MouseButtons.ToString = "Left" Or MouseButtons.ToString = "Right" Then
        If s = True Then
            If InStr(LCase(Me.ActiveControl.ToString), LCase("Label")) Then
                Me.Close()
            End If
        End If
    End If
End Sub

Private Sub Label1_Click(ByVal sender As Object, ByVal e As EventArgs) Handles Label1.Click
    Me.Close()
End Sub
Private Sub frmdict_MouseEnter(ByVal sender As Object, ByVal e As EventArgs) Handles Me.MouseEnter
    s = False
    Button1.Focus()
End Sub

Private Sub frmdict_MouseLeave(ByVal sender As Object, ByVal e As EventArgs) Handles Me.MouseLeave
    s = True
    Label1.Focus()
End Sub

==Update==

i have form1 which contains this code to add richtextboxes and tabs to tabcontrl

Dim myTabPage As New TabPage()
Dim myrichtext As New RichTextBox()
myrichtext.Name = "RichTextBox" & i
myTabPage.Text = StrSearch & i
frmdict.TabControl1.TabPages.Add(myTabPage)
myTabPage.Controls.Add(myrichtext)
myrichtext.RightToLeft = Windows.Forms.RightToLeft.No
myrichtext.Dock = DockStyle.Fill
myrichtext.Font = New Font("Urdulink", 14)

And finally open frmdict to show meaning

If frmdict.TabControl1.TabPages.Count > 0 Then
  frmdict.TabControl1.RightToLeftLayout = True
  frmdict.Show()
  frmdict.Label1.Focus()
  ' frmdict.TabControl1.Focus()
Else
  frmdict.Close()
End If
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T09:49:41+00:00Added an answer on June 3, 2026 at 9:49 am

    Your MouseLeave does fire whenever the mouse goes over one of the child controls of the form, which is probably not what you were expecting.

    I’m not sure what’s going on with your label and button, but something like this will probably make it work for you:

    If s = True Then
      If Not rtb1.Bounds.Contains(Me.PointToClient(Cursor.Position)) AndAlso _
         TypeOf Me.ActiveControl Is Label Then
        Me.Close()
      End If
    End If
    

    Update:

    In terms of your dynamic rich text controls, you don’t really need the name. Something like this should work (not completely tested):

    If TabControl1.SelectedTab IsNot Nothing Then
      For Each rtb As RichTextBox In TabControl1.SelectedTab.Controls.OfType(Of RichTextBox)()
        If Not rtb.Bounds.Contains(rtb.PointToClient(Cursor.Position)) Then
          Me.Close()
        End If
      Next
    End If
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there some kind of a shorthand fluent interface for creating a parameters dictionary
Creating a server-side socket will fail if I'm trying to use the same port
I'm using the operating systems dictionary file to scan. I'm creating a java program
I'm creating a dictionary object in javascript (eg associate array) var myobj = {
I'm creating a dictionary app. My Sqlite database is about 15MB and on the
Creating a JApplet I have 2 Text Fields, a button and a Text Area.
When creating a new service in a WCF service project, Visual Studio will automatically
I am using jsTree for creating a documentation list index. I use JSON to
I'm creating a dictionary database using php and MySQL. The user can search for
I am creating dictionary out of a large file. def make_dic(): big_dic={} for foo

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.