Click here to Skip to main content
16,009,144 members
Home / Discussions / .NET (Core and Framework)
   

.NET (Core and Framework)

 
AnswerRe: Any commercial application written in .NET? Pin
rwestgraham3-Jun-05 10:29
rwestgraham3-Jun-05 10:29 
AnswerRe: Any commercial application written in .NET? Pin
Kareem Shaker4-Jun-05 23:54
Kareem Shaker4-Jun-05 23:54 
GeneralRe: Any commercial application written in .NET? Pin
Anonymous6-Jun-05 6:02
Anonymous6-Jun-05 6:02 
GeneralRe: Any commercial application written in .NET? Pin
Kareem Shaker6-Jun-05 20:21
Kareem Shaker6-Jun-05 20:21 
GeneralRe: Any commercial application written in .NET? Pin
Kareem Shaker6-Jun-05 20:22
Kareem Shaker6-Jun-05 20:22 
GeneralMicrosoft.Practices.EnterpriseLibrary Instrumentation errors Pin
bobbiek2-Jun-05 11:18
bobbiek2-Jun-05 11:18 
GeneralSmart phone Windows Application-Issues Pin
Sevugan2-Jun-05 3:26
Sevugan2-Jun-05 3:26 
GeneralOpen forms in a different way Pin
gaorellana2-Jun-05 3:03
gaorellana2-Jun-05 3:03 
I am trying to create a launcher form where I create dynamically several buttons, each of which holds in the Tag attribute,
the name of a form class (i.e. Form1, Form2,....)

After I have the buttons created and also a handler for each button wired to the buttons click event, I want to call the corresponding form and open it. I have a sub called "ActivateFormOnTheFly" from wich I can open those forms.

The problem I found is that I can't come with the right code to open the forms using the button's Tag attribute
The name of the form is available in sender.Tag() of "ActivateFormOnTheFly"

What snippet of code should I write there?

Thans in advance


Confused | :confused:
Private Sub Check4Forms()<br />
<br />
        Dim myFiles() As String<br />
        myFiles = Directory.GetFiles(Application.StartupPath & "\...\")<br />
<br />
        Dim FilePath, FileName, FileExt, File As String<br />
        Dim myPath(), myFile() As String<br />
<br />
        For Each FilePath In myFiles<br />
<br />
            myPath = FilePath.Split("\")<br />
            FileName = myPath(myPath.GetUpperBound(0))<br />
            myFile = FileName.Split(".")<br />
            FileExt = myFile(myFile.GetUpperBound(0))<br />
            File = myFile(myFile.GetLowerBound(0))<br />
<br />
            Dim FButton As New System.Windows.Forms.Button<br />
<br />
            If File.StartsWith("F") And FileExt = "vb" Then<br />
<br />
                FButton.Text = File<br />
                FButton.Tag = File<br />
                Me.Panel1.Controls.Add(FButton)<br />
                FButton.Dock = DockStyle.Top<br />
<br />
                AddHandler FButton.Click, New System.EventHandler(AddressOf Me.ActivateFormOnTheFly)<br />
<br />
            End If<br />
<br />
        Next<br />
<br />
    End Sub<br />
<br />
    Public Sub ActivateFormOnTheFly(ByVal sender As Object, ByVal e As EventArgs)<br />
<br />
    End Sub

GeneralRe: Open forms in a different way Pin
S. Senthil Kumar2-Jun-05 3:45
S. Senthil Kumar2-Jun-05 3:45 
GeneralToolbar inside Crystal report Viewer Pin
summer10061-Jun-05 21:35
summer10061-Jun-05 21:35 
Generaldifferently colored strings Pin
slirek1-Jun-05 20:55
slirek1-Jun-05 20:55 
GeneralRe: differently colored strings Pin
Christian Graus2-Jun-05 10:39
protectorChristian Graus2-Jun-05 10:39 
GeneralRe: differently colored strings Pin
John Arlen13-Jun-05 0:34
John Arlen13-Jun-05 0:34 
GeneralWindows Application Pin
mansir 1231-Jun-05 19:48
mansir 1231-Jun-05 19:48 
GeneralRe: Windows Application Pin
Colin Angus Mackay1-Jun-05 20:58
Colin Angus Mackay1-Jun-05 20:58 
GeneralRe: Windows Application Pin
mansir 1231-Jun-05 21:44
mansir 1231-Jun-05 21:44 
GeneralRe: Windows Application Pin
MoustafaS1-Jun-05 22:24
MoustafaS1-Jun-05 22:24 
GeneralRe: Windows Application Pin
Christian Graus2-Jun-05 10:40
protectorChristian Graus2-Jun-05 10:40 
GeneralRe: Windows Application Pin
toxcct1-Jun-05 23:10
toxcct1-Jun-05 23:10 
GeneralRe: Windows Application Pin
DavidNohejl2-Jun-05 1:13
DavidNohejl2-Jun-05 1:13 
GeneralUsing Events with an Asyncronous Remote Process Pin
markike091-Jun-05 4:23
markike091-Jun-05 4:23 
GeneralRe: Using Events with an Asyncronous Remote Process Pin
S. Senthil Kumar1-Jun-05 5:04
S. Senthil Kumar1-Jun-05 5:04 
GeneralRe: Using Events with an Asyncronous Remote Process Pin
markike091-Jun-05 6:00
markike091-Jun-05 6:00 
GeneralRe: Using Events with an Asyncronous Remote Process Pin
markike091-Jun-05 10:20
markike091-Jun-05 10:20 
GeneralRe: Using Events with an Asyncronous Remote Process Pin
S. Senthil Kumar2-Jun-05 1:32
S. Senthil Kumar2-Jun-05 1:32 

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.