Masked Edit COM control appears only on first tab page of tab control in VB.NET 
Author Message
 Masked Edit COM control appears only on first tab page of tab control in VB.NET

Working on a Windows Component in VB.NET, I have VB 6 masked edit boxes (COM
or active X control) on all three tab pages of a tab control.  Running a
test Windows Form project with my component, the masked edit boxes appear on
the first tab page but not on the second and third tab pages.  I've tried
bringing the masked edits to the front, and cutting and pasting outside the
groupboxes, but the only thing that works is pasting on the first tab page
or on the UserControl itself.

Again, the masked edit control always appears on the first tab page, and
just in case, yes, the masked edits are
enabled and visible.  All properties are the same for the masked edits on
all three tab pages except for the mask property.  Also, when the tab page's
autoscroll is set to true, scrollbars appear as if the control is off the
tab page, but the masked edit control cannot be seen.

Is this a VB.NET bug when using an older COM control?

Ken Klausner



Wed, 19 Jan 2005 03:02:33 GMT  
 Masked Edit COM control appears only on first tab page of tab control in VB.NET
Here is the VB.NET generated code from the form hosting the usercontrol with
a NET tabcontrol that includes a masked edit COM control:

Public Class Form1

Inherits System.Windows.Forms.Form

#Region " Windows Form Designer generated code "

Public Sub New()

MyBase.New()

'This call is required by the Windows Form Designer.

InitializeComponent()

'Add any initialization after the InitializeComponent() call

End Sub

'Form overrides dispose to clean up the component list.

Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)

If disposing Then

If Not (components Is Nothing) Then

components.Dispose()

End If

End If

MyBase.Dispose(disposing)

End Sub

'Required by the Windows Form Designer

Private components As System.ComponentModel.IContainer

'NOTE: The following procedure is required by the Windows Form Designer

'It can be modified using the Windows Form Designer.

'Do not modify it using the code editor.

Friend WithEvents UserControl11 As TabTest.UserControl1

<System.Diagnostics.De{*filter*}StepThrough()> Private Sub InitializeComponent()

Me.UserControl11 = New TabTest.UserControl1()

Me.SuspendLayout()

'UserControl11

'

Me.UserControl11.Location = New System.Drawing.Point(8, 8)

Me.UserControl11.Name = "UserControl11"

Me.UserControl11.Size = New System.Drawing.Size(552, 488)

Me.UserControl11.TabIndex = 0

'

'Form1

'

Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)

Me.ClientSize = New System.Drawing.Size(768, 597)

Me.Controls.AddRange(New System.Windows.Forms.Control() {Me.UserControl11})

Me.Name = "Form1"

Me.Text = "Form1"

Me.ResumeLayout(False)

End Sub

#End Region

End Class

Here is the code from the VB.NET generated code in the usercontrol hosting
the masked edit COM control:

Public Class UserControl1

Inherits System.Windows.Forms.UserControl

#Region " Windows Form Designer generated code "

Public Sub New()

MyBase.New()

'This call is required by the Windows Form Designer.

InitializeComponent()

'Add any initialization after the InitializeComponent() call

End Sub

'UserControl1 overrides dispose to clean up the component list.

Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)

If disposing Then

If Not (components Is Nothing) Then

components.Dispose()

End If

End If

MyBase.Dispose(disposing)

End Sub

'Required by the Windows Form Designer

Private components As System.ComponentModel.IContainer

'NOTE: The following procedure is required by the Windows Form Designer

'It can be modified using the Windows Form Designer.

'Do not modify it using the code editor.

Friend WithEvents TabPage1 As System.Windows.Forms.TabPage

Friend WithEvents TabPage2 As System.Windows.Forms.TabPage

Friend WithEvents TabPage3 As System.Windows.Forms.TabPage

Friend WithEvents TabPage4 As System.Windows.Forms.TabPage

Friend WithEvents TabControl1 As System.Windows.Forms.TabControl

Friend WithEvents AxMaskEdBox1 As AxMSMask.AxMaskEdBox

Friend WithEvents AxMaskEdBox3 As AxMSMask.AxMaskEdBox

