473,385 Members | 1,942 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

How to position web server contols at run time?

Quite possibly a simple one.
I wish to build a web page which will encompass multi
functionality (i.e. it wil accept relevant entries to
perform a variety of procedure against my data base).
When I call the form I pass a query string and use select
statements to determine what the form is supposed to be
doing. I then want to dynamically position server
controls onto the rendered page in response to this. My
problem: I can't seem to see any property which will
allow me to set a location for each control which I can
specify at run time. In windows forms I would use the
location property and then the size.
With the web forms I can see how the height and width can
be dynamically controlled, but not the start point. Also
in the underlying html I can see how the starting location
may be set, but am unsure of how to incorporate this from
my VB environment.

Thanking anyone in advance.

Andrew
Nov 20 '05 #1
1 958
Cor
Hi Andrew,

I did not make this sample for this, but you can look what it can do for
you.

One of the most important things, you have to add a panel yourself on the
form.

\\\
Private Sub Page_Load(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles MyBase.Load
Dim mybutton(31) As Button
Dim i As Integer
For i = 0 To New Date().DaysInMonth _
(New Date().Year, New Date().Month) - 1
mybutton(i) = New Button
mybutton(i).BackColor = Drawing.Color.White
mybutton(i).Text = (i + 1).ToString
mybutton(i).Width = New Unit(30)
Me.Panel1.Controls.Add(mybutton(i))
AddHandler mybutton(i).Click, AddressOf mybutton_Click
If (i + 1) Mod 5 = 0 Then
Me.Panel1.Controls.Add(New LiteralControl("<BR>"))
End If
Next
End Sub
Private Sub mybutton_Click _
(ByVal sender As Object, ByVal e As System.EventArgs)
Dim mylabel As New Label
Me.Panel1.Controls.Add(New LiteralControl("<BR><BR>"))
Me.Panel1.Controls.Add(mylabel)
mylabel.Text = "The day is: " & DirectCast(sender, Button).Text
End Sub

Link
http://msdn.microsoft.com/library/de...satruntime.asp

I hope this helps a little bit?

Cor
Nov 20 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Rowan | last post by:
Hi there, it has been a while since i have posted. I am in a situation where I am stumped. I am learning to build a dts package where I am connecting to a table in an AS400. This database is...
3
by: jason | last post by:
I've got this javascript routine (i found on google - thank you) in an asp.net page that on page reload sets the cursor of a textbox to the last line. It works great! Using a similar concept, I...
0
by: Christian | last post by:
Hi, I try to change the position of a WebUserControl on my WEbform (layout is set to GridLayout) by changing the absolute position in the html-code but it does not work. When I change the...
1
by: Leo | last post by:
I created a user control which is some text contained in a HtmlTable. I put this control into main form. I would like to have the ability to move this control around in the main form. I think one...
0
by: Vineeta | last post by:
Volt is the leader in providing workforce design and is currently the 5th largest staffing firm nationwide. Volt is an E.O.E. Our client is a top entertainment/community network and a large-scale...
0
by: nareshkumarhk | last post by:
hai all, i would like to have a help here. How to drag and drop data from contols in atlas. the senario is: i want to drag and drop the containing values in the listbox1 to listbox2 how to...
9
by: jatiner84 | last post by:
What is process for adding text box and button at run time.
7
by: Lit | last post by:
Hi, How can I capture the vertical scroll bar position for a Listbox. I have a Listbox of 100 items + when I click on it I post back remove the item selected. After returning to the client...
0
by: peter | last post by:
Hi, Here is an urgent requirement with one of our direct customer for Sr.Windows Server Administrator.Client is an Financial Services company looking for Senior Consultants for this position....
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.