473,398 Members | 2,393 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

Textbox in a from that is loaded into a Panlel Mouse select on txtbox not working

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

Feb 15 '07 #1
12 2128
Brano wrote:
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
I just tried this and it works for me. I have SP1 installed, do you?
Feb 15 '07 #2
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 wrote:
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

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

- Show quoted text -

Feb 15 '07 #3
Brano wrote:
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

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.
Feb 15 '07 #4
"Brano" <bp****@gmail.comschrieb
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?
Form's inside other Forms is not supported, unless it's an MDI
application. Use Usercontrols instead.
Armin

Feb 16 '07 #5
Hi it is an MDI application the isMDIContainer property of the parent
form is set to true and I have even tried this

frmToDisplay.Parent = Me

Is there something I am missing to make it an MDI application?

Feb 19 '07 #6
Hi it is an MDI application the isMDIContainer property of the parent
form is set to true and I have even tried this

frmToDisplay.Parent = Me

Is there something I am missing to make it an MDI application?2005
this is a windows application

Feb 19 '07 #7
"Brano" <bp****@gmail.comschrieb
Hi it is an MDI application the isMDIContainer property of the
parent form is set to true and I have even tried this

frmToDisplay.Parent = Me

Is there something I am missing to make it an MDI application?2005
this is a windows application
Replace by:
frmToDisplay.MdiParent = Me

No need to change TopLevel property.
Armin

Feb 19 '07 #8
Yes if I do that there is no need to change the TopLevel property but
it still doesn't work you still cant select the contents of the
textbox by mouse.
On 19 Feb, 10:48, "Armin Zingler" <az.nos...@freenet.dewrote:
"Brano" <bpa...@gmail.comschrieb
Hi it is an MDI application the isMDIContainer property of the
parent form is set to true and I have even tried this
frmToDisplay.Parent = Me
Is there something I am missing to make it an MDI application?2005
this is a windows application

Replace by:
frmToDisplay.MdiParent = Me

No need to change TopLevel property.

Armin

Feb 22 '07 #9
"Brano" <bp****@gmail.comschrieb
Yes if I do that there is no need to change the TopLevel property
but it still doesn't work you still cant select the contents of the
textbox by mouse.
Because you wrote "frmToDisplay.parent = me" I assumed that you do not
execute "Panel1.Controls.Add(frmToDisplay)" anymore, because both at one
time doesn't make sense. But I guess you still try to put it into a panel in
the MDI container. You mustn't do this. The MDI Form must be put in the MDI
containers client area (by setting the MDIparent property).
Armin

Feb 22 '07 #10
Hi,

thanks for your help but I think you have misunderstood what I am
trying to do here.

The way you suggests it works and the textboxes are selectable (if I
use only MDIcontainer and make the form2 chid of it) but this isn't
what I was after at all

I need to use the panel control because I have in my main application
a treeview that I am using for navigation thru the application (this
is not included in this sample application)

So regardles of the MDI my problem is that once the form is added to
the panel using this statements:

Panel1.Controls.Add(frmToDisplay)

The textboxes on the form are no longer selectable by mouse.

I understand your point about the MDI forms but this is not what I am
after as I need to use the fuctionality of the panel...
Feb 22 '07 #11
"Brano" <bp****@gmail.comschrieb
Hi,

thanks for your help but I think you have misunderstood what I am
trying to do here.

The way you suggests it works and the textboxes are selectable (if I
use only MDIcontainer and make the form2 chid of it) but this isn't
what I was after at all

I need to use the panel control because I have in my main
application a treeview that I am using for navigation thru the
application (this is not included in this sample application)

So regardles of the MDI my problem is that once the form is added to
the panel using this statements:

Panel1.Controls.Add(frmToDisplay)

The textboxes on the form are no longer selectable by mouse.

I understand your point about the MDI forms but this is not what I
am after as I need to use the fuctionality of the panel...
I did undestand what you are trying, but I was trying to tell you that you
can not put Forms inside other Forms unless it's an MDI child form inside a
MDI container. I meant directly inside as a MDI child. If you put the Form
into a panel, it's not an MDI child anymore. As you see now, your approach
creates side effects because this is not supported.
Armin

Feb 22 '07 #12
So you are saying that putting a form into a panel is not supported? I
think this is a bug in visual studio more than anything because you
either should not be able to do it at all or it should work without
side effects (bugz) anyone from MS to comment on this?

Feb 23 '07 #13

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: David Gray | last post by:
Greetings all, I'm working on a program that allows a user to enter notes in a multiline textbox. I would like to be able to read the contents of the textbox (as records - one per line) and...
7
by: joey.powell | last post by:
I have a home page with username and password textboxes and a login button for purposes of users being able to log in (forms authentication) directly on the site home page. I also have a dedicated...
0
by: Eric Diana | last post by:
Hello, Im trying to create a dynamic array of textboxes from an array returned by a web service. THe web service returns a list of fields that I need to place on a dynamically created web page....
3
by: Joey | last post by:
I have a javascript piece that sets focus to a textbox on one of my webforms. The script works fine for IE: it sets the cursor blinking in the textbox. In Firefox, however, it doesn't work at all....
2
by: Paul | last post by:
Hello: I create a textbox control programatically something like this: Dim td As New TableCell() Dim txtbox As New TextBox() txtbox.ID = "my_textbox" td.Controls.Add(txtbox) Now I want to...
9
by: davidr | last post by:
Hi, I've researched this a lot and have a well understanding but still can't get the darn textbox in the javascript. I have a textbox that is set to runat="server" and I have a client...
8
by: Filipe Marcelino | last post by:
Hi, I'm trying to create a textbox inheriting from the standard textbox. I would like to: 1. repaint the textbox border; 2. define a color for that border; Till now I made this:
6
by: Morten Snedker | last post by:
Im trying to set value of a textbox, but it fails. txtBox.Text = obj.Effekt does nothing on the page, but the last one does. Fieldname is positively correct. What am I doing wrong? Dim...
2
by: mylog | last post by:
Hi all, I am having a small problem on getting the values of the dynamically generated textboxes in C# windows application. I have successfully read an xml file and put its key and value fields as...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.