Friend WithEvents AxMaskEdBox4 As AxMSMask.AxMaskEdBox

Friend WithEvents AxMaskEdBox5 As AxMSMask.AxMaskEdBox

<System.Diagnostics.De{*filter*}StepThrough()> Private Sub InitializeComponent()

Dim resources As System.Resources.ResourceManager = New
System.Resources.ResourceManager(GetType(UserControl1))

Me.TabPage1 = New System.Windows.Forms.TabPage()

Me.AxMaskEdBox5 = New AxMSMask.AxMaskEdBox()

Me.TabPage2 = New System.Windows.Forms.TabPage()

Me.AxMaskEdBox4 = New AxMSMask.AxMaskEdBox()

Me.TabPage3 = New System.Windows.Forms.TabPage()

Me.AxMaskEdBox3 = New AxMSMask.AxMaskEdBox()

Me.TabPage4 = New System.Windows.Forms.TabPage()

Me.AxMaskEdBox1 = New AxMSMask.AxMaskEdBox()

Me.TabControl1 = New System.Windows.Forms.TabControl()

Me.TabPage1.SuspendLayout()

CType(Me.AxMaskEdBox5, System.ComponentModel.ISupportInitialize).BeginInit()

Me.TabPage2.SuspendLayout()

CType(Me.AxMaskEdBox4, System.ComponentModel.ISupportInitialize).BeginInit()

Me.TabPage3.SuspendLayout()

CType(Me.AxMaskEdBox3, System.ComponentModel.ISupportInitialize).BeginInit()

Me.TabPage4.SuspendLayout()

CType(Me.AxMaskEdBox1, System.ComponentModel.ISupportInitialize).BeginInit()

Me.TabControl1.SuspendLayout()

Me.SuspendLayout()

'

'TabPage1

'

Me.TabPage1.Controls.AddRange(New System.Windows.Forms.Control()
{Me.AxMaskEdBox5})

Me.TabPage1.Location = New System.Drawing.Point(4, 22)

Me.TabPage1.Name = "TabPage1"

Me.TabPage1.Size = New System.Drawing.Size(520, 430)

Me.TabPage1.TabIndex = 0

Me.TabPage1.Text = "TabPage1"

'

'AxMaskEdBox5

'

Me.AxMaskEdBox5.ContainingControl = Me

Me.AxMaskEdBox5.Location = New System.Drawing.Point(208, 168)

Me.AxMaskEdBox5.Name = "AxMaskEdBox5"

Me.AxMaskEdBox5.OcxState =
CType(resources.GetObject("AxMaskEdBox5.OcxState"),
System.Windows.Forms.AxHost.State)

Me.AxMaskEdBox5.TabIndex = 0

'

'TabPage2

'

Me.TabPage2.Controls.AddRange(New System.Windows.Forms.Control()
{Me.AxMaskEdBox4})

Me.TabPage2.Location = New System.Drawing.Point(4, 22)

Me.TabPage2.Name = "TabPage2"

Me.TabPage2.Size = New System.Drawing.Size(520, 430)

Me.TabPage2.TabIndex = 1

Me.TabPage2.Text = "TabPage2"

'

'AxMaskEdBox4

'

Me.AxMaskEdBox4.ContainingControl = Me

Me.AxMaskEdBox4.Location = New System.Drawing.Point(224, 184)

Me.AxMaskEdBox4.Name = "AxMaskEdBox4"

Me.AxMaskEdBox4.OcxState =
CType(resources.GetObject("AxMaskEdBox4.OcxState"),
System.Windows.Forms.AxHost.State)

Me.AxMaskEdBox4.TabIndex = 1

'

'TabPage3

'

Me.TabPage3.Controls.AddRange(New System.Windows.Forms.Control()
{Me.AxMaskEdBox3})

Me.TabPage3.Location = New System.Drawing.Point(4, 22)

Me.TabPage3.Name = "TabPage3"

Me.TabPage3.Size = New System.Drawing.Size(520, 430)

Me.TabPage3.TabIndex = 2

Me.TabPage3.Text = "TabPage3"

