Click here to Skip to main content
15,925,309 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Send Email Pin
Dave Kreskowiak12-Jul-06 2:19
mveDave Kreskowiak12-Jul-06 2:19 
QuestionError conexion with vbNet 2005 but not with others Pin
Serpiente11-Jul-06 15:15
Serpiente11-Jul-06 15:15 
AnswerRe: Error conexion with vbNet 2005 but not with others Pin
Dave Kreskowiak11-Jul-06 16:50
mveDave Kreskowiak11-Jul-06 16:50 
GeneralRe: Error conexion with vbNet 2005 but not with others Pin
Serpiente13-Jul-06 6:35
Serpiente13-Jul-06 6:35 
GeneralRe: Error conexion with vbNet 2005 but not with others Pin
Dave Kreskowiak13-Jul-06 12:22
mveDave Kreskowiak13-Jul-06 12:22 
GeneralRe: Error conexion with vbNet 2005 but not with others Pin
Serpiente13-Jul-06 15:01
Serpiente13-Jul-06 15:01 
QuestionVB6 code for cascading menu Pin
Dodzki11-Jul-06 14:27
Dodzki11-Jul-06 14:27 
QuestionAdding events to dynamically-created controls [modified] Pin
Joshua Boyle11-Jul-06 11:40
Joshua Boyle11-Jul-06 11:40 
Hey, everybody.

I have a panel within a user control that I need to add link labels to. During runtime, the user selects an item from a combo box and based on which item is selected a list of filenames is returned from a database which are then respectively and dynamically made into link labels and added to the panel.

My problem is that I'm new to VB as a whole and I'm ignorant as to how one can add events to dynamically-created controls. In this instance, I would need to know when one of the link labels is clicked and which one was clicked.

Below is the code I have currently which works correctly to populate the panel with the link labels. Any help would be greatly appreciated. Thank you!

If (strSourcePath.Contains(",")) Then
    strFilePaths = strSourcePath.Split(",")
    nNumFiles = strFilePaths.Length

    ReDim xLinkList(nNumFiles)
    Dim nCount As Integer
    For nCount = 0 To nNumFiles - 1
        strFileNames = strFilePaths(nCount).Split("\")
        xLinkList(nCount) = New LinkLabel()
        xLinkList(nCount).Name = "lnkLabel" & nCount
        xLinkList(nCount).Text = strFileNames(4)
    Next
Else
    nNumFiles = 1
    If (System.IO.File.Exists(strSourcePath)) Then
        strFileNames = strSourcePath.Split("\")
        xLinkList(0) = New LinkLabel
        xLinkList(0).Name = "lnkLabel"
        xLinkList(0).Text = strFileNames(4)
    End If
End If

panFiles.Controls.AddRange(xLinkList)
Dim i As Integer
For i = 0 To nNumFiles - 1
    panFiles.Controls.Item(i).Dock = DockStyle.Top
Next


-- modified at 17:40 Tuesday 11th July, 2006
AnswerRe: Adding events to dynamically-created controls [modified] Pin
Ray Cassick11-Jul-06 11:55
Ray Cassick11-Jul-06 11:55 
GeneralRe: Adding events to dynamically-created controls [modified] Pin
Joshua Boyle12-Jul-06 3:40
Joshua Boyle12-Jul-06 3:40 
GeneralRe: Adding events to dynamically-created controls Pin
Ray Cassick12-Jul-06 7:51
Ray Cassick12-Jul-06 7:51 
QuestionHow to Deploy my Vb.net 2005 application on server ? [modified] Pin
hemrk11-Jul-06 11:19
hemrk11-Jul-06 11:19 
AnswerRe: How to Deploy my Vb.net 2005 application on server ? Pin
Gavin Jeffrey11-Jul-06 14:13
Gavin Jeffrey11-Jul-06 14:13 
GeneralRe: How to Deploy my Vb.net 2005 application on server ? Pin
hemrk12-Jul-06 3:03
hemrk12-Jul-06 3:03 
AnswerRe: How to Deploy my Vb.net 2005 application on server ? Pin
Dave Kreskowiak11-Jul-06 16:46
mveDave Kreskowiak11-Jul-06 16:46 
GeneralRe: How to Deploy my Vb.net 2005 application on server ? Pin
hemrk12-Jul-06 3:12
hemrk12-Jul-06 3:12 
GeneralRe: How to Deploy my Vb.net 2005 application on server ? [modified] Pin
Dave Kreskowiak12-Jul-06 6:34
mveDave Kreskowiak12-Jul-06 6:34 
GeneralRe: How to Deploy my Vb.net 2005 application on server ? Pin
hemrk12-Jul-06 7:27
hemrk12-Jul-06 7:27 
GeneralRe: How to Deploy my Vb.net 2005 application on server ? Pin
hemrk12-Jul-06 7:49
hemrk12-Jul-06 7:49 
GeneralRe: How to Deploy my Vb.net 2005 application on server ? Pin
Dave Kreskowiak12-Jul-06 8:17
mveDave Kreskowiak12-Jul-06 8:17 
GeneralRe: How to Deploy my Vb.net 2005 application on server ? Pin
hemrk13-Jul-06 10:09
hemrk13-Jul-06 10:09 
QuestionConditional Installer of Desktop Shortcut using VB.NET Pin
Yojimbojinn11-Jul-06 8:07
Yojimbojinn11-Jul-06 8:07 
AnswerRe: Conditional Installer of Desktop Shortcut using VB.NET Pin
Dave Sexton11-Jul-06 20:43
Dave Sexton11-Jul-06 20:43 
GeneralRe: Conditional Installer of Desktop Shortcut using VB.NET Pin
Yojimbojinn12-Jul-06 1:14
Yojimbojinn12-Jul-06 1:14 
QuestionBUG? '' Pin
Len Miller11-Jul-06 6:47
Len Miller11-Jul-06 6:47 

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.