Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    Visual Basic




Command Buttons Background Colour HELP!!


Im atempting to change the colour of all of the command buttons in my project, i have succesfully managed to do that with the form back colour and the MDI colour. However i cant seem to be able to changet he colour of a command button (using a combo box- with the names of colours being displayed and coding behind it) Which ever colour the user selects and the "Display" button is pressed the command buttons should change colour but they do not.

I have attempted to do it this way:

Code:
FrmEditColour.CmdDisplay.BackColor = TxtProjectedCol3.BackColor

(The Cmd Display is the command button)
(The txtProjectedCol3 is a text box with a colour in it- which should make the command button change colour)

Is there anyway of doing this, or have i done something wrong/need to modify my code?




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Colour Command Buttons!
I have created a colour command button and a colour textbox control for anyone to use! if u want them just e-mail me or reply to this post!

The command button also has a highlight colour! For when the mouse is down!

Excel - Command Button To Update Cell Background Colour
I'd be very grateful if someone could help me with a very simple question about vb code.

I have an Excel speadsheet and I'd like to set up a few command buttons to change the fill/background colour of the selected cell, but I'm unsure as to the code to add.

How it'll work:

1) Select the cell in the spreadsheet to be changed.
2) Press the corresponding command button (Titled = Blue, Red, Green etc).
3) Button changes the background colour of the cell to Blue, Red, Green etc.

It'll mostly be used as a single cell selection but is it possible to allow a range of selected cell to be changed in colour?

Can I type colour 'names' in or do I need a reference number to specify a certain colour? ...if so, how do I find out what colours are called?

I tried the "record a macro and re-engineer it" help tip but the code doesn't seem to work when I attach it to a command button.

Many thanks for all your help.

Marc

Excel - Command Button To Update Cell Background Colour
I'd be very grateful if someone could help me with a very simple question about vb code.

I have an Excel speadsheet and I'd like to set up a few command buttons to change the fill/background colour of the selected cell, but I'm unsure as to the code to add.

How it'll work:

1) Select the cell in the spreadsheet to be changed.
2) Press the corresponding command button (Titled = Blue, Red, Green etc).
3) Button changes the background colour of the cell to Blue, Red, Green etc.

It'll mostly be used as a single cell selection but is it possible to allow a range of selected cell to be changed in colour?

Can I type colour 'names' in or do I need a reference number to specify a certain colour? ...if so, how do I find out what colours are called?

I tried the "record a macro and re-engineer it" help tip but the code doesn't seem to work when I attach it to a command button.

Many thanks for all your help.

Marc

Background Of Command Buttons?
Is it possible to change the background of a command button
with a .gif or any other image format?

{Noob Question} How Do I Change A Command Buttons Background Color
i changed the command buttons background color but nothing happened i believe i have to change a forms property but i cant remember what property i have to change, thanks for any help

Reversing Font Colour And Background Colour Of A Textbox
Hi guys, may I know the code to

1. reverse the font colour to white and the background of the textbox to black when an event is triggered?

How To Differentiate Between The Background Colour And The Fround Colour Of The Image????
Hi Friends!!!!

Im doing project on the Sickle Cell detection(picture is attached), anyone can please help me how to find out the Blood cells in my picture. What I want to do is I want to Differentiate the Background colour of the picture (Which is in black and white colour) with the Front coloured cells (Which are in the Red colour). I want only the red coloured blood cells in the picture. so, I want to eleminate the Background colour in the Picture.

After finding the Red coloured cell in the picture, I want to compare each cell with a Fixed radious of Red cell (Which is 7mm) and White cell (Which is 12mm). so, By doing like this I can find the actual Sickel Cells (the cells which are not round in shape but are shaped like a sicle when diseased) in the picture. This is my aim of the project.....

So, anyone who can please help me How to find out the Red cells in the picture by eleminating the Background colour.

Any help will be appreciated.

Background Colour
hi, i'm using:
frmMainMenu.BackColor = RGB(col, 134, 121)

