C# :: Change Listbox Color?

Dec 22, 2014

I've changed the listbox foreground color to default application background color so I get: [URL] which is fine but when I select any element I get white background/foreground(or whatever it is): [URL]

How can I change this so I will have the same default color in the second case?

It is a windows store app

Xaml code(listbox is at the end):

<Page
x:Name="pageRoot"
x:Class="ExchangeRate2.MainPage"
DataContext="{Binding DefaultViewModel, RelativeSource={RelativeSource Self}}"

[Code]....

View 1 Replies


ADVERTISEMENT

C# :: How To Change Names Within Checked Listbox

Jul 4, 2014

what i want is to be able to change checked items within the listbox if not is there an alternative, is it possible?

View 4 Replies View Related

C# :: Using Listbox To Change Image In Picture Box And Text In Label

Mar 21, 2012

My goal is to have couple of items in the listbox and when highlighting one item a image in the picturebox should appear, and so on for each item in the listbox.I just don't know how to change image depending on selected item in the listbox instantly.Also when i highlight item a text in label should be like in highlighted item in listbox.

View 1 Replies View Related

C/C++ :: Qt TableView Change Row Color

Feb 24, 2014

I'm creating a simpe program using Qt/C++ and MySQL.

I am trying to change row color of QTableView, but it has to change depending on value on the database.

For example I have QTableview wich is conected to mysql database:

this->model1 = new QSqlQueryModel();
model1->setQuery("SELECT ID, value, Name FROM DB_Table ");
ui->tableView->setModel(model1);

Now I want to change row color to red if the value = 1 .

I searched alot and found this:My link But dont understand how to use these clases in my code, i'm cind a new in programing.

View 3 Replies View Related

C++ :: Change The Color Of Piece In Tetris

Mar 15, 2014

void SetupPieces() {
pieces[0] = Piece(Bads(0,2), Bads(0,1), Bads(0,0), Bads(0,-1));
pieces[1] = Piece(Bads(0,0), Bads(0,1), Bads(1,0), Bads(1,1));
pieces[2] = Piece(Bads(-1,0), Bads(0,0), Bads(1,0), Bads(0,-1));
pieces[3] = Piece(Bads(-1,1), Bads(-1,0), Bads(0,0), Bads(0,-1));
pieces[4] = Piece(Bads(1,1), Bads(1,0), Bads(0,0), Bads(0,-1));
pieces[5] = Piece(Bads(1,1), Bads(1,0), Bads(0,0), Bads(-1,0));
pieces[6] = Piece(Bads(-1,1), Bads(1,0), Bads(0,0), Bads(-1,0));
}

View 7 Replies View Related

C++ :: How To Change Tab Background Color To Green

Aug 8, 2013

Okay, I have a form and I have a tab control thing. On the second tab, I have a button which is supposed to turn the background green.

So, I have this:

