|
It is not a windows form app
I have this app (Game) I want to be able to design a caht dialog box that act as a CHAT during the game betwwen two PCs. I want it to be invoked by pressing ENTER on the keyboar the I write some chat stuff the I press ENTER agin to send the message to other PC
Ps. Your site is an intersting one
Good luck
After all, Today is the Tomorrow you worried about Yesterday
|
|
|
|
|
Try a keyboar hooker, as I remeber in CP you can find minimum 2 in C# .
|
|
|
|
|
As the other poster said, look into Windows hooks, there's an article here[^] with an example. Using hooks, you can listen for all keyboard activity on the system.
Tech, life, family, faith: Give me a visit.
I'm currently blogging about: Conversation With a Muslim
Judah Himango
|
|
|
|
|
how can i remove flicker from my program .. i am trying to make a simple game of tettris (don't know how to spell it correctly). i have to move a shape from top to bottom so my control is doing this for me .. logic i m using is simple ( i think it is) i m using paint function of my control just to fill a perticular block whose value is 1 and and empty whose value is 0 so i need to call paint function after every some time. but Invalidate function is creating flicker. is there any other way i can use or i i can paint some shapes constantly without using paint function ?? i have tried to use some other my own written function but they are not working until i call 'em from paint function of my control what should i do..
|
|
|
|
|
|
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"
|
|
|
|