'

'AxMaskEdBox3

'

Me.AxMaskEdBox3.ContainingControl = Me

Me.AxMaskEdBox3.Location = New System.Drawing.Point(208, 168)

Me.AxMaskEdBox3.Name = "AxMaskEdBox3"

Me.AxMaskEdBox3.OcxState =
CType(resources.GetObject("AxMaskEdBox3.OcxState"),
System.Windows.Forms.AxHost.State)

Me.AxMaskEdBox3.TabIndex = 0

'

'TabPage4

'

Me.TabPage4.Controls.AddRange(New System.Windows.Forms.Control()
{Me.AxMaskEdBox1})

Me.TabPage4.Location = New System.Drawing.Point(4, 22)

Me.TabPage4.Name = "TabPage4"

Me.TabPage4.Size = New System.Drawing.Size(520, 430)

Me.TabPage4.TabIndex = 3

Me.TabPage4.Text = "TabPage4"

'

'AxMaskEdBox1

'

Me.AxMaskEdBox1.ContainingControl = Me

Me.AxMaskEdBox1.Location = New System.Drawing.Point(256, 192)

Me.AxMaskEdBox1.Name = "AxMaskEdBox1"

Me.AxMaskEdBox1.OcxState =
CType(resources.GetObject("AxMaskEdBox1.OcxState"),
System.Windows.Forms.AxHost.State)

Me.AxMaskEdBox1.TabIndex = 0

'

'TabControl1

'

Me.TabControl1.Controls.AddRange(New System.Windows.Forms.Control()
{Me.TabPage1, Me.TabPage2, Me.TabPage3, Me.TabPage4})

Me.TabControl1.ItemSize = New System.Drawing.Size(62, 18)

Me.TabControl1.Location = New System.Drawing.Point(8, 16)

Me.TabControl1.Name = "TabControl1"

Me.TabControl1.SelectedIndex = 0

Me.TabControl1.Size = New System.Drawing.Size(528, 456)

Me.TabControl1.TabIndex = 0

'

'UserControl1

'

Me.Controls.AddRange(New System.Windows.Forms.Control() {Me.TabControl1})

Me.Name = "UserControl1"

Me.Size = New System.Drawing.Size(552, 488)

Me.TabPage1.ResumeLayout(False)

CType(Me.AxMaskEdBox5, System.ComponentModel.ISupportInitialize).EndInit()

Me.TabPage2.ResumeLayout(False)

CType(Me.AxMaskEdBox4, System.ComponentModel.ISupportInitialize).EndInit()

Me.TabPage3.ResumeLayout(False)

CType(Me.AxMaskEdBox3, System.ComponentModel.ISupportInitialize).EndInit()

Me.TabPage4.ResumeLayout(False)

CType(Me.AxMaskEdBox1, System.ComponentModel.ISupportInitialize).EndInit()

Me.TabControl1.ResumeLayout(False)

Me.ResumeLayout(False)

End Sub

#End Region

End Class



Quote:
> Expand the text in the generated region of your form and send that this
way.
> I think we'll be able to help you from that.

> Thanks!
> Amanda and Chris
> VB .NET Team

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



> > This newsgroup rejects messages with inline pictures and any attachments
> > otherwise I would post the complete project folder.  I sent the project
as
> > an attachment to you by regular email, and you wrote back that I should
> post
> > it in the newsgroup, which is impossible.

> > Ken Klausner



> > > Hey Ken --

> > > We tried to repro this but didn't get the same behavior.  If you could
> > > attach a form that demonstrates the problem and include the version of
> the
> > > ActiveX control we'll try to help you out.

> > > Thanks,
> > > Amanda, Steve, and Todd
> > > VB .NET

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



> > > > Working on a Windows Component in VB.NET, I have VB 6 masked edit
> boxes
> > > (COM
> > > > or active X control) on all three tab pages of a tab control.
Running
> a
> > > > test Windows Form project with my component, the masked edit boxes
> > appear
> > > on
> > > > the first tab page but not on the second and third tab pages.  I've
> > tried
> > > > bringing the masked edits to the front, and cutting and pasting
> outside
> > > the
> > > > groupboxes, but the only thing that works is pasting on the first
tab
> > page
> > > > or on the UserControl itself.

