|
suppose in a string var ="abc" values i want that Keyboard automatically type this string in TextBox
plz tell me how its possible
|
|
|
|
|
Don't cross post.
It's not necessary to be so stupid, either, but people manage it. - Christian Graus, 2009 AD
|
|
|
|
|
Your question seems a little confused.
To put the value of the variable var into a textbox programatically just set the text property e,g, myTextbox.Text = var .
If your question is about sending keypresses to another application outside of your control you can use the SendMessage[^] API to programatically do anything to any identified window. That is not simple though.
If you have knowledge, let others light their candles at it.
Margaret Fuller (1810 - 1850)
www.JacksonSoft.co.uk
|
|
|
|
|
I am creating a program in VB.net (VS2005)
I want to know that how to dispose all objects used in my program while closing the program.
Thanks.
Gagan
|
|
|
|
|
You enumerate through your objects and call Dispose on them.
Seriously, your question about shutting down is not answerable because we have no idea what your code is doing, how the app is written, what your code does in the event of a shutdown request, ...
What is the main purpose of the app and how is the engine that provides this functionality written??
|
|
|
|
|
Some objects have a .Dispose method which you can call.
Also, you can set the object to "nothing", which will indicate to the garbage collector that the object is no longer referenced.
For example:
myObj.dispose() ' only if supported
myObj = nothing ' indicate that the object is no longer referenced
|
|
|
|
|
David Mujica wrote: Also, you can set the object to "nothing", which will indicate to the garbage collector that the object is no longer referenced.
that is completely irrelevant when the app is about to shut down as the OP stated.
Luc Pattyn
I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages
|
|
|
|
|
When an app shuts down, the Operating System recovers memory allotted to that app. So you don't have to worry about it. Modern operating systems (including Windows) are pre-emptive, i.e., they don't need the permission or co-operation of the applications to recover memory.
|
|
|
|
|
Also, all .Net finalizers are run while the application shuts down.
|
|
|
|
|
Not necessarily. The runtime host can decide whether to run finalizers or not during application shutdown.
|
|
|
|
|
Hi all...
I have created a program that checks system's processor's ID and some registry keys before starting. After that it works in background.
The problem is here that when the program is in execution and I am trying to shutdown my system then my system is not shutting down and the problem is that Windows is unable to kill my program's execution forcefully or something like that. How to solve this problem, suggest me.
Thanks.
Gagan
|
|
|
|
|
did you do anything special to get that?
is your app windowless?
maybe SystemEvents.SessionEnding could help you out.
Luc Pattyn
I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages
|
|
|
|
|
Well, I am getting processor's ID by importing System.management namespace and bye creating objects of ManagementObject and ManagementObjectSearcher and getting registry keys by using my.computer.registry class.
Could you explain me your solution or do you have any piece of code?
Thanks.
Gagan
|
|
|
|
|
use Google to research; you might find things like this[^].
Luc Pattyn
I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages
|
|
|
|
|
hi man,
sounds like you have override the OnClosing / OnClose functions. And in there you set the EventArgs.Cancel to true?!?
if you do this you need to check the CancelEventArguments for a CloseReason.
in that case cast the CancelEventArgs to FormClosingEventArgs and check the Property CloseReason for CloseReason.WindowsShutdow,etc.. before setting args.Cancel to true.
hope i could help
bless
|
|
|
|
|
can you help me how to use DTPicker in visual basic.
my system is reservation of lcd. i dont know the codes when im going to assign a date and time. for example im going to reserve an lcd for tomorrow and time. what codes will i use?? using DTPicker.
|
|
|
|
|
You really seem to be lost. The user would choose the dates as the next day. Now, to get that date in your code, you can use the value or text property of the datetimepicker.
It's not necessary to be so stupid, either, but people manage it. - Christian Graus, 2009 AD
|
|
|
|
|
Hello,
I want to create a folder on vista machine using vb.net or C#. and make it share. and one more task is make it full access control for network users.
can any one suggest how i do this.
Thanks
~Khatri Mitesh
khatrimitesh@hotmail.com
Bikaner (Rajasthan)
INDIA
http://www.youtube.com/watch?v=-oJaaPCrk3Q
|
|
|
|
|
Look into DirectorySecurity class. That will help you. I guess it has a setaccesscontrol method which might be of your interest.
It's not necessary to be so stupid, either, but people manage it. - Christian Graus, 2009 AD
|
|
|
|
|
eg in msdn
Private Sub LoadNewPict()
' You should replace the bold image
' in the sample below with an icon of your own choosing.
PictureBox1.Image = Image.FromFile _
(System.Environment.GetFolderPath _
(System.Environment.SpecialFolder.Personal) _
& "\Image.gif")
End Sub
but when i set up a smart machine project, "image.fromfile" is not supported
Is there any other method to do it?
thanks a lot~
|
|
|
|
|
Image.FromFile is the only method I know of to load a bitmap from a file. Do you have the right dlls imported ? System.Drawing, I believe.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
There are at least three ways of getting an image from a file:
- Image.FromFile()
- Image.FromStream()
- Bitmap(filename) constructor
AFAIK the third one exists on all platforms.
Luc Pattyn
I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages
|
|
|
|
|
Hi All,
I am facing a weird kinda problem. Can't figure the solution. Here is the problem.
I have a string "FLAMES". This is a fixed string. I want to start counting the string characters till it reaches the value of an integer 'n' say the value of n = 7.
So what I is want is the code to start counting from F,L,A,M,E,S now at n = 6 the string finishes, so n = 7 will be "F". Now at the last count of n whatever alphabet is there it should get scrapped off. In this case "F" gets scrapped off. The reamining string is "LAMES".
Then restart the count from "L" till n = 7 and this time the alphabet that gets scrapped will be "A", the remaining string is "LMES"
Again restart the count from next character which in this case is "M".
Repeat this procedure untill there is only one alphabet remaining in "FLAMES". In this case of n = 7 it should be "E"
Can anybody help in this? I'm really stuck at this.
Thanks in advance for any help.
Manik
|
|
|
|
|
Sounds like some incredibly simple homework to me. We're not going to do it for you, you have to try yourself. It's set so you can learn, not because the world needs this program to exist. So, what have you tried ? Think about the task, think about how to logically break down the steps you want to take. If you're stuck when you bothered to try yourself, you might post code here and ask a SPECIFIC question.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Here is a tip...
SubString
Steve Jowett
-------------------------
Real programmers don't comment their code. If it was hard to write, it should be hard to read.
|
|
|
|