Home All Groups Group Topic Archive Search About

update form background color

Author
27 Apr 2006 9:07 PM
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

Author
27 Apr 2006 9:27 PM
Megaten
Me.BackColor = Color.Azure
seems good

HankC a écrit :
Show quoteHide quote
> 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
>
Author
27 Apr 2006 10:29 PM
Herfried K. Wagner [MVP]
"HankC" <cla***@missouri.edu> schrieb:
> Can someone help me dynamically chage the background color of the main
> form?

Assign the desired color to the form's 'BackColor' property.

--
M S   Herfried K. Wagner
M V P  <URL:http://dotnet.mvps.org/>
V B   <URL:http://classicvb.org/petition/>
Author
1 May 2006 3:15 PM
HankC
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
Author
1 May 2006 3:43 PM
Cor Ligthert [MVP]
Hank,

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemwindowsformscontrolclassbackcolortopic.asp

Are you sure that you are typing the me inside a method by instance the
load_event?

I hope this helps,

Cor




Show quoteHide quote
"HankC" <cla***@missouri.edu> schreef in bericht
news:1146496541.618964.321420@e56g2000cwe.googlegroups.com...
>
> 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
>
Author
1 May 2006 4:37 PM
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
Author
1 May 2006 4:41 PM
HankC
Let me add that I am working inside:

Public Class WebForm1
    Inherits System.Web.UI.Page
....
....
....
End Class
Author
1 May 2006 5:03 PM
Cor Ligthert [MVP]
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

Show quoteHide quote
"HankC" <cla***@missouri.edu> schreef in bericht
news:1146501460.035840.146590@i40g2000cwc.googlegroups.com...
>
> 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
>
Author
1 May 2006 7:16 PM
HankC
funny that the backcolor of the controls can be changed but not the
page itself...

HankC
Author
1 May 2006 8:44 PM
Cor Ligthert [MVP]
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

Show quoteHide quote
"HankC" <cla***@missouri.edu> schreef in bericht
news:1146510961.409966.285940@g10g2000cwb.googlegroups.com...
>
> funny that the backcolor of the controls can be changed but not the
> page itself...
>
> HankC
>