Click here to Skip to main content
15,913,669 members
Home / Discussions / .NET (Core and Framework)
   

.NET (Core and Framework)

 
QuestionDataTable in .Net Pin
dews turner20-Aug-11 3:12
dews turner20-Aug-11 3:12 
AnswerRe: DataTable in .Net Pin
Simon Bang Terkildsen20-Aug-11 3:50
Simon Bang Terkildsen20-Aug-11 3:50 
AnswerRe: DataTable in .Net Pin
PIEBALDconsult20-Aug-11 6:29
mvePIEBALDconsult20-Aug-11 6:29 
GeneralRe: DataTable in .Net Pin
Simon Bang Terkildsen21-Aug-11 13:07
Simon Bang Terkildsen21-Aug-11 13:07 
GeneralRe: DataTable in .Net Pin
PIEBALDconsult21-Aug-11 14:59
mvePIEBALDconsult21-Aug-11 14:59 
GeneralRe: DataTable in .Net Pin
Bert Mitton3-Sep-11 6:56
professionalBert Mitton3-Sep-11 6:56 
QuestionEvent handling Pin
Pankaj Patel yosa20-Aug-11 2:40
Pankaj Patel yosa20-Aug-11 2:40 
AnswerRe: Event handling Pin
MicroVirus20-Aug-11 3:33
MicroVirus20-Aug-11 3:33 
You are mixing different ways of event handling here.
To avoid confusion, now and later on, remove the MaxTab variable altogether, use AddHandler to register for events, and do not use the Handles statement.

So:
VB
Public Class Form1
    Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        Dim TabCtrl As DevExpress.XtraTab.XtraTabControl

        ''dataentry
        TabCtrl = New DevExpress.XtraTab.XtraTabControl
        TabCtrl.Name = "tabd"
        TabCtrl.Top = 1
        TabCtrl.Size = New System.Drawing.Size(Me.Width - 15, Me.Height - 80)
        TabCtrl.TabPages.Add("dTAB1")
        TabCtrl.TabPages.Add("dTAB2")

        AddHandler TabCtrl.Click, AddressOf MaxTab_Click
        Me.Controls.Add(TabCtrl)

        ''Report
        TabCtrl = New DevExpress.XtraTab.XtraTabControl
        TabCtrl.Name = "tabr"
        TabCtrl.Top = 1
        TabCtrl.Size = New System.Drawing.Size(Me.Width - 15, Me.Height - 80)
        TabCtrl.TabPages.Add("rTAB1")
        TabCtrl.TabPages.Add("rTAB2")
        AddHandler TabCtrl.Click, AddressOf MaxTab_Click
        Me.Controls.Add(TabCtrl)

        Me.Controls("tabr").Visible = False

    End Sub

    Private Sub MaxTab_Click(ByVal sender As Object, ByVal e As System.EventArgs)
        Dim ClickedTab As DevExpress.XtraTab.XtraTabControl = sender
        MessageBox.Show(ClickedTab.SelectedTabPage.Text)
    End Sub
End Class


If you need to be able to easily access the tabs later on, create a list/collection variable at class-level instead and add each new tab control to the list.
I.e. add:
VB
'After Public Class Form1:
Friend TabControls As List(Of XtraTabControl) = New List(Of XtraTabControl)

'After you created a new tab:
TabControls.Add(TabCtrl)

Questiongadgets for desktop Pin
vannie1819-Aug-11 3:53
vannie1819-Aug-11 3:53 
AnswerRe: gadgets for desktop Pin
DaveAuld20-Aug-11 7:03
professionalDaveAuld20-Aug-11 7:03 
GeneralRe: gadgets for desktop Pin
vannie1820-Aug-11 15:01
vannie1820-Aug-11 15:01 
Questionsearch using textbox and listview in vb.net Pin
atzdgreat19-Aug-11 3:23
atzdgreat19-Aug-11 3:23 
AnswerRe: search using textbox and listview in vb.net Pin
Dave Kreskowiak19-Aug-11 4:53
mveDave Kreskowiak19-Aug-11 4:53 
QuestionString compare oddity [modified] Pin
PIEBALDconsult18-Aug-11 15:21
mvePIEBALDconsult18-Aug-11 15:21 
AnswerRe: String compare oddity Pin
Navin Pandit18-Aug-11 19:02
Navin Pandit18-Aug-11 19:02 
GeneralRe: String compare oddity Pin
PIEBALDconsult19-Aug-11 2:42
mvePIEBALDconsult19-Aug-11 2:42 
AnswerRe: String compare oddity Pin
Shameel19-Aug-11 4:41
professionalShameel19-Aug-11 4:41 
GeneralRe: String compare oddity Pin
PIEBALDconsult19-Aug-11 5:24
mvePIEBALDconsult19-Aug-11 5:24 
GeneralRe: String compare oddity Pin
Shameel19-Aug-11 5:33
professionalShameel19-Aug-11 5:33 
GeneralRe: String compare oddity Pin
PIEBALDconsult19-Aug-11 5:45
mvePIEBALDconsult19-Aug-11 5:45 
GeneralRe: String compare oddity Pin
Shameel19-Aug-11 5:57
professionalShameel19-Aug-11 5:57 
GeneralRe: String compare oddity [modified] Pin
PIEBALDconsult19-Aug-11 6:05
mvePIEBALDconsult19-Aug-11 6:05 
GeneralRe: String compare oddity Pin
Shameel19-Aug-11 9:32
professionalShameel19-Aug-11 9:32 
GeneralRe: String compare oddity Pin
PIEBALDconsult19-Aug-11 9:58
mvePIEBALDconsult19-Aug-11 9:58 
GeneralRe: String compare oddity Pin
Shameel20-Aug-11 8:28
professionalShameel20-Aug-11 8:28 

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.