Hi all
I have a program, which I can do and in that program the user can enter information if he had missed to enter it in the required field and he must to be informed about this option.

//verification of the PIN
	Edit6->Text = "";
	int digits[10];
	AnsiString egn = Edit5->Text;
	if(egn.Length() != 10)
	{
		Edit6->Text = "It should be limited to 10 digits PIN!";
		Edit5->SetFocus();
		Edit5->Text = "0000000000";
		Edit5->SelectAll();
	}
	else
	{
		for(int i = 1; i<=10;i++)
		{
			AnsiString s = egn.SubString(i,1);
			digits[i-1] = atoi(s.c_str());
		}
		checkEGN(digits,10);
	}
   //	/добавяне
if (Edit1->Text != "" && ComboBox1->Text != "" && ComboBox2->Text != ""
   && Edit2->Text != "" && Edit4->Text != ""  && ComboBox3->Text != ""  ) {
  ListBox1->Items->Add(Edit1->Text + " " + ComboBox1->Text + " "
   + ComboBox2->Text + " " + Edit2->Text + " " + Edit3->Text + " " +
   Edit4->Text + " " + Edit6->Text + " " + ComboBox3->Text + " " + Edit7->Text );
}
  else
Label11->Caption = " *  ";
Label12->Caption = " *  ";
Label13->Caption = " *  ";
Label14->Caption = " * Required field! ";
Label15->Caption = " *  ";
Label16->Caption = " *  ";

Edit1->Text;
Edit1->SetFocus();


}

when I enter data appears "*" and it should not.How to do it?

Recommended Answers

All 12 Replies

Your else clause needs some braces.

else
{
//code goes here.
}

thines01 Thank you!
"*" how to make them become red.Turbo c++ 2006

Hi,
Have you got answer for your question?

BR/ KMat

thines01 Thank you!
"*" how to make them become red.Turbo c++ 2006

KMat, there is a second question on the table.
If you have an answer for the color question, please submit it.
Otherwise, it looks like you are trying to get credit for a question you did not answer.

Hi thines01,

I just thought to know whether my understanding of the question and answer are correct or not. Thats why I had posted that question.

PS: I am new to this Forum and not aware of much about these credits and all.
So credit is not my motivation for that question.

Happy New Year.

Br/ KMat

KMat, there is a second question on the table.
If you have an answer for the color question, please submit it.
Otherwise, it looks like you are trying to get credit for a question you did not answer.

@KMat: I understand.
At this point (since I'm not familiar with the Borland compiler) I will do some Bing/Google searches to see what I can find and then post it here.

Now, if you'd like to look up setting foreground color for a Windows form using a Borland compiler, please do (and post the results here). :)

For coloring text in turbo c++,
use the textcolor() function which is found under conio.h

For bright red use textcolor(12) and for dull red/dark red/maroon use textcolor(4)

Guys, is the problem solved ?

adityatandon thank you!
Happy new year ! :)

Your Welcome !! Same to you man..
Oh n yea, i've forgotten to mention, that textcolor() doesnt work with cout and you'll have to use cprintf() with it as textcolor() is a part of the C library and cout is part of c++ !!

adityatandon hi
I've found another way in which the text is red, but it turns labels in red.
This will work :)

Nice, so problem solved !!

------------------- Closed -------------------------

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.