to change the background colour of my form, does anyone know what i'd use to change it back to the original (normal form colours)


thanks

Trying To Get The Right Background Colour ..
OK ... I have a colour chart showing colours and their respective hex values.

If I try and make the backolour of a form one of these colours, for example dark blue using hex value 330099, VB throws a wobbly and defaults it to black !!

I've always used the standard pallette in the past. Typical ... as soon as I start to try and be creative VB hates me !!!

Am I missing something here ?

Get The RGB Colour Of The Background
i would like to ask, how can i get the RGB colour of the background in a certain area?? Thanks in advance

Cire from HK
Eric @(^_^)@

Toolbar Background Colour
Is it possible to change the colour of the actual toolbar? Thanks

ListView Background Colour
Hello

My first post in this forum, so nice to meet you all!

I want to selectively set the background colour of items in a list view, so that the user can easily differentiate between various categories of items.

The standard:

SendMessage(ListView1.hwnd, LVM_SETEXTENDEDLISTVIEWSTYLE, 0, ByVal lStyle)

unfortunately seems to set the whole lot to just the one colour.

Is it even possible?

Thanks
Tarik

Problem With BAckground Colour
Im having a small problem with the Background Colour for RTB. This is my code:


Code:
cdlg.ShowColor
RichTextBox1.BackColor = cdlg.Color

Problem takes place when the user tries to change the colour of the background the first time.... even if he/she cancels, the background is changed to Black... but after that, it goes fine. Why is it like that?

Custome Background Colour
How do i set the background colour of a form to a custom colour? When i drop down the Backcolur box, theres only preset colours.

Box Colour May Match Background...
I have a code that loads pictures into my picturebox
and have this code to make boxes

VB Code:
picContainer.Line (sX, sY)-(X, Y), vbBlack, B


Obviously the

VB Code:
vbBlack

line tells the colour
How do you make it so with a combobox you can change the colour???

RichTextBox And Background Colour
Wotcha, folks.

I've been searching for a way in which to change the colour on just a selected portion of a rich text box.

We have a RTB that lists information that is then checked and coloured according to the information it finds. I.e any text with the words "problems" is highlighted in red, etc.

As we've now run out of distinguishable colours, I'd like to change the selected background colour.

There was one relatively similar question asked here earlier, but it never really went anywhere.

Is it possible to change the background colour of a selected piece of text in a RichTextBox?

Much ta.

Jack.

How To Set A Background Colour Of A Listview Row
Hello people, I want to change background colour of specified rows in a list view(in reporting mode). only way available is changing the backgroung colour of all rows but i want to change the background colour of rows what I want, not all. and also is there any way to change the colour of selected rows rather than tradiotional blue colour. Please help me with this thing. THANKS IN ADVANCE!

Changing The Background Colour
Hi

I want to make it so the suer can change the background colour of all forms with in my program. i want them to be able to have a variety of colours to choose from. what is the best way if any of doing this.

Thanks in advance

Background Colour Of Combos
I use a form for data input consisting mainly of a number of textboxes and comboboxes. Textboxes are highlighted as they get the focus by assigning a light blue background color in the gotfocus event. Thereafter the white background is restored at the lostfocus event.

Combos however become automatically painted with the same colour as the form's title bar when they get the focus. Could this be avoided? I'd like to have the combos coloured in the same light blue as the textboxes.

Form Background Colour
Hi,

This is just a simple question.

When you create a form, it's default colour is set to some vb constant. In my case, this is vbButtonFace

So, if I compile an exe and run this on another computer, will the background colour of the form change based on what settings that person has on his computer???

BackGround Colour To SStabs
Hi,

I am wanting to change the background colour of an SSTab, and before you scream at me, yes i know their is a property for this, but this is not for the colour of the actual tabs, which is what to change.
I was thinking of an API call maybe!!

Does anyone know how to write this?

Cheers

Background Colour Of A Form
How Do I set the background colour of a form on a button click.

