Click here to Skip to main content
15,889,825 members
Home / Discussions / Visual Basic
   

Visual Basic

 
QuestionCould someone explain why For Each and For Next loops behave differently with lists? Pin
MattiasW768-Sep-18 14:13
MattiasW768-Sep-18 14:13 
AnswerRe: Could someone explain why For Each and For Next loops behave differently with lists? Pin
Eddy Vluggen8-Sep-18 23:51
professionalEddy Vluggen8-Sep-18 23:51 
QuestionRe: Could someone explain why For Each and For Next loops behave differently with lists? Pin
MattiasW769-Sep-18 1:04
MattiasW769-Sep-18 1:04 
AnswerRe: Could someone explain why For Each and For Next loops behave differently with lists? Pin
Eddy Vluggen9-Sep-18 2:11
professionalEddy Vluggen9-Sep-18 2:11 
GeneralRe: Could someone explain why For Each and For Next loops behave differently with lists? Pin
MattiasW7620-Sep-18 9:09
MattiasW7620-Sep-18 9:09 
AnswerRe: Could someone explain why For Each and For Next loops behave differently with lists? Pin
Dave Kreskowiak9-Sep-18 4:54
mveDave Kreskowiak9-Sep-18 4:54 
GeneralRe: Could someone explain why For Each and For Next loops behave differently with lists? Pin
MattiasW7627-Sep-18 2:59
MattiasW7627-Sep-18 2:59 
QuestionAdding Custom TabPage to TabControl: Closed Pin
mo14927-Sep-18 11:12
mo14927-Sep-18 11:12 
I don't know what happened to cause this issue. I recreated the project and
the problem went away.

Hello, I'm trying to figure out how to add a custom TabPage to a TabControl.
After searching around I found this sample code of a custom TabControl which supports
my custom XmlTabPage that works as far as adding the page through the Designer but for some reason I get errors after adding the control.

In my Form:
Private Sub InitializeComponent()
Me.CustomTabControl1 = New XmlEditor.CustomTabControl
Me.XmlDataTabPage = New XmlEditor.XmlTabPage
end sub
Friend WithEvents CustomTabControl1 As XmlEditor.CustomTabControl
Friend WithEvents XmlDataTabPage As XmlEditor.XmlTabPage

'The error is that these controls are not defined. ' for the code
New XmlEditor.CustomTabControl and New XmlEditor.XmlTabPage as well
as the Friend declarations.


This code is inserted by the Designer.
These controls are part of the main project.
I can add the prefix 'Global.'XmlEditor.CustomTabControl to both controls and it
works but the next time I use the Designer, it writes the old code.

Can someone help? Below is the partial CustomTabControl code.
Thank you.

Imports System.ComponentModel
Imports System.ComponentModel.Design
Imports System.drawing.Design
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Partial Class CustomTabControl
Inherits System.Windows.Forms.TabControl

<System.ComponentModel.Editor(GetType(TabPageCollectionEditor), GetType(UITypeEditor))> _
Public Shadows ReadOnly Property TabPages() As TabPageCollection
Get
Return MyBase.TabPages
End Get
End Property


'UserControl overrides dispose to clean up the component list.
<System.Diagnostics.DebuggerNonUserCode()> _
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
Try
If disposing AndAlso components IsNot Nothing Then
components.Dispose()
End If
Finally
MyBase.Dispose(disposing)
End Try
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.
<System.Diagnostics.DebuggerStepThrough()> _
Private Sub InitializeComponent()
components = New System.ComponentModel.Container()
End Sub

Public Class TabPageCollectionEditor
Inherits System.ComponentModel.Design.CollectionEditor

Public Sub New(ByVal type As Type)
MyBase.New(type)
End Sub

Protected Overrides Function CreateCollectionItemType() As System.Type
Return GetType(TabPage)
End Function

Protected Overrides Function CreateNewItemTypes() As System.Type()
Return New Type() {GetType(TabPage), GetType(XmlTabPage)}
End Function

End Class

End Class

-- modified 9-Sep-18 19:09pm.
QuestionHow to declare Crypto? Pin
Member 139535037-Sep-18 6:04
Member 139535037-Sep-18 6:04 
AnswerRe: How to declare Crypto? Pin
Richard Deeming7-Sep-18 7:46
mveRichard Deeming7-Sep-18 7:46 
GeneralRe: How to declare Crypto? Pin
Member 1395350314-Sep-18 3:19
Member 1395350314-Sep-18 3:19 
QuestionCurrency textbox Pin
Member 139744835-Sep-18 16:08
Member 139744835-Sep-18 16:08 
AnswerRe: Currency textbox Pin
Mycroft Holmes5-Sep-18 18:34
professionalMycroft Holmes5-Sep-18 18:34 
AnswerRe: Currency textbox Pin
dan!sh 5-Sep-18 19:56
professional dan!sh 5-Sep-18 19:56 
Questionwindows version in vb.net Pin
JR2123-Sep-18 0:20
JR2123-Sep-18 0:20 
AnswerRe: windows version in vb.net Pin
Eddy Vluggen3-Sep-18 1:45
professionalEddy Vluggen3-Sep-18 1:45 
AnswerRe: windows version in vb.net Pin
Dave Kreskowiak3-Sep-18 13:31
mveDave Kreskowiak3-Sep-18 13:31 
QuestionHow to multi Highlight text different 2 textbox in datagridview VB.net? Pin
CodieCalm2-Sep-18 22:26
CodieCalm2-Sep-18 22:26 
QuestionCount char in string? Pin
Member 1395409621-Aug-18 22:43
Member 1395409621-Aug-18 22:43 
AnswerRe: Count char in string? Pin
Jochen Arndt21-Aug-18 23:32
professionalJochen Arndt21-Aug-18 23:32 
GeneralRe: Count char in string? Pin
Chris Quinn22-Aug-18 4:23
Chris Quinn22-Aug-18 4:23 
GeneralRe: Count char in string? Pin
Jochen Arndt22-Aug-18 5:08
professionalJochen Arndt22-Aug-18 5:08 
GeneralRe: Count char in string? Pin
Richard Deeming22-Aug-18 8:58
mveRichard Deeming22-Aug-18 8:58 
GeneralRe: Count char in string? Pin
Chris Quinn22-Aug-18 20:55
Chris Quinn22-Aug-18 20:55 
GeneralRe: Count char in string? Pin
Jochen Arndt22-Aug-18 21:16
professionalJochen Arndt22-Aug-18 21:16 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.