Click here to Skip to main content
15,560,618 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: VB ComboBoxes Pin
M-Hall21-Feb-07 10:38
M-Hall21-Feb-07 10:38 
GeneralRe: VB ComboBoxes Pin
soule21-Feb-07 11:09
soule21-Feb-07 11:09 
GeneralRe: VB ComboBoxes Pin
M-Hall21-Feb-07 11:12
M-Hall21-Feb-07 11:12 
QuestionDynamic Controls requires Dynamic event handling? [modified] Pin
Björn T.J.M. Spruit21-Feb-07 6:33
Björn T.J.M. Spruit21-Feb-07 6:33 
AnswerRe: Dynamic Controls requires Dynamic event handling? Pin
M-Hall21-Feb-07 7:48
M-Hall21-Feb-07 7:48 
GeneralRe: Dynamic Controls requires Dynamic event handling? Pin
Björn T.J.M. Spruit21-Feb-07 8:27
Björn T.J.M. Spruit21-Feb-07 8:27 
GeneralRe: Dynamic Controls requires Dynamic event handling? Pin
TwoFaced21-Feb-07 8:48
TwoFaced21-Feb-07 8:48 
GeneralRe: Dynamic Controls requires Dynamic event handling? Pin
Björn T.J.M. Spruit21-Feb-07 10:17
Björn T.J.M. Spruit21-Feb-07 10:17 
That works like a charm, except...
How do I set the dynamic txtCalendar.text if it's not globally declared?
How can I find the dynamicaly declared textbox and set the text value?

Code so far:

<br />
Public Class ListReportParametersControl<br />
    Inherits System.Web.UI.UserControl<br />
<br />
    Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load<br />
        Dim intCounter1 As Integer<br />
        Dim strParamValue As String<br />
        Dim arrSessionParams() As String = Session("ReportParams").ToString.Split(",")<br />
        Dim arrTempTypeNValue() As String<br />
<br />
        For intCounter1 = 0 To UBound(arrSessionParams)<br />
            arrTempTypeNValue = arrSessionParams(intCounter1).ToString.Split(":")<br />
            Select Case arrTempTypeNValue(0)<br />
                Case "CALENDAR"<br />
                    SetCalendar(arrTempTypeNValue(1))<br />
                    ReDim Preserve arrControls(intCounter1)<br />
                    arrControls(intCounter1) = arrTempTypeNValue(1).ToString<br />
            End Select<br />
        Next<br />
    End Sub<br />
<br />
<br />
    Public Sub SetCalendar(ByVal CalendarID As String)<br />
        Dim lblCalendar As New Label<br />
        lblCalendar.Font.Name = "Verdana"<br />
        lblCalendar.Font.Size = FontUnit.Parse("10")<br />
        lblCalendar.ID = "Label" & CalendarID<br />
        lblCalendar.Text = CalendarID<br />
<br />
        Dim myCalendar As New Calendar<br />
        myCalendar.Font.Name = "Verdana"<br />
        myCalendar.Font.Size = FontUnit.Parse("10")<br />
        myCalendar.ID = CalendarID<br />
        myCalendar.EnableViewState = True<br />
        myCalendar.TodaysDate = System.DateTime.Today<br />
        myCalendar.VisibleDate = System.DateTime.Today<br />
        myCalendar.TitleFormat = TitleFormat.MonthYear<br />
        myCalendar.SelectionMode = CalendarSelectionMode.Day<br />
        myCalendar.NextPrevFormat = NextPrevFormat.CustomText<br />
        myCalendar.TodayDayStyle.BackColor = System.Drawing.Color.Red<br />
        myCalendar.OtherMonthDayStyle.BackColor = System.Drawing.Color.FromName("LightGray")<br />
        AddHandler myCalendar.SelectionChanged, AddressOf myCalendarSelectionChanged<br />
<br />
        Dim txtCalendar As New TextBox<br />
        txtCalendar.Font.Name = "Verdana"<br />
        txtCalendar.Font.Size = FontUnit.Parse("10")<br />
        txtCalendar.ID = "Textbox" & CalendarID<br />
        'txtCalendar.Text = myCalendar.UniqueID.ToString<br />
<br />
        Me.Controls.Add(lblCalendar)<br />
        Me.Controls.Add(myCalendar)<br />
        Me.Controls.Add(txtCalendar)<br />
    End Sub<br />
<br />
    Public Sub myCalendarSelectionChanged(ByVal sender As Object, ByVal e As System.EventArgs)<br />
        'Does nothing, yet.<br />
        Dim strSenderID As String<br />
        Dim strSenderType As String<br />
<br />
        strSenderType = UCase(sender.GetType.Name)<br />
        strSenderID = sender.ID<br />
<br />
        Select Case strSenderType<br />
            Case "CALENDAR"<br />
<br />
        End Select<br />
<br />
    End Sub<br />
<br />
End Class<br />


What do I put in the Case "CALENDAR" ?
It doesn't know txtCalendar...
Any suggestions?
GeneralRe: Dynamic Controls requires Dynamic event handling? Pin
TwoFaced21-Feb-07 10:47
TwoFaced21-Feb-07 10:47 
GeneralRe: Dynamic Controls requires Dynamic event handling? Pin
Björn T.J.M. Spruit21-Feb-07 11:15
Björn T.J.M. Spruit21-Feb-07 11:15 
QuestionImpersonation Pin
Savas Cilve21-Feb-07 6:16
Savas Cilve21-Feb-07 6:16 
AnswerRe: Impersonation Pin
Marcus J. Smith21-Feb-07 6:46
professionalMarcus J. Smith21-Feb-07 6:46 
GeneralRe: Impersonation Pin
Savas Cilve21-Feb-07 6:52
Savas Cilve21-Feb-07 6:52 
GeneralRe: Impersonation Pin
Marcus J. Smith21-Feb-07 8:04
professionalMarcus J. Smith21-Feb-07 8:04 
QuestionOutlook Exchange Server 2003 and VB.net Pin
PixelPixie21-Feb-07 5:51
PixelPixie21-Feb-07 5:51 
QuestionExecuting a .NET exe from VBA Pin
Dante X21-Feb-07 5:50
Dante X21-Feb-07 5:50 
AnswerRe: Executing a .NET exe from VBA Pin
kubben21-Feb-07 6:33
kubben21-Feb-07 6:33 
GeneralRe: Executing a .NET exe from VBA Pin
Dante X21-Feb-07 6:48
Dante X21-Feb-07 6:48 
GeneralRe: Executing a .NET exe from VBA Pin
kubben21-Feb-07 7:02
kubben21-Feb-07 7:02 
GeneralRe: Executing a .NET exe from VBA Pin
Dante X21-Feb-07 7:31
Dante X21-Feb-07 7:31 
GeneralRe: Executing a .NET exe from VBA Pin
kubben21-Feb-07 7:34
kubben21-Feb-07 7:34 
GeneralRe: Executing a .NET exe from VBA Pin
Dante X21-Feb-07 7:55
Dante X21-Feb-07 7:55 
GeneralRe: Executing a .NET exe from VBA Pin
kubben21-Feb-07 8:04
kubben21-Feb-07 8:04 
GeneralRe: Executing a .NET exe from VBA Pin
Dante X21-Feb-07 8:44
Dante X21-Feb-07 8:44 
GeneralRe: Executing a .NET exe from VBA Pin
kubben21-Feb-07 8:47
kubben21-Feb-07 8: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.