|
Search Codeproject or the web for System.Windows.Forms.ControlStyles.DoubleBuffer, it will get rid of the 'flashing'/flicker when you draw to a windows form.
Tech, life, family, faith: Give me a visit.
I'm currently blogging about: Conversation With a Muslim
Judah Himango
|
|
|
|
|
Add these 3 lines to your form constructor
// Enable Double Buffering to remove flicker
this.SetStyle(ControlStyles.AllPaintingInWmPaint, true);
this.SetStyle(ControlStyles.UserPaint, true);
this.SetStyle(ControlStyles.DoubleBuffer, true);
Hope this helps
Publicjoe
C# Tutorial at http://www.publicjoe.f9.co.uk/csharp/tut.html
C# Ebook at http://www.publicjoe.f9.co.uk/csharp/samples/ebook.html
VB Tutorial at http://www.publicjoe.f9.co.uk/vbnet/vbnet.html
VB Ebook at http://www.publicjoe.f9.co.uk/vbnet/samples/ebook.html
Mirrors at http://dowhileloop.com/publicjoe/ and http://publicjoe.dowhileloop.com
|
|
|
|
|
Or better yet, a single line, with the flags OR'd together:
this.SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.UserPaint | ControlStyles.DoubleBuffer, true);
Tech, life, family, faith: Give me a visit.
I'm currently blogging about: Conversation With a Muslim
Judah Himango
|
|
|
|
|
Just imagine I want to create an Order ID. How can I create a unique Order ID that may look something like P123J2K or atleast like 938470 ??
The only way I know is: to start the Identity of the Order table at e.g. 10000; OR to use Guid. But Guid creates a 30+ character ID, which is too long for an Order.
So is there any better way to create Order IDs, specially without connecting to DB.
|
|
|
|
|
well Hasan
as far the auto creation is concerned as you said you have identity or unique GUID. in other case you need to do some custom logic to build the orderID. like use triggers in SQL and customize the number according to your need. or if you need some thing unique without connecting to database the do this
for e.g Use Machine name as a key to make it different from other computers. then date and time to make the orderID like this
variableName = datetime.now + System.Environment.MachineName
if customer is registered then you can also use customerID to make it more convinient
over to you....
|
|
|
|
|
Rizwan sahib, thanks for different ideas.
|
|
|
|
|
hi all,
This is simple question..But I don't know..
I want to hide the C# Application when openning it.
I applied in main Windows Form like this:
private void Form1_Load(object sender, System.EventArgs e)
{
this.Hide();
}
But Window is not HIDE..
can any body help?
thanks in advance..
|
|
|
|
|
I've had that problem before also...
/\ |_ E X E GG
|
|
|
|
|
Try to set the Visible property to false in the constructor of the form and see if that helps.
|
|
|
|
|
two ways
1. create one public procedure with any name say "LoadForm()" in that form and put all the code from load event to this procedure
and instead of calling
frm.show call frm.loadForm()
2. try this in activate event of the form write
this.Hide();
|
|
|
|
|
Instead of putting this code in the Form.Load event, override the OnLoad method of your form and put it in there. You have much greater control over the form visibility that way.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Probably the cleanest hack: Set the application to start minimized. Also specify that your application doesn't show in the taskbar.
Alex Korchemniy
|
|
|
|
|
I use a RichTextBox to load a "*.txt" file. But I can't find out which font to use for the text to be display correctly!
(the text is written in Vietnamese, and the true font name is "VNI-Times", but how to know it programatically?)
And one more question: how can I read a Word file, and display it correctly? (can it displayed in RichTextBox control?)
please help me, thanks!
|
|
|
|
|
I'm not sure I understand what you mean here. A text file contains no information about any fonts or other formatting. A txt file only contains a bunch of characters so the font you choose to display the text with is completely up to you. There simply doesnt exist any information about a font to a text file.
|
|
|
|
|
Text files don't contain ANY font information, so there's no way top tell what font was used to write the text file with.
Word has an EXTREMELY complicated file using a multiple-stream file format. There is documentation on older versions of Word on the 'Net somewhere (I can't remember where through). Just Google for "Word File Format". Not everything is covered, so there will be parts of the file you cannot read, and therefore, cannot render correctly.
A RichTextBox CANNOT be used to display a Word file. The RTB control knows nothing of the Word file format.
You have a few options:
1) Use Word to load and display the file
2) Use a commerically available 3rd party component to load and display the file. (Don't know of any myself.)
3) Use Word to save the file in RTF format so it can be loaded into a RichTextBox. (Least desirable because some formatting is lost.)
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
involved in developing a windows service. after doing build solution, got the exe in the release folder of the windows service. using Installutil tool i installed the service too. and got the messgae "The transacted install has completed." in vs.net command prompt. but the problem is that am unable to see those services in Administrative tools in the services section.
kindly help me out.
|
|
|
|
|
did you restart the system ?
|
|
|
|
|
i rebooted the system but stil unable to see...........
|
|
|
|
|
We probably need more information to be able to help. Like what you did with the installers and such.
|
|
|
|
|
using service installer am able to create service and able to see in the services. but its not running saying "the services on the host started and stopped. some services automatically stopped beacuse of no work to do like alerts"
|
|
|
|
|
That error usually means that an exception occured in the service when the service tried to start. See if you can build the service and run it as a winforms application or a console application and try to find what is causing the error. Alternatively you could use exception handling and write all exceptions to a file or to the windows log. That way you might be able to find what is causing the service to stop when trying to start.
|
|
|
|
|
I encountered the same error once. My Windows Service was a accessing the network and I made it a local Service. If you're doing the same.. try making it a network service..
Regards
|
|
|
|
|
Could it be that you have .NET 1.0 AND 1.1 on the same machine?
I've experienced some weird effects when I had developed a .NET 1.1 (VS2003) windows service and calling "installutil" from the commandline picked the executable from .NET 1.0.
Try calling installutil with the full path (...\Microsoft.NET\Framework\v1.1.4322\...) and see if it helps.
Regards,
mav
|
|
|
|
|
I would like to know how & where to connect my C# application in order to get the latest & updated currency rates in my C# program.
Jassim Rahma
|
|
|
|
|