|
I need leave my textBox control only if I press three times the Tab key. I use this:
<br />
private void KKEditControl_Leave(object sender, EventArgs e)<br />
{<br />
this.Focus();<br />
}<br />
but it keeps focus in my textBox all the time. Please help me...
|
|
|
|
|
You need to count how much times he leaves.
try this:
<br />
int NumLeaves = 1;<br />
private void KKEditControl_Leave(object sender, EventArgs e)<br />
{<br />
if (NumLeaves%3 != 0)<br />
this.Focus();<br />
NumLeaves++;<br />
}<br />
This should work.
|
|
|
|
|
I tried to count but in different way - it doesn`t work.
Your way works great!
Thanks a lot!
|
|
|
|
|
i get a exception when i show a form
the exception is the "object is currently used elsewhere :
i dont get these kind of exception when i call a form by creating an object
what is the reason
|
|
|
|
|
Hello!
I am trying to implement a simple drag&drop ability for a ListView. It should just get the text of the selected subitem and drag its text. I tried this:
private void OnDataListItemDrag(object sender, ItemDragEventArgs e)
{
ListViewItem lvi = e.Item as ListViewItem;
if(lvi == null) return;
string strDrag = lvi.Text;
this.DoDragDrop(strDrag, DragDropEffects.Copy | DragDropEffects.Move);
...
The problem now is that the code above always gets the text of the item, not of the subitem. But the user should be able to drag cells, i.e. the subitems. The ItemDragEventArgs structure doesn't seem to have a SubItem member. I also cannot use HitTest here, as the mouse cursor position is incorrect at that time (user dragged the item already a few pixels before the event above is fired, therefore a hit test at that time could result in an incorrect item or column).
Any idea how to get the dragged subitem?
Many thanks in advance and best regards
Dominik
_outp(0x64, 0xAD);
and
__asm mov al, 0xAD __asm out 0x64, al
do the same... but what do they do??
(doesn't work on NT)
|
|
|
|
|
HI
I have a problem which is I need to know if I am connected to the internet or not... how I could do this through the code
so please help me
Tamimi - Code
|
|
|
|
|
Use TcpClient :
try
{
System.Net.Sockets.TcpClient tcpClient = new System.Net.Sockets.TcpClient();
tcpClient.Connect("www.microsoft.com", 80);
Console.WriteLine("Connected to internet");
}
catch(Exception ex)
{
Console.WriteLine("Not connected to internet");
}
|
|
|
|
|
its does not work , iam connected through a LAN.
does this mean anything ??
thank you
Tamimi - Code
|
|
|
|
|
That code works only if you are connected directly to internet.
If you have a proxy, then you must search for an article in
codeproject about using TcpClient with Proxy or WebRequest
using Proxy.
|
|
|
|
|
If you are connected via LAN, then you should always be connected, unless you only have a local INTRANET, which would explain why you couldnt get through. The code supplied would be a valid way to check for connection, however.
Aaron
|
|
|
|
|
I want to change the keyboard layout using c#, so i can write in arabic inside the text box.
In VC++ we used LoadKeyboardLayout what we use in C#
THanks
|
|
|
|
|
Use this is your code :
[DllImport("user32.dll")]
static extern IntPtr LoadKeyboardLayout(string pwszKLID, uint Flags);
|
|
|
|
|
hi all,
i have a button which binds some data to each other.
but if i double click on that button, i receive an error which says a previously binding exists.
how can i avoid this error ?
i mean: am i able to check if there is a databinding exists when i click on that button ? or am i able to collapse(or purge) the previously databinding when i click on that button ?
|
|
|
|
|
|
try to use
controls DataBindings.Clear() method
before binding specific control
rahul
|
|
|
|
|
hi all,
txtcaseNo.DataBindings.Add("number", dset13, "case");
txtrentstart.DataBindings.Add("date", dset13, "rentstart");
txtrentend.DataBindings.Add("date", dset13, "rentend");
txtrentduration.DataBindings.Add("number", dset13, "rentduration");
cmbCOHour.DataBindings.Add("date", dset13, "COHour");
txtcurrencytype.DataBindings.Add("text", dset13, "currencytype");
txtdailytotap.DataBindings.Add("number", dset13, "dailytotal");
txttotal.DataBindings.Add("number", dset13, "total");
this code gives an error like this: cant bind number ?
my database fields are :
number, date/time, date/time, number, date/time, text, number, number respectively. how should i change the first properties in binding (bold parts)?
help please,
thanks in advance.
|
|
|
|
|
i think what ever u have witten in bold letters are data types of coloumns
of table but u should put controls property to bind there
like if txtcaseNo is text box then data binding should be
txtcaseNo.DataBindings.Add("Text", dset13, "case");
where Text is text property of textbox to be bind.
rahul
|
|
|
|
|
i want to know how i can form a string if i have array of bytes. I want to display charcters in Chinese on the form.
|
|
|
|
|
System.Text.Encoding.Unicode.GetString(byte[] byte);
|
|
|
|
|
I don't know if this is the right board for this, if not I'm sure someone will tell me.
I am developing a C#.NET application for the market, which will be sold over the internet by making a trial version (with limits on facilities and use time) available free, and providing an unlocking mechanism on receipt of payment. All standard stuff - except I've never done it before.
Can anyone recommend a good guide to how to do this, or even a developers' toolkit for generating/recognising keys and all that stuff.
Dave
|
|
|
|
|
Watch this :
http://www.codeproject.com/cpp/softwarekey.asp
bye
-- modified at 6:26 Tuesday 6th June, 2006
|
|
|
|
|
|
I want to add my exe file shortcut to User's Desktop and User's program Menu in my Setup and Deployment Project. When I add this exe file that folders directly , my program can not be run. I think that program need DLL files. How can I solve this problem? So how can I add icon my exe file in Setup Project? Thank you for your answers....
This is my sign
|
|
|
|
|
when u add project output in application folder in setup & deployment
project u will see primary ouput from project name(Active) in application
folder,so right click on this item u will find create shortcut of primary output
option,on selecting it u will see shortcut of this primary output
and then u can move this shortcut to user's desktop folder and
user's programs menu folder
rahul
|
|
|
|
|
Thank you very much for tour help.
This is my sign
|
|
|
|