|
Yes, it is a multiline textbox. The code is not that big, you should be able to quickly understand what's going on. I only hope you're not planning to write your own user control, because then the purpose of me writing a user control will be lost
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
Thanks Senthil! As a matter of fact, I want to use your control for one of my applications. But I have seen one problem with that, I can't come out of the directory in which the testapp.exe is staying, i.e. as I start the application and type the following command.
>>> cd ..
it does not work. I woudl like to hear from you before I get into your code and figure out what is going on. And also I had asked this question in the forum and Nobody could answer me. Can I change the opacity of the control?
Regards,
Amit
|
|
|
|
|
amitmohanty wrote:
As a matter of fact, I want to use your control for one of my applicatio
Great
amitmohanty wrote:
I can't come out of the directory...
That's because the sample application that uses the control spawns a new shell (cmd.exe) for every command, so it doesn't remember previous commands. Hitting cd.. will make the current cmd.exe go up one directory, but then the next dir will run on a new cmd.exe and therefore would show the same directory.
If you want to, you can spawn a single cmd.exe and redirect output/input to just that single exe, that would do what you want.
amitmohanty wrote:
Can I change the opacity of the control?
I don't know if we can modify opacity for individual controls within a window, but you can try pinvoking SetLayeredWindowAttributes /
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
|
Thanks Zitniet
|
|
|
|
|
Does anybody know a quick routine to convert from numbers like "1000$" to "One thousand dollars"?
I need this to print invoices
Thanks in advance
|
|
|
|
|
Please don't post to every forum on the site. This is a common piece of homework, and so I'm sure you could find some code with google, although it's pretty straightforward to write. ( Yes, I understand you're saying it's not homework, I'm saying the fact that it often is increases the odds of a snippet existing online )
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
What happened to sharing?
I know it is straight-forward and I know it is given as homework to university students, but also know it will waste my time since it only deals with the basic programming operations...I'm trying to avoid going deep into things that are easy and take up a lot of time and was wondering if somebody could help...Right now i'm swammed in datagrid lousy events and too much SQL problems, I'd rather stick my nose into something else...that's all...
|
|
|
|
|
Please send me your email i will send you an example numbers to letters. Ok
....
Muhamad Waqas Butt
waqasb4all@yahoo.com
|
|
|
|
|
|
ok All Right Buddy.....
Muhamad Waqas Butt
waqasb4all@yahoo.com
|
|
|
|
|
Hadi Fakhreddine wrote:
What happened to sharing?
What do you mean ?
Hadi Fakhreddine wrote:
but also know it will waste my time since it only deals with the basic programming operations...
I don't *have* an example here, I was just suggesting that you would find one easily. If I had one, I would have posted it. I see you followed my advice anyhow, and found an example online.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
I have a nifty little application that doesnt have any fancy controls etc. embedded in it. However, when i run the program it uses up a whopping 16MB or RAM. I was expected something more on the lines of 2MB. How can i decrease the overhead?
|
|
|
|
|
Use C++
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Where did you see the 16MB value? TaskManager? Which column??
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
I saw the value in the column labelled 'Mem Usage'. Is that the RAM usage? If not, which is the appropriate column to watch?
|
|
|
|
|
It doesn't really matter because you can't get rid of that footprint anyway.
Even though you see in Task Manager that your app is consuming 16MB of RAM, it doesn't mean that your actually using it. Since the .NET Framework execution environment is a virtual machine, the memory manager in the Framework RESERVES a chunk of memory for your app to use. (There's also the overhead of the .NET Framework too, so you're not going to be able to get rid of that!)
Your app isn't actually using that much memory. It's just there so you have a pool of MANAGED memory for your app to use. If you exceed this pool, the .NET memory manager will grab some more memory for the virtual machine. The opposite is also true. If Windows needs some of that memory back, and your app isn't using it, the .NET memory manager will drop a chunk of memory out of it's managed pool and release it back to the system.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I have a textbox on my form. Now, I want to find which key was pressed in the textbox. I mean i want to find which key pressed including Function keys F1, F2, etc...Modifier Keys like SHIFT, CTRL, and ALT. How can I do this.
|
|
|
|
|
I looked up on Google and I found a post on a forum that said taht you have to use the System.Threading.Thread.Sleep(int milliseconds). Howecer, when i do this the UI hangs. Basically, what I'm trying to accomplish here goes like this: I have a for loop and between loop iterations i wish to put a 5 second delay. Now what?
|
|
|
|
|
Mridang Agarwal wrote:
looked up on Google and I found a post on a forum that said taht you have to use the System.Threading.Thread.Sleep(int milliseconds).
Bizarre. This is a pile of bull. Why would you have to sleep to get a key event ? But good for you for trying to find the answer all the same.
Mridang Agarwal wrote:
I have a for loop and between loop iterations i wish to put a 5 second delay. Now what?
Oh, this is a different question ? Yes, Thread.Sleep is your answer, but it stops your app running, obviously. The other possibility is to put this code in a thread, so only that thread sleeps, or create a big old ugly loop that uses datetime.now over and over, and calls Application.DoEvents. Why do you want your app to sleep for 5 seconds ?
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Oh !#$#. What he hell did I just post? That was a big goof up. I was posting a reply to another post and I accidentally posted it here. Sorry!
|
|
|
|
|
If you catch the KeyPressed event, you get a different event args to KeyDown/KeyUp. There's another event for control keys as well, I think. You can also call GetAsyncKeyState via pinvoke, for full control over what control keys are down, etc, during any keyboard event, or anywhere in your code, for that matter.
KeyDown/KeyUp have the properties to say if a control key was pressed, KeyPressed actually gets a different key code ( in the range 0-25, I *think* ) if Control is also down.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
i got the solution finally. I put the in the textbox_KeyUp event and wrote e.Keydata.ToString();
|
|
|
|
|
You'll simply need to handle the "KeyDown" event of the TextBox like so:
Just put a similar code in the KeyDown event of the TextBox:
If e.KeyCode = Keys.Enter Then<br />
'Whatever you wanna do<br />
End If
The keys F1, F2, etc... are also present in the Keys enumeration (Keys.F1, Keys.Tab, Keys.a, etc...)
PEACE!
|
|
|
|
|
how are you my friend .
listen my friend about handling the keydown event is not useful and wasting time if you try to handle it through your keydown event handling cause you will need to nest alot alot of if statements and switch keywords and it is not practical you need something like keylogger code to log any keys pressed even if your form is activated or not then you can handle the specific key when it is pressed like the following code :-
<br />
<br />
<br />
system.Runtime.InteroServices;<br />
<br />
[Dllimport("User32.dll")]<br />
Public static extern short GetAsyncKeyState(System.Windows.forms.Keys vkey);<br />
[Dllimport("User32.dll")]<br />
public static extern short GetAsyncKeyState(System.Int32 vkeys);<br />
<br />
System.Timers.Timer mytimer;<br />
System.String KeyBuffer;<br />
<br />
Private void mytimer_Elapsed(object o , System.Timers.ElapsedEventargs args)<br />
{<br />
foreach(System.Int32 i in Enum.GetValues(typeof(Keys)))<br />
{<br />
if(GetAsyncKeyState(i) == -32767)<br />
{<br />
keybuffer += Enum.GetName(typeof(keys),i);<br />
TextBox.Text += KeyBuffer;<br />
Keybuffer = "";<br />
}<br />
}<br />
}<br />
public YourKeyLogger()<br />
{<br />
mytimer.Elapsed += new ElapsedEventHandler(this.mytimer_elapsed);<br />
}<br />
I hope the code can do the work for you
Thanks my friend
Miss With The Best And Die Like The Rest
|
|
|
|