文本框中的文本框加载到文本框上的Panlel鼠标选择不起作用 [英] Textbox in a from that is loaded into a Panlel Mouse select on txtbox not working

查看:85
本文介绍了文本框中的文本框加载到文本框上的Panlel鼠标选择不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好我正在使用vb.net 2005这是一个Windows应用程序


我在另一个我创建的项目中使用此功能

简单项目显示问题

基本上我有两种形式:

Form1 - 包含一个面板(System.Windows.Forms.Panel)

Form2 - 包含两个文本框,其中包含一些示例文本

如果Form2自己执行,文本框工作正常,你可以使用鼠标选择一部分文本和复制粘贴它

但是如果我在Form1的面板中运行Form2,那么文本框的功能就会消失,你就不能再使用鼠标来选择部件了。 >
的文字你只能点击选择

文本框的全部内容。

这是我正在使用的代码:

代码:

公共类Form1

私有子Form1_Load(ByVal发送者As System.Object,ByVal e As

System.EventArgs处理MyBase.Load

Dim frmToDisplay As New Form2

frmToDisplay.TopLevel = False

Panel1.Controls.Clear()

Panel1。 Controls.Add(frmToDisplay)

frmToDisplay.Show()

frmToDisplay.Activate()

End Sub

结束类

有没有人知道id这是VB 2005的一个bug还是我在做什么

什么

错了?

谢谢

Hi I am using vb.net 2005 this is a windows application

I am using this functionality in another project I have created this
simple project to show the problem
Basically I have two forms:
Form1 - contains a panel (System.Windows.Forms.Panel)
Form2 - contains two textboxes with some sample text in them
If the Form2 is executed on its own the textboxes work fine you can
use your mouse to select a portion of the text and copy paste it
However if I run the Form2 in a panel in Form1 the functionality of
the textboxes is gone you can no longer use the mouse to select parts
of the text you can only souble click to select the whole contents of
the textbox.
this is the code I am using:
Code:
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Dim frmToDisplay As New Form2
frmToDisplay.TopLevel = False
Panel1.Controls.Clear()
Panel1.Controls.Add(frmToDisplay)
frmToDisplay.Show()
frmToDisplay.Activate()
End Sub
End Class
Does anyone know id this is a bug with VB 2005 or am I doing
something
wrong?
THANKS

推荐答案

Brano写道:
Brano wrote:

你好我是使用vb.net 2005这是一个Windows应用程序


我在另一个项目中使用此功能我创建了这个

简单项目来显示问题


基本上我有两种形式:


Form1 - 包含一个面板(System.Windows.Forms.Panel)

Form2 - 包含两个文本框,其中包含一些示例文本


如果Form2自行执行,文本框工作正常,你可以使用y
使用y我们的鼠标选择文本的一部分并复制粘贴它


但是如果我在Form1的面板中运行Form2,则文本框的功能是

走了你就不能再使用鼠标来选择零件

的文字你只能单击以选择

文本框的全部内容。


这是我正在使用的代码:


代码:


公共类Form1


Private Sub Form1_Load(ByVal sender As System.Object,ByVal e As

System.EventArgs)处理MyBase.Load


Dim frmToDisplay As New Form2


frmToDisplay.TopLevel = False

Panel1.Controls.Clear()

Panel1.Controls.Add(frmToDisplay)

frmToDisplay.Show()

frmToDisplay.Activate()


End Sub

结束班


有没有人知道id这是VB 2005的一个bug还是我在做什么

所以预测

错了?


谢谢
Hi I am using vb.net 2005 this is a windows application

I am using this functionality in another project I have created this
simple project to show the problem
Basically I have two forms:
Form1 - contains a panel (System.Windows.Forms.Panel)
Form2 - contains two textboxes with some sample text in them
If the Form2 is executed on its own the textboxes work fine you can
use your mouse to select a portion of the text and copy paste it
However if I run the Form2 in a panel in Form1 the functionality of
the textboxes is gone you can no longer use the mouse to select parts
of the text you can only souble click to select the whole contents of
the textbox.
this is the code I am using:
Code:
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Dim frmToDisplay As New Form2
frmToDisplay.TopLevel = False
Panel1.Controls.Clear()
Panel1.Controls.Add(frmToDisplay)
frmToDisplay.Show()
frmToDisplay.Activate()
End Sub
End Class
Does anyone know id this is a bug with VB 2005 or am I doing
something
wrong?
THANKS



我刚试过这个,它对我有用。我安装了SP1,是吗?

I just tried this and it works for me. I have SP1 installed, do you?


谢谢,是的,我做了,它没有用,你能试试我的项目吗?


这里是链接

http:// www。 motounlock.net/BigJohn/PanelTestWinForms.zip

但是你可以使用

鼠标转到文本框并选择部分文本吗?


THX

2月15日17:18,CodeMonkey< spamm ... @ suck.comwrote:
Hi thanks Yeah I do and it doesnt work could you try my project?

here is the link

http://www.motounlock.net/BigJohn/PanelTestWinForms.zip
But can you go to the textbox and select a part of the text using
mouse?

THX
On 15 Feb, 17:18, CodeMonkey <spamm...@suck.comwrote:

Brano写道:
Brano wrote:

您好我使用的是vb.net 2005这是一个Windows应用程序
Hi I am using vb.net 2005 this is a windows application


我在另一个项目中使用此功能我创建了这个

简单项目来显示问题
I am using this functionality in another project I have created this
simple project to show the problem


基本上我有两种形式:
Basically I have two forms:


Form1 - 包含一个面板(System.Windows.Forms.Panel)

Form2 - 包含两个文本框,其中包含一些示例文本
Form1 - contains a panel (System.Windows.Forms.Panel)
Form2 - contains two textboxes with some sample text in them


如果Form2自行执行,文本框工作正常,你可以使用鼠标选择文本的一部分并复制粘贴它
If the Form2 is executed on its own the textboxes work fine you can
use your mouse to select a portion of the text and copy paste it


但是如果我在Form1的面板中运行Form2,那么文本框的功能已经消失了你不能再使用鼠标了选择部分

的文字你只能点击选择

文本框的全部内容。
However if I run the Form2 in a panel in Form1 the functionality of
the textboxes is gone you can no longer use the mouse to select parts
of the text you can only souble click to select the whole contents of
the textbox.


这是我正在使用的代码:
this is the code I am using:


代码:
Code:


Public Class Form1
Public Class Form1


Private Sub Form1_Load(ByVal sender As System.Object,ByVal e As

System.EventArgs)处理MyBase.Load
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load


Dim frmToDisplay As New Form2
Dim frmToDisplay As New Form2


frmToDisplay.TopLevel = False

Panel1.Controls.Clear()

Panel1.Controls。添加(frmToDisplay)

frmToDisplay.Show()

frmToDisplay.Activate()
frmToDisplay.TopLevel = False
Panel1.Controls.Clear()
Panel1.Controls.Add(frmToDisplay)
frmToDisplay.Show()
frmToDisplay.Activate()


结束子

结束等级
End Sub
End Class


有谁知道id这是ab ug用VB 2005或我在做什么

什么

错了?
Does anyone know id this is a bug with VB 2005 or am I doing
something
wrong?


谢谢
THANKS



我刚试过这个,它对我有用。我安装了SP1,是吗? - 隐藏引用的文字 -


- 显示引用的文字 -


I just tried this and it works for me. I have SP1 installed, do you?- Hide quoted text -

- Show quoted text -



Brano写道:
Brano wrote:

谢谢,是的,我做了,它没有用,你能试试我的项目吗?


这里是链接

http://www.motounlock .net / BigJohn / PanelTestWinForms.zip


但是你可以转到文本框并使用

鼠标选择文本的一部分吗? br />

THX
Hi thanks Yeah I do and it doesnt work could you try my project?

here is the link

http://www.motounlock.net/BigJohn/PanelTestWinForms.zip
But can you go to the textbox and select a part of the text using
mouse?

THX



我下载了你的项目,它完全符合你的说法。我

无法选择文字。我打开了我的项目并验证它是否正常工作,但是我的项目并不像你的那样...我错误地使用了我们所有自定义组件的
。我们使用开发人员的组件

Express ......但这很有意思。我拿出一行代码来启用基于表单的皮肤,然后它才能正常工作。如果我重新输入该行

代码,即使使用默认的

上下文菜单,鼠标也能正常工作。


我不知道该告诉你什么。希望其他人可以使用

一些建议。


I downloaded your project and it does exactly what you say it does. I
cannot select text. I opened my project back up and verified it does
work correctly, however my project isn''t like yours... I mistakingly
used all of our custom components. We use components from Developer''s
Express... It''s interesting, though. I took out one line of code to
enable form based skins, and it doesn''t work right. If I put that line
of code back in, the mouse works correctly, even with the default
context menu.

I''m not sure what to tell you. Hopefully someone else will chime in with
some advice.


这篇关于文本框中的文本框加载到文本框上的Panlel鼠标选择不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