I want to use a variable to do it.
It gets it info from 3 text boxes red, green & blue and then i say

test = test1.text + text2.text + text3.text
form1.backcolor = test

But it comes up with an error saying "Invalid Property Value"

thanks

Background Text Colour
Does anyone know how to change the BACKGROUND colour of certain sections text in a Rich edit Control... Similar to how text is highlighted with a yellow background in the VB Development environment when you get an error. Anyone got any ideas?

Before replying, please note what i am after. I know how to select text and change it's colour and font etc. what i need is how to change the background colour of certains sections of text.

Thanks people, if u have any ideas, please post a reply.

Laterz

REM

Datagrid Background Colour
does anybody know make the column in the datagrid with different
background colour, meaning that column1 is blue in colour, column2 is
yellow in colour..?

Change Background Colour
Hi,
I want to change the default background colour "White" of a Data Report to some other colour.
Can anyone help me regarding this?
Thanks in Advance.

Text Highlight - Background Colour
Hi eveyone.....

I am having a little problem with using the .backcolor property of a RichTextBox... Basicly what a what to do is highlight some text in the text box, once i have lost the focus on that selected text I would like the background behind that text to change colour and not the entire text box.

Can this be achieved...thanks for your help in advance.

Iain

:-)

Changing Background Colour With A Method
I am trying to change the background colour of an array of radio buttons using a method. The radio buttons are named "rbColours(INDEX)". There are only 4 of them, so going out of bounds shouldnt be a problem for the array.

The error I get (on run), is "Object variable or With block variable not set". I am using VB6

I know that, as far as my current code goes, this is a really long way to do it, but I hope to, once this works, do it for a much bigger project.


Private Sub Form_Load()
Dim ColourTable(3) As Data
ColourTable(0).BackColor = &H8000000F 'Grey
ColourTable(1).BackColor = &HFF& ' Red
ColourTable(2).BackColor = &HFF0000 ' Blue
ColourTable(3).BackColor = &HFF00& ' Green
End Sub

Private Sub rbColours_Click(Index As Integer)
Call ChangeColours(Index)
End Sub

Private Sub ChangeColours(Index As Integer)
rbColours(Index).BackColor = ColourTable(Index)
End Sub


PS. Thank you all for your help

Change Background Colour In Frontpage Using Vb
Im creating a website in microsoft frontpage, and I'd like to create a feature in visual basic which allows me to alter the background colour of the page im on by pressing a certain button. I have 5 command buttons, I want 1 to change background colour to red, the next white, the next black, then next yellow, and the next blue.

How would i go about doing this?

Thanks

Change Flexgrid Background Colour
is it possible to change the background colour of individual columns of an MSHFlexgrid to make it easier to read?

Shape Background Colour Issue
I dabbled with VB about a year and a half ago but have forgotten a lot of the intricasies and now I find myself needing to create an application for some harware that I'm building but I'm stumbling.

