Dynamic forms?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Ayende Rahien

    Dynamic forms?

    I want to build a application where I've a fixed sidebar, and a
    replacable main area.
    (Think frames in HTML, where you've a menu on one side, and the real
    data on the other.)

    I build the sidebar, but I'm having problems architecting the
    replacable main area.
    At first I thought to use user controls and just switch between them
    as needed, but that seems to be too unflexible.

    Can you recommend a good way to do this?
  • Daniel O'Connell [C# MVP]

    #2
    Re: Dynamic forms?


    "Ayende Rahien" <ayende@gmail.c om> wrote in message
    news:29d6e93.04 09161958.5e13e0 bb@posting.goog le.com...[color=blue]
    >I want to build a application where I've a fixed sidebar, and a
    > replacable main area.
    > (Think frames in HTML, where you've a menu on one side, and the real
    > data on the other.)
    >
    > I build the sidebar, but I'm having problems architecting the
    > replacable main area.
    > At first I thought to use user controls and just switch between them
    > as needed, but that seems to be too unflexible.
    >
    > Can you recommend a good way to do this?[/color]

    Just swapping controls is often a good way, its how I do it anyway. What do
    you consider to be too inflexible about it?


    Comment

    • Cor Ligthert

      #3
      Re: Dynamic forms?

      Ayende,

      I made a VBNet sample from what Daniel told.

      I hope it helps?

      Cor

      \\\
      Private backimage As Image
      Dim loaded As Boolean
      Private Sub Form1_Load(ByVa l sender As Object, _
      ByVal e As System.EventArg s) Handles MyBase.Load
      backimage = Image.FromFile( "C:\mytestimage .jpg")
      loaded = True
      Form1_Resize(No thing, Nothing)
      End Sub

      Private Sub Form1_Resize(By Val sender As Object, _
      ByVal e As System.EventArg s) Handles MyBase.Resize
      If loaded Then
      Dim sized As Bitmap = New Bitmap(Me.Width , Me.Height)
      Dim imageRectangle As New Rectangle
      imageRectangle. Height = backimage.Heigh t
      imageRectangle. Width = backimage.Width
      Dim formRectangle As Rectangle
      formRectangle.H eight = Me.Height
      formRectangle.W idth = Me.Width
      Dim gr As Graphics = Graphics.FromIm age(sized)
      gr.DrawImage(ba ckimage, formRectangle, _
      imageRectangle, GraphicsUnit.Pi xel)
      Me.BackgroundIm age = sized
      gr.dispose
      End If
      ///


      Comment

      Working...