Re: Winform inside a SplitContainer Funny Behaviour



Hello Linda,

Since all the textbox controls on our forms are usercontrol ( inheriting
textboxes to ensure that only numeric values are allowed)

so in the numerictextbox (userocntrol which is inheriting from textbox.) on
mouseclick event, following code was written


Private Sub NumericTextBox_MouseClick(ByVal sender As Object, ByVal e As
System.Windows.Forms.MouseEventArgs) Handles Me.MouseClick

Me.SelectionStart() = (e.Location.X) / 6

Me.SelectionLength = 0

End Sub

In the above code, if we used only e.location.x, the cursor was being placed
very far of from click point, so by hit and trial, got the e.location.x/6

Though it is working, but not very sure if this is the right way.

trust you could advise.

regards


"AnikSol" <anisol@xxxxxxxxxxxxxxxx> wrote in message
news:%23GjBTJF8GHA.4084@xxxxxxxxxxxxxxxxxxxxxxx
Hello Linda,

Tried with usercontrol, its ok.
If we create a usercontrol derived from the existing winforms, it just
behaves the way it was before - ie, the cursor can only be added at the
beginning of the text.

But to convert atleast 40 winforms into user controls and change the
coding etc, its going to be a gigantic efforts.
Secondly, my changing the whole application to an MDI also is causing a
few other headaches.

Is there any work around for this ?

regards

"Linda Liu [MSFT]" <v-lliu@xxxxxxxxxxxxxxxxxxxx> wrote in message
news:sOdvgkO7GHA.2336@xxxxxxxxxxxxxxxxxxxxxxxx
Hi AnikSol,

I performed a test based on your description and sample code. I did
reproduce the problem.

As what Stoitcho said, the split container is no more than two panels
docked and separated by a splitter. We could show a form in a Panel or
Group control as well. In this case, the form's behavior is just like
when
it is shown in a split container.

I think this behavior is by design. I recommend you to replace the form
with a user control. I mean you could show a user control in the split
container instead of a form. Then everything will be fine.

Hope this helps.
If you have anything unclear, please feel free to let me know.



Sincerely,
Linda Liu
Microsoft Online Community Support

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent
issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each
follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================

This posting is provided "AS IS" with no warranties, and confers no
rights.





.



Relevant Pages

  • RE: FindControl() on ASP.NET UserControl Objects
    ... STeven, when I look in the code-behind for the user control, despite the fact ... that the control is in a folder named "Controls", ... your ascx usercontrol put. ... Microsoft MSDN Online Support Lead ...
    (microsoft.public.dotnet.framework.aspnet)
  • RE: Overriding TEXTBOX controls vb.net
    ... and once i create the control which is from the ... textbox in the design time, say for example border i changed, theirafter this ... then use this custom control in your projects. ... Microsoft Online Community Support ...
    (microsoft.public.vsnet.general)
  • RE: Delegate for control embedded into MFC
    ... Control Library project and a UserControl in this project. ... Microsoft Online Community Support ... where an initial response from the community or a Microsoft Support ...
    (microsoft.public.dotnet.framework.windowsforms.controls)
  • Re: buy component dotnet
    ... - support to DataTable and DataView ... - very quick to manipulate low and huge datatables ... And someone wants to help me extend this control? ... > - edit a table using textbox, of combobox, image or other ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Usercontrol : how to intercept "Enter" (originally asked in windowsforms.controls group).
    ... I have a usercontrol, which contains a textbox. ... line in the multi-line textbox. ... I'm guessing I need to capture the enter key in the control before it gets ...
    (microsoft.public.dotnet.languages.vb)