#pragma endregion
private: System::Void greenButton_Click(System::Object^ sender, System::EventArgs^ e) {
this ->BackColor = System::Drawing::Color::Green;

But clearly that just turns the FORMS background green. How can I change the TAB background to green.

View 3 Replies View Related

C++ :: How To Change Background Color Of Edit Box

Nov 27, 2013

I am working on this project where I need to update an edit box every couple of seconds with a status and based on the status I need to change the color of the background to a particular color.I am able to update the edit box with the status but is clueless on how to update background color.I have read some info on line about this but is confused.This edit box is on a tab in a dialog. Also, on this tab is a Groupable List Ctrl.

View 2 Replies View Related

C++ :: Color Change Of Text More Than Once In Program?

Jan 13, 2014

How do i change color of text in the program more than once . rite now i use the code

system ("color 0c");//makes the color of the text red
cout <<"hey";
system ("color 02") //change color to green;
cout<<"only in green ";

it displays both the lines in green not the first in red and second in green.

View 1 Replies View Related

C++ :: How To Change Background Color (Mac / Windows)

Jul 19, 2014

I'm creating a simple game with my friend that runs in the Terminal/Command Prompt window, but I would like to know how to change the color of the entire window via C++. I'm on a Mac, but my friend is on a Windows, so I need to a solution that is portable, if possible.

I've tried using a printf statement to change the color, but it only changes the background color of the text being printed.

View 2 Replies View Related

C/C++ :: Change Color Of The Text And Background

Jul 7, 2014

I was trying to change the text and background color to :red blue

Is there a way to do this? is there a certain function? ...

View 1 Replies View Related

C++ :: Ways To Change Color Scheme Of Program

Aug 29, 2013

Alright so I'm in a computer programming class and I was given the following problem..Write a problem that takes an integer value and multiplies each of the digits together. 4 digit numbers only.

IE; What number do you want to process? 2684
Starting number 2684
End result 384

I know how to start the begging of the program, but i dont understand how to have it to where you can type in all four digits and then it will multiply each number by the other. Also, what are some ways to change the color scheme of the program? I know how it works using CMD, but in Visual C++ its totally different aha.

View 5 Replies View Related

C# :: How To Change Subitems Back Color Programmatically

Mar 18, 2014

I wanted to change the Backcolor of subitem to Red, while inserting data in Listview from List<string> result. After executing the below code Data from List<string> are well placed below their respective column in listview, only their Subitem Color doesn't change.

Here my Code

//Here result is List<string>
for (int i = 0; i < result.Count; i += 5) {
ListViewItem item = new ListViewItem();
item.Text = result[i].ToString();
for (int j = i + 1; j < i + 5; j++) {
item.SubItems.Add(result[j].ToString());

[Code] ....

View 14 Replies View Related

C++ :: How To Change Cell Text Color In QTableView

Jul 24, 2013

I've tried this (without success):

ui->tableView->model()->setData(ui->tableView->model()->index(5, 5, QModelIndex()), QVariant(QColor(Qt::red)), Qt::DecorationRole);

View 6 Replies View Related

C/C++ :: Change Background Color After Pressing A Key (Graphics)

Aug 5, 2013

Here is my code:

#include <graphics.h> 
#include <stdio.h>
#include <conio.h>  
int main()  {
    int gdriver = DETECT, gmode, errorcode,i;
initgraph(&gdriver, &gmode, "c:cgi");
errorcode = graphresult();

[Code] ....

View 1 Replies View Related

Visual C++ :: How To Change Background Color Of Messagebox

Jan 5, 2015

Here is what I did,

Code:
oldHook = ::SetWindowsHookEx(WH_CALLWNDPROCRET, CallWndRetProc, NULL, ::GetCurrentThreadId());

MessageBox(...);

UnhookWindowsHookEx(oldHook);

Then within the callback function CallWndRetProc, I tried to change the background color of the dialog,

Code:
PAINTSTRUCT ps;
HDC hdc = BeginPaint(msg->hwnd, &ps);
::SetBkColor(hdc, RGB(255, 0, 0));
EndPaint(msg->hwnd, &ps);

But it doesn't change the background color of the dialog. I wonder what is the right way to do that?

View 14 Replies View Related

C++ :: Clear Screen In Console - Change Text Color In EXE

Dec 28, 2013

How I can clear the whole screen in console...

And I'm using clrscr(); and its not working.

How i can change the text color in the .exe without using system function

View 4 Replies View Related

C++ :: Making A Menu System To Change The Color Of Pixels

Apr 10, 2013

im making a menu system to change the color of pixels in a gravity engine i made. the engine works fine, and the menu colors the particles, but will only ever turn them to red, no matter what color i tell it to change it to.

bool running = true;
bool colorChosen = false;
Uint32 particleColor;
Uint32 randomColor;

[Code]....

View 1 Replies View Related

Visual C++ :: Change Back Color Of Cell In ListView

Apr 2, 2013

I know how to change the back color of text in th ListView for all the View, but if I only want to change the back color of one cell i don`t find any way. Is it possible?

View 1 Replies View Related

Visual C++ :: Change Text And Background Color Of CComboBox?

Nov 26, 2014

I have a derived CComboBox class, where I tried to change text and background of edit from CComboBox, just like this:

Code:
HBRUSH CMyComboBox::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor) {
HBRUSH hbr = CComboBox::OnCtlColor(pDC, pWnd, nCtlColor);
// TODO: Change any attributes of the DC here
//if(CTLCOLOR_EDIT == nCtlColor || CTLCOLOR_MSGBOX == nCtlColor) {

[Code] ......

but is not working if CComboBox has CBS_DROPDOWNLIST style ... is working only for CBS_DROPDOWN style ... why ?

View 10 Replies View Related

Visual C++ :: How To Change Color Of MS Windows Button Control

Feb 20, 2013

I am writing a GUI application with C++ Visual component Libraries and Win32API under windows OS.

As part of this app, I have to change color of the MS Windows button control depending on the external state.

I understood, Win32 will not support changing button control color directly as it will not support for this.

how to change the button color?

View 2 Replies View Related

C++ :: Photoshop - Change Color Of Anchor Point In Transform Tool?

Aug 4, 2014

I was wondering if its possible to change the color of the anchor point in the transform tool.

Is this possible? Sometimes I'll move it and it takes forever to find it again on a dark image. The actual image of the cross hairs must live in the application contents somewhere? Or its made by script. After a quick search of "transform" I found this file.. Not exactly sure what I'm looking at inside but it appears to be c++ code? [URL] ....

SCREEN GRAB: [URL] ....
FILE: [URL] ....

View 1 Replies View Related

Visual C++ :: Change Default Text Attributes (font And Color)

Nov 12, 2013

I needed to change Default Text attributes (font and color) . So I wrote following code , UnicodeTextOut function. I called this function once in each 55ms to update the display screen. but I observed that my Screen used to become grey like a crash after sometime . If I use Minimize an Maximize window , the screen was restoring back for some time.

When I thought over the code , I got my mistake that CreateFont initialization should be done once in the program and probably outside the function.

void UnicodeTextOut(int x, int y, CString s, UINT justify,int GreyScaleFlag) {
HFONT hFontUnicode;
HFONT hfOld ;
hFontUnicode = CreateFont(16, 0, 0, 0, 0 , 0, 0, 0, 0, 0, 0, 0, 0, _T("Aerial"));

[Code] ....

Then I shifted the line hFontUnicode = CreateFont(16, 0, 0, 0, 0 , 0, 0, 0, 0, 0, 0, 0, 0, _T("Aerial")); in my screen class constructor and made hFontUnicode global .

This solved my problem as expected. Why a system crash after certain no of CreateFont calls ?

View 2 Replies View Related

C# :: Moving Listbox Selection To New Listbox In New Form?

Sep 11, 2014

Okay so i have everything right accept transfering the selectedindex from listbox in form1 to listbox in form2. I am using the below string item to hold the selected line of the list box, with the intent of recalling and then adding it into the form2 listbox. I get a not implemented error and i can't figure out why. I know the information is moving with the variable item, it just doesn't get printed out to the new listbox.

private void listBox1_SelectedIndexChanged(object sender, EventArgs e)
{
string item = listBox1.SelectedItem.ToString();
Form2 form2 = new Form2();
form2.Show(item.ToString());

[Code]....

View 13 Replies View Related

C# :: WPF Using Color Resource In Rectangle Stroke Color

Sep 7, 2014

Trying to define some global colors so I can use the one instance though-out my application. Here is my color code:

<Color x:Key="GlobalTextColor">#E0E0E0</Color>

But this color doesn't display in the list when I start to type {StaticResource ...}

This is the code where I'm trying to reference the color, see Stroke="{StaticResource GlobalTextColor}". GlobalTextColor doesn't actually come up in the list so won't work.

<Style x:Key="InputButton" TargetType="Button">
<Setter Property="Background" Value="#FF141414" />
<Setter Property="HorizontalAlignment" Value="Left" />

[Code].....

View 2 Replies View Related

C++ :: Coin / Money Change Code Doesn't Give Exact Change

Feb 20, 2013

My coin/money change code works when there can be an exact change each time, i.e. when the 1 cent option is available. However, when the change options are only $10, $5, $1, 25 cents and 10 cents, it does not give me what I want for instance, I wanted to get change for $237.80, I was expecting to get:

23 10's, one 5, two 1's and 8 dimes. However, the code below is giving me 23 10's, one 5, two 1's and 3 quarters (there is no option left for the 5 remaining cents).how to fix it?

Code:
#include<iostream>
#include<algorithm>
#include<vector>
using namespace std;
void change(double cents, int a[]);
int main() {
double Dollars;
double cents;

[code]...

View 14 Replies View Related

C# :: Using Array In Listbox?

Jun 2, 2014

My main form I have the following code

[ImportingConstructor]
public MainForm([ImportMany] IEnumerable<AudioPlugin> content)
{

[Code].....

However, when I add to the listbox as shown above in my main form code the results all show on the same line. My understanding was that they should all be treated as separate because of foreach loop but apparently that is incorrect. I have seen mixed things online some showing that its required to use AddRange instead of Add, however, after literally hours of trying to make this work I am still coming up with nothing. I can't seem to get any code to work using the AddRange or am I finding any way to output each results on a separate line.

View 7 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved