Wrox Programmer Forums
|
ASP.NET 1.0 and 1.1 Basics ASP.NET discussion for users new to coding in ASP.NET 1.0 or 1.1. NOT for the older "classic" ASP 3 or the newer ASP.NET 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 13th, 2004, 11:54 AM
Authorized User
 
Join Date: Jun 2004
Posts: 20
Thanks: 0
Thanked 0 Times in 0 Posts
Default Creating controls in code

Hi all,

 I am creating a panel with 4 subpanels on it - please see code example below:

  dim aPanel as new Panel
  dim bPanel as panel
  dim i as integer

  aPanel.widhth = pixel(400)
  aPanel.height = pixel(200)

  for i = 0 to 3
    bPanel = new panel
    bPanel.height=aPanel.height
    bPanel.width = pixel(100)
    aPanel.controls.add(bPanel)
  next

this works fine but all my panels are listed vertically.

I want my panels to be listed horizontally - ie aPanel holds
4 child panels across its width.

How can I set my child panels to be added to my parent panel
so that they are horizontal ?

Cheers?


 
Old November 15th, 2004, 11:29 AM
Friend of Wrox
 
Join Date: Sep 2003
Posts: 121
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Tara

 I have been struggling to do something very similar.

 I never worked out how to get the panels to display horizontally
 but I cheated and used a table instead. I simply created a table
 in code and then created the required number of columns/rows in
 code and assigned them to my table.

 I have found this gave me more control at code level and was easier
 to work with.

 Just a thought...sorry I cannot answer the original question.

 Cheers
 Chas UK.







Similar Threads
Thread Thread Starter Forum Replies Last Post
problems in creating dynamic controls merinmathew ASP.NET 1.0 and 1.1 Basics 0 January 12th, 2006 01:06 AM
dynamically creating controls rahulpokharna C# 1 January 11th, 2006 12:47 PM
Creating Web Custom Controls Lerik C# 2005 0 January 6th, 2006 04:55 AM
Creating controls dynamically Renu ASP.NET 1.0 and 1.1 Basics 9 December 19th, 2004 10:21 AM
creating controls on the fly mtrtxs Access 9 September 10th, 2004 04:51 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.