Dynamic forms?

  • Thread starter Thread starter Ayende Rahien
  • Start date Start date
A

Ayende Rahien

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?
 
Ayende Rahien said:
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?

Just swapping controls is often a good way, its how I do it anyway. What do
you consider to be too inflexible about it?
 
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(ByVal sender As Object, _
ByVal e As System.EventArgs) Handles MyBase.Load
backimage = Image.FromFile("C:\mytestimage.jpg")
loaded = True
Form1_Resize(Nothing, Nothing)
End Sub

Private Sub Form1_Resize(ByVal sender As Object, _
ByVal e As System.EventArgs) Handles MyBase.Resize
If loaded Then
Dim sized As Bitmap = New Bitmap(Me.Width, Me.Height)
Dim imageRectangle As New Rectangle
imageRectangle.Height = backimage.Height
imageRectangle.Width = backimage.Width
Dim formRectangle As Rectangle
formRectangle.Height = Me.Height
formRectangle.Width = Me.Width
Dim gr As Graphics = Graphics.FromImage(sized)
gr.DrawImage(backimage, formRectangle, _
imageRectangle, GraphicsUnit.Pixel)
Me.BackgroundImage = sized
gr.dispose
End If
///
 
Back
Top