Results 1 to 5 of 5

Thread: Panel updating with the Dialog box Text

  1. #1

    Thread Starter
    Member
    Join Date
    Mar 2010
    Posts
    43

    Panel updating with the Dialog box Text

    Hi, Can someone please help me.

    I have a dialogue texttbox to enter new texts, what code shall i use in my MainForm so that the panel control- systems.windows.form.panel (which I have on the mainform) gets updated with the text which i entrred in the dialogue box text field.

    Thanks

  2. #2
    eXtreme Programmer .paul.'s Avatar
    Join Date
    May 2007
    Location
    Chelmsford UK
    Posts
    25,458

    Re: Panel updating with the Dialog box Text

    can you post your dialog form code?

  3. #3

    Thread Starter
    Member
    Join Date
    Mar 2010
    Posts
    43

    Re: Panel updating with the Dialog box Text

    Here is my dialog box code:

    Imports System.Windows.Forms

    Public Class TextDialog

    Private Sub OK_Button_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OK_Button.Click
    Me.DialogResult = System.Windows.Forms.DialogResult.OK
    Me.Close()
    End Sub

    Private Sub Cancel_Button_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Cancel_Button.Click
    Me.DialogResult = System.Windows.Forms.DialogResult.Cancel
    Me.Close()
    End Sub

    End Class

  4. #4
    Frenzied Member
    Join Date
    Jun 2007
    Location
    India
    Posts
    1,148

    Re: Panel updating with the Dialog box Text

    before disposing the dialogform in your mainform you can get the text of the textbox as below

    vb Code:
    1. Dim dlgfrm As New DialogForm
    2. if dlgfrm.ShowDialog= System.Windows.Forms.DialogResult.OK
    3.   Me.Panel1.Text = dlgfrm.TextBox1.Text
    4. Elseif dlgfrm.ShowDialog= System.Windows.Forms.DialogResult.Cancel
    5.   ''Your code if any
    6. End If
    7. dlgfrm.Dispose()

  5. #5

    Thread Starter
    Member
    Join Date
    Mar 2010
    Posts
    43

    Re: Panel updating with the Dialog box Text

    Thanks, and appreciate for the quick response I will follow your advise and let you know how i progress..In addition

    I also have a dialogbox that I have created to open a picture file to load into the card panel and display it. How can i use the folloiwng methods to display the picture file on the panel.

    Thanks

    Private Function findPictureRectangle(ByVal pageSize As RectangleF, ByVal pic As Bitmap) As RectangleF
    Public Sub setText(ByVal someText As String)
    Public Sub setTextFont(ByVal aFont As Font, ByVal col As Color)
    Public Sub setPicture(ByVal fileName As String)
    Public Sub createDisplay()
    Private Sub drawCard(ByVal g As Graphics, ByVal rect As RectangleF, ByVal curFont As Font, ByVal textX As Single, ByVal textY As Single)
    Public Sub printCard(ByVal e As PrintPageEventArgs)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width