This problem (I'm sure it won't be my last post :
I declared the use of the sleep function at the top of my program.
I have a shape (Shape 2) which represents an LED indicator. When a button is pressed, data is sent out the UDP port and the background of Shape 2 turns green. If Checkbox 7 is ticked when the button is pressed, the same udp data is sent out the udp port and the LED should turn green for 1 second then different udp data is sent and the LED (Shape 2) should turn red. It works fine when the checkbox is not ticked (send the udp data out and turns the LED background Green BUT when the checkbox is ticked, the LED (Shape 2) does not turn Green at all (the udp data is being sent though).
Essentially, with the checkbox unticked, the button serves to turn on the LED
and with the checkbox ticked, it acts like a momentary switch (on then off).
The delay is working because I can see my On, wait 1 sec then Off udp
data using a packet sniffer.
I can't help thinking that I am overlooking some small detail (as usual
Thanks, Hugh

Private Sub Command3_Click()
udp_PC.SendData &H1
Shape2.BackColor = &HC000&
If Check7.Value = 1 Then
Sleep 1000
udp_PC.SendData &HA1
Shape2.BackColor = &HFF&
End If
End Sub

Trying To Change The Datagrid Row Background Colour.
Hi there,

I am struggling to find the correct syntax. I want to change the datagrid row background color based on an if statement. So far my logic is this:


query = "UPDATE customers SET "& Search_Customers.DataGrid1.BackColor & " = rgb(20,20,20) WHERE customerid = 1"

....however, the format might be to add a column name after SET.....

query = "UPDATE customers SET firstname = rgb(20,20,20) WHERE customerid = 1" (this statement updates all the data under "firstname" to rgb(20,20,20).

Thanks in advance

Simon

Changing The Background Colour In-form.
Okay, I need to be able to change the backround colour using hotkeys, I think i have to use the numbers as Hotkeys (1,2,3,4,5,6,7,8,9,), but if that is long and/or complex, how can you do this with Cmdbuttons?

Setting Background Colour In MSFlexGrid
Hi all,

Im displaying information from a DB in a flexgrid.
How do you set the background clour of the cells
so that only the rows containing information is coloured??

I think its something like: MSFlexGrid1.CellForeColor = &HBA8667
Im just unsure as to where to put it in my code!!

Below is my code for loading the information:

Thanks in advance!


VB Code:
Private Sub PopulateGrid1() Dim i As IntegerDim j As Integer Dim a As IntegerDim b As Integer Dim c As Integer 'To clear the rows when another date is pickedFor a = 1 To grdAppointments.Cols - 1    For b = 1 To grdAppointments.Rows - 1        grdAppointments.TextMatrix(b, a) = ""    NextNext   'Assign the date value of the calendar control to the variable ApptDateApptDate = calAppointments.Value   'Takes the selected fields out of the Appoinmtents table in DB where the date is equals'to the ApptDategcomDentware.CommandText = "SELECT [Time], Patient_FName, Patient_SName, Procedure, Dentist FROM tblAppointments WHERE [Date] = #" & ApptDate & "#  ORDER BY [Date], [Time];"   Set grsDentware = gcomDentware.Execute 'Execute the query         If Not grsDentware.EOF Then           grdAppointments.Cols = grsDentware.Fields.Count        grsDentware.MoveFirst        'Checks the times in the Appointments table and fills the corresponding rows        'in the flexrgid        Dim X As Integer        X = grsDentware.CursorLocation                Do While Not grsDentware.EOF            For i = 1 To 37                If grdAppointments.TextMatrix(i, 0) = grsDentware.Fields(0) Then                    For j = 1 To 4                    grdAppointments.TextMatrix(i, j) = grsDentware.Fields(j)                    Next                End If            Next            grsDentware.MoveNext                    Loop    End If        grsDentware.Close                              End Sub

Definning A Background Icon Colour
Hi...

I'm using a toolbar in my program and I've inserted a few buttons .. I also inserted my own original icons ( - I RULE)... however I don't know how to define the background... (it always appears with a different color: the icons background and the button).. is there a way to define in the button witch is the icons background color, so that color becomes transparent?

I hope I've made myself clear... I've explained my problem the best I could....

thanks in advance

Background Colour Of Toolbar Image
I Want the background of my toolbar images to change in line with the desktop colour settings.

I have a toolbar linked to an imagelist.

I have inserted a gif with a transparent background into the imagelist list, however the image always appears on the toolbar with a white background or inverted.

I have tried changing the backcolor and maskcolor properties of the imagelist, but this appears to do nothing. Any ideas please

Changing Colour Of Background In Status Bar
Is there a way just to change the background colour of one panel in a status bar. Say to red, so I can use it as a warning???

Thanks

How To Change Background Colour Automatically??
hi

ive made a basic joke program and i was wondering how to change the bankground colour say from bacl to red constantly, i know i would have to use a timer, can anyone help?

thanks

How To Change The Background Colour Of Toolbar ?
I'm using Vb 6.0 and wish to change the background color of the toolbar? any idea of the solution.

Menu Text/background Colour
Hi, I was just wondering if you could change the text/background colour of a menu?, I've got the colour changed(by backcolour I mean when its pressed down).




BoyIdiot

I never think of the future - it comes soon enough.
Albert Einstein
  

Edited by - Boyidiot on 1/17/2004 10:49:29 PM

Changing The Selection Background Colour Of A Textbox
ok, does anyone know how i could change the selection background colour of a textbox?

Changing Background Colour Of Message Boxes
Does anyone know how to change the appearance of a message box, in terms of changing the colour of the font and background etc??? Or would I be better off just creating a form instead???

Problem Setting A Shape's Background Colour
I have background colours for shapes stored in a database (with the string datatype) eg: &H0080FFFF&

However, when I try to load them from the database and set the shapes background colour to be that colour using .BackColor I recieve a "Data Type Mismatch" error.

How should I be storing these colours in the database, and loading them from the database again?

Any help would be much appreciated.

VBA Excel - Changing Background Colour Of A MultiPage
Dear All,

This is basic just probably me missing something in the VB Editor in Excel, basically I have a form with a MultiPage and want to change the background colour of the individual pages - when I select the MultiPage I am able to changethe background colour of the page behind the tabs, and when I select the individual Tab/Pages there is no BackColour choice.

Was wondering what I could do?

Many Thanks

Ryan Williams

Setting Background Colour Of Panel In Status Bar..possible?
Hi,

I was wondering whether its possible to set the background colour of a panel on the status bar.
If so, how?

I have three panels defined, one for the system time and date, an another for a 'status'.
What I would like to do is set the background of the panel that is used for denoting a 'status' to certain colours (eg: red or green) depending on a variable.

Any information on this would greatly be appreciated.
Thanks in advance

Brian

Change Data Grid Background Colour
is it possible to change the datagrid background colour???

Changing A Buttons Colour
heya everone

Can anyone tell me how to change the colour of a button when it is clicked. I have tried usign the backcolor property however that doesn't seem to work.

Thank you in advance

Frosty

Alternating Background Colour In Detail Section Of Datareport
Hi
Is there anyway of alternating the background colour of the detail section in a VB datareport.

I thought about using the MOD function to determine odd and even rows.

Many thanks

Afy

Chaning Title Colour And Buttons, Etc.
Hi! I am quite new at VB, so I am just playing around with the features and controls. I am more used to development of C++ in a unix enviroment, so I am quite new to the gui concept.

i am quite intigued and find it lots of fun. (MFC seems to daunting right now :-/)

...Anyways, with my question.
http://bluehawk.monmouth.edu/jon/image5.jpg

even a msgbox looks cool and same scheme
http://bluehawk.monmouth.edu/jon/other1.jpg

i got a prog i found that looks like this. i think the form colour scheme is simple, but rocks! How do I get the minimise / close to look like that? The form buttons to look like that? The title bar? I dont see those as options. I managed to get my own form to have it black, etc, but button wont change, at least for me. But teh top bar. Can it be done in VB? The original prog from the screen shot is like 20k, how can that be so small? (I think it was done in VC++, but please help! Thanks a million!

Option Buttons And Command Buttons On A Different Form
Hi all!

my problem is, im making a quiz setter/taker.

i have 1 form to set the questions and 1 form to take the test.

on the set form, i have 5 text boxes, 1 for the question and 4 for 4 possible answers. next to the 4 text boxes i have an option button to select for which the correct answer is.

then i press the save button and go to the test form.

there i have 1 text box and 4 command buttons. the 4 answers appear in the command buttons to click. which ever button is clicked, the button changes yellow to indicate the buttons has been selected.

then i press a submit button to reveal the correct answer.

what i want to do it make the option i selected, if the command button chosen is wrong or right then it will change either red or green.

this will be a small peice of code probably but ive been trying all night and cant figure it out

Copyright © 2005-08 www.BigResource.com, All rights reserved