|
i need creating a database myself,i need make a database from scratch , can u give me some help please?
ert
|
|
|
|
|
Why make a database when you can obtain free or shareware databases. Also, there are all kinds of databases such as relational, identity relational, xml and object based. Anyway, you are not going to get much help here because you are not specific. Creating a database from scratch is a great endeavor.
|
|
|
|
|
Thanks for u to trying to help me. i just got the project from the college about using c++ to make database application. i really have no idea even how to start it,just want to do some research first. I hope i could get any information for it. thanks !
ert
|
|
|
|
|
Are you creating a database, or using one ? Are you using the .NET framework to do it, or are you asking in the wrong forum ?
Christian Graus - C++ MVP
|
|
|
|
|
Thanks for u to trying to help me. i just got the project from the college about using c++ to make database application. i really have no idea even how to start it,just want to do some research first. I hope i could get any information for it. thanks !
ert
|
|
|
|
|
OK, well, a good start is to answer my questions. I can't comment further without your answer. Are you using C++ with .NET or are you in the wrong forum. Do you need to make an app that uses a database, or do you need to write a database engine ? If the former, what are you allowed to use ( Access/Oracle/SQL Server/ MySQL/ etc ? )
Christian Graus - C++ MVP
'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert
|
|
|
|
|
|
This is the OnPaint function in my progressbar-class:
virtual void OnPaint(System::Windows::Forms::PaintEventArgs^ e) override
{
Graphics^ g = e->Graphics;
SolidBrush^ brush = gcnew SolidBrush(progressBarColor);
float percent = (float)(value - minimum) / (float)(maximum - minimum);
Rectangle rect = this->ClientRectangle;
// Calculate area for drawing the progress.
rect.Width = (int)((float)rect.Width * percent);
// Draw the progress meter.
g->FillRectangle(brush, rect);
// Creating font for progresstext
System::Drawing::Font^ drawFont = this->Font;
// Creating brush
System::Drawing::Brush^ drawBrush = System::Drawing::Brushes::Black;
// Creating string format
System::Drawing::StringFormat^ strFormat = gcnew System::Drawing::StringFormat();
// Center text
strFormat->Alignment = StringAlignment::Center;
strFormat->LineAlignment = StringAlignment::Center;
// Drawing string on top of progressbar
g->DrawString(this->percentCompletedText,drawFont,drawBrush,this->ClientRectangle,strFormat);
// Draw a border around the control.
DrawBorder(g);
// Clean up.
delete brush;
// Can not use despose Graphics object when using DoubleBuffer
//delete g;
}
Now my progressbar have a percent completed written over it in black all the time. How do i get the color of the text to change or invert when the progressbar passes over it?? I have been looking around on the web for this task but I can't find other then MFC code in native C++. How is it done with managed C++ or C#??
|
|
|
|
|
In exactly the same way - work out what portion of the bar is covering the text, and draw that text with a different color.
Christian Graus - C++ MVP
|
|
|
|
|
How do I draw half a word (my percent completed for example) in a different color???
How do I get the invert effect??
|
|
|
|
|
Actually, what you probably want to do is draw your string on the progress bar, then draw the string in the other color on another bitmap, which has the background color of the selected bitmap, then you copy that bitmap across to create the selected area.
Christian Graus - C++ MVP
|
|
|
|
|
Could you give a code sample because I don't fully understand how you mean?
Thanks in advance!
|
|
|
|
|
I'm sorry, I don't have the time to write this for you. But, it's very simple. Say the progress bar is 48% full. You draw your string on the bar, on the 'unselected background'. You create a bitmap, the same size as your bar, fill it the 'selected' color, and draw the same text, in the same spot, in the 'selected' color. Copy the first 48% of that bitmap over your progress bar. The text will line up, and be the right color on each side of the progress mark.
Christian Graus - C++ MVP
|
|
|
|
|
Okey I came up with this:
virtual void OnPaint(System::Windows::Forms::PaintEventArgs^ e) override<br />
{<br />
SolidBrush^ progressBarBrush = gcnew SolidBrush(this->progressBarColor);<br />
Rectangle barRect = this->ClientRectangle;<br />
barRect.Width = (int)(barRect.Width * this->percentCompleted);<br />
Graphics^ gLayer1 = e->Graphics;<br />
Bitmap^ bmpLayer2 = gcnew Bitmap(this->Width,this->Height,gLayer1);<br />
Graphics^ gLayer2 = Graphics::FromImage(bmpLayer2);<br />
gLayer2->FillRectangle(progressBarBrush, barRect);<br />
<br />
if(this->showTextOnProgressBar == true)<br />
{
SolidBrush^ textBehindBrush = gcnew SolidBrush(this->textBehindProgressBarColor);<br />
SolidBrush^ textInFrontOfBrush = gcnew SolidBrush(this->textInFrontOfProgressBarColor);<br />
System::Drawing::Font^ drawFont = this->Font;<br />
System::Drawing::StringFormat^ strFormat = gcnew System::Drawing::StringFormat();<br />
strFormat->Alignment = StringAlignment::Center;<br />
strFormat->LineAlignment = StringAlignment::Center;<br />
gLayer1->DrawString(<br />
this->progressBarText,<br />
drawFont,<br />
textBehindBrush,<br />
this->ClientRectangle,<br />
strFormat<br />
);<br />
gLayer2->DrawString(<br />
this->progressBarText,<br />
drawFont,<br />
textInFrontOfBrush,<br />
this->ClientRectangle,<br />
strFormat<br />
);<br />
}<br />
<br />
<br />
gLayer1->DrawImageUnscaledAndClipped(bmpLayer2, barRect);<br />
<br />
DrawBorder(gLayer1);<br />
<br />
<br />
}
Is this how you meant??
Any feedback on the code??
|
|
|
|
|
Yep, that looks like what I meant.
Christian Graus - C++ MVP
|
|
|
|
|
Thanks a lot, Christian, for helping me!
Now I got my wholly Managed C++/CLI progressbar with text on it. And I did not have to use any unmanaged functions like BitBlt() or other... that's appreciated a lot!
Thanks again for the help, you have been very helpfull!!
|
|
|
|
|
NO worries, glad to help out.
Christian Graus - C++ MVP
|
|
|
|
|
I've been trying to add a progress bar to a web browser window, but as far as I can tell, webBrowser_ProgressChanged is never being called.
private void webBrowser1_ProgressChanged(object sender, WebBrowserProgressChangedEventArgs e)
{
warnLabel.Text = "webBrowser1ProgressChanged was called.";
}
The really odd thing is, I downloaded a full web browser example, ran it, and the progress bar isn't working on that either. Thank you in advance for your help...
|
|
|
|
|
my name is fafa and i live in iran im study computer enginering and cant speake english very well . i have a project .design a web site by c#.net .
if it possible mail me this project code.
thanks.
my mail is:mamoosh_1990@yahoo.com
|
|
|
|
|
1 - This is not the C# forum
2 - YOU have a project, we don't.
3 - We don't do people's homework for them, and if we did, it would not be helping them
Christian Graus - C++ MVP
|
|
|
|
|
I am a new user to this site. I need to to know that how to convert a database file may be in access or in SQl in to html file.if anybody can help me in this
regards
shriya
|
|
|
|
|
You want to do this in Managed C++, or you're just asking in the wrong place ?
How do you expect to convert it to HTML ? The most obvious way is to read the data from the database, and set the result as the datasource of a GridView or DataGrid, which will show the data in a HTML table.
Christian Graus - C++ MVP
|
|
|
|
|
Well, ofcourse, all of us people on this forum are in cahoots and know that it would take us only two or three lines of code to solve all your problems. None of us will however, and that is out of organised pure baddness.
As an alternative, try your exam again in a few years time, but start with reading a few books.
Brian Kernighan and Dennis Richie wrote a very good one. Look for names like PJ Plaugher , Stephen Hewitt, Matt Pietreck, and others. Then come back with real questions.
LateNightsInNewry
|
|
|
|
|
|
First step - ask in the right forum
Second step - explain why you want to use a #define, and why you think replacing every instance of the number 1 with a string in your code is a good idea ( with luck, the compiler is stopping you from doing this )
Third step - when you ask for help, tell us the error you are getting.
|
|
|
|