Find us on Google+ Kill the code: color
Showing posts with label color. Show all posts
Showing posts with label color. Show all posts

Sunday, 22 September 2013

Change background color of MDIParent Form in VB.Net

#Region "Change Background Color of MDIParent : bgcolor()"
    'to change the background color of mdiparent
    'for more : http://acomputerengineer.wordpress.com

    Private Sub bgColor()
    Dim child As Control
    For Each child In Me.Controls
        If TypeOf child Is MdiClient Then
            child.BackColor = Color.CadetBlue
        Exit For
        End If
    Next
    child = Nothing
    End Sub
#End Region

Wednesday, 22 February 2012

Set background color on mouse click


import java.io.*;
import java.awt.*;
import java.awt.event.*;
import java.applet.*;
/*
<applet code="Brighter" width=300 height=400>
</applet>
*/
public class Brighter extends Applet implements MouseListener
{
int i;
Color color;
public void init()
{
color=new Color(i,i,i);
setBackground(color);
addMouseListener(this);
}
public void mouseClicked(MouseEvent me)
{
i+=10;
if(i>255)
{
i=255;

}
color=new Color(i,i,i);
setBackground(color);
repaint();


}
public void mouseEntered(MouseEvent me)
{
}
public void mouseExited(MouseEvent me)
{

}
public void mousePressed(MouseEvent me)
{
}
public void mouseReleased(MouseEvent me)
{
}
}