> > > > Again, the masked edit control always appears on the first tab page,
> and
> > > > just in case, yes, the masked edits are
> > > > enabled and visible.  All properties are the same for the masked
edits
> > on
> > > > all three tab

...

read more »



Wed, 26 Jan 2005 11:52:42 GMT  
 Masked Edit COM control appears only on first tab page of tab control in VB.NET
Hi, Ken

I was able to reproduce the problem.  I was also able to get it to happen
using another MFC control, so it isn't just the masked edit control.

It may take awhile to figure this out, so I will get back to you when we
know more.  Can I reach you at your posting email, or is there a better one?

Thanks for catching this one,,

John Eikanger
Microsoft Visual Basic Team

This posting is provided AS IS with no warranties, and confers no rights.
(c) 2002 Microsoft Corporation.  All rights reserved.
--------------------

| Newsgroups: microsoft.public.dotnet.languages.vb



| Subject: Re: Masked Edit COM control appears only on first tab page of
tab control in VB.NET
| Lines: 503
| X-Tomcat-NG: microsoft.public.dotnet.languages.vb



Sat, 29 Jan 2005 06:53:03 GMT  
 Masked Edit COM control appears only on first tab page of tab control in VB.NET

Yes, you can reach me at my newsgoup posting email address:


Thanks for trying to resolve this problem so quickly.

Ken Klausner

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!



Sat, 29 Jan 2005 07:15:09 GMT  
 Masked Edit COM control appears only on first tab page of tab control in VB.NET
Ken and I are corresponding offline for more rapid turn around.  To work
around the problem we are currently looking at customizing a textbox
control to provide the functionality from the maskededit control that he
needs.  For special key handling we are using the techniques described in
Knowledge Base article Q320583:  HOW TO: Trap Keystrokes in .NET Controls
Using Visual Basic .NET?  Here is a link:

http://support.microsoft.com/default.aspx?scid=kb;[LN];Q320583

Please stay tuned.

John Eikanger
Microsoft Visual Basic Team

This posting is provided AS IS with no warranties, and confers no rights.
(c) 2002 Microsoft Corporation.  All rights reserved.

--------------------


| X-Newsreader: AspNNTP 1.50 (ActionJackson.com)
| Subject: Re: Masked Edit COM control appears only on first tab page of
tab control in VB.NET
| Mime-Version: 1.0
| Content-Type: text/plain; charset="us-ascii"
| Content-Transfer-Encoding: 7bit

| Newsgroups: microsoft.public.dotnet.languages.vb
| Date: Mon, 12 Aug 2002 16:15:09 -0700
| NNTP-Posting-Host: 216.17.146.37
| Lines: 1        
| Path: cpmsftngxa10!tkmsftngp01!tkmsftngp08
| Xref: cpmsftngxa10 microsoft.public.dotnet.languages.vb:59936
| X-Tomcat-NG: microsoft.public.dotnet.languages.vb
|
|
|
| Yes, you can reach me at my newsgoup posting email address:
|

|
| Thanks for trying to resolve this problem so quickly.
|
| Ken Klausner
|
| *** Sent via Developersdex http://www.developersdex.com ***
| Don't just participate in USENET...get rewarded for it!
|



Tue, 01 Feb 2005 00:07:03 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. Tab control in VB dot net shuffling his tabs

2. SSTab Control problem-vb 4.0 (controls doesnt appear except on one tab )

3. hidden controls on vb.net tab page

4. How to select Tab Control tab page programmatically?

5. Tabbing through controls on a tab control

6. tab control - loading controls onto tabs in runtime

7. Tab control & Control on a tab

8. How to set the current tab in Tab control of MS COMMON CONTROL

9. Special Tab Control similar to tab control in MS outlook

10. BUG?: Tab Order on a Tab Control in VB

11. Putting a treeview control on a Tab control page

12. tabbed page control for vb

 

 
Powered by phpBB® Forum Software