update form background color

  • Thread starter Thread starter HankC
  • Start date Start date
H

HankC

I have a vb.net app that serves our four campuses. A student logs in to

start the app.

Based on their login domain, I wish display the campus color and image
on the form.

I cannot find any sort of me.backgoundcolor attribute however...

Can someone help me dynamically chage the background color of the main
form?


Thanks,
HankC
 
HankC said:
Can someone help me dynamically chage the background color of the main
form?

Assign the desired color to the form's 'BackColor' property.
 
which is where I am confused...

In the page_load sub when I type 'me.' the type-ahead has no such
property....

I can set static attributes when I right-click the form and use the
'Document property pages' in development.


HankC
 
Thanks fo repsonse...

here's my code layout:

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here

'' my code to process based on logged in user and domain name

'' I can access the buttons, labels, textboxes, etc, .backcolor but not
me.backcolor...

end sub

I thought of using button1.parent.backcolor, but it is not available
either...


thanks,
HankC
 
Let me add that I am working inside:

Public Class WebForm1
Inherits System.Web.UI.Page
....
....
....
End Class
 
Hank,

This is nice confusing. You write "update form background color", which is
for us direct a windowsform application.

Now that you you show the load event of a "Page" which is a webform, about
which is never spoken as a form. It is than Page or webform.

You can get that frm. by using this code,
Dim frm As Control = Me.FindControl("Form1") 'Form1 is the HTML form Id

However there is no backcolor property. A webform is a page build using HTML
by the ASPNET dll that you build.

I have never tried to set style parts as code in HTML controls which are in
fact containers.

The most simple way is to click righclick on the Page in design mode and
than start setting the style property.

I hope this helps,

Cor
 
funny that the backcolor of the controls can be changed but not the
page itself...

HankC
 
Hank,

No not funny, that is just the behaviour of HTML.
The most terrible thing for me is a repeated image on the background as
attribute from the Body.

In fact can you give every cell its own background.

Cor
 
Back
Top