|
Hi Jimbo,
Comment the following line
<br />
this.comboBox1.DrawMode = System.Windows.Forms.DrawMode.OwnerDrawFixed;<br />
<br />
this.comboBox1.DrawMode = System.Windows.Forms.DrawMode.Normal;
the code will work.
In case if you are unable to get the result. Do revert back.
Regards,
Jay
|
|
|
|
|
I am making a screensaver of sorts and I am trying to detect when p,P, or escape key is pressed. When i would hit p the screensaver would stop but upon hitting p again it should have started up again but had no response so i changed it to this.
construct...
this.KeyUp += new KeyEventHandler(OnKeyPress); ...
public void OnKeyPress(object o, KeyEventArgs e) {
switch(e.KeyCode) {
case Keys.Escape:
Application.Exit();
break;
default:
break;
}
}
all the examples i was able to locate show using a frikin textbox... i just want the form to check and handle necessary actions required.
codemonkey
aspiring programmer
|
|
|
|
|
Hi
I do not know if I'm get it right but from what you say :
there is property of the form which when you set it to true also the form keypressed and key up key down raises .
frmMain.KeyPreview = true ;
then you can use form 's event to handle what you want.
|
|
|
|
|
Hi, im trying to get a image from a path.
foto is a string path espec. by the user.
FileStream f = new FileStream( foto, FileMode.Open ); <br />
Image img = Image.FromStream( f );
This doesnt working, its only works if the image is in the same folder of the program =/
Thanks.
|
|
|
|
|
Hi, im trying to get a image from a path.
foto is a string path espec. by the user.
FileStream f = new FileStream( foto, FileMode.Open ); <br />
Image img = Image.FromStream( f );
This doesnt working, its only works if the image is in the same folder of the program =/
Thanks.
|
|
|
|
|
MoOnBoY wrote:
Image.FromStream( f );
I think there is a better way!
Just use:
Image img = Image.FromFile("C:\\...");
Oh, and a little correction:
This doesnt working, its only works if the image is in the same folder of the program.
This doesn't work. Its only working if the image is in the same folder as the program.
;);) Just kidding ;););)
Good luck!
|
|
|
|
|
The path is specificated by the USER...
foto is the path, if I use: Image img = Image.FromFile( foto ); Only works if the path is the same of program folder....
|
|
|
|
|
Let's say we have a textBox called textBox1 .
And let's say we hava a picture box called pictureBox1 .
We use pictureBox1 to view the image.
The user types in the CORRECT path.
The user clicks on a button.
And now the button's OnClick event:
Image img = Image.FromFile (<font color=#0000ff>this</font>.textBox1.Text);<br />
<font color=#0000ff>this</font>.pictureBox1.Image = img;
Then add an error handling with TRY and CATCH.
I've already tested this code.
It MUST work.
|
|
|
|
|
If the path is specified by the user then use
Image img = Image.FromFile ( @foto );
|
|
|
|
|
as i understood that u ve image and u want to open it from stream file...
1-u cant use Image class as it is abstract one, so u cant define object from it
2-u use Bitmap class to open ur image
//example: dont forget to use (Using System.Drawing)
Bitmap myimage=new Bitmap(filestream,true);
//constructor use true to make error correction..hope it works
|
|
|
|
|
Hello,
I'm developing some windows based application. I have made a setup to deploy the application to some other computer. I want to deploy an application for only 15 days. Or you can say that i want to deploy an application as trail version of 15 days for testing purpose. After 15 days, application should be stoped working automatically. Hopefully, someone will understand my question and will reply me as soon as possible.
Thanks.
|
|
|
|
|
IF your are asking a question like this, i doubt anyone would buy the app. :\
|
|
|
|
|
Infact, i have to deploy the application for testing purpose to the company before the final deployment. So instead of giving me this answer, reply me the solution.
Thanks.
|
|
|
|
|
There are multiple ways and there are also a multitude of companies that make a living off of providing this type of solution. I don't think there is an easy solution that can be posted to the forum.
The easiest way would probably be using a registry key added upon instalation and some code in the app that checks the key and compares a date against a certain period of time.
Here are some long list of companies providing ready made components. I only see one open source one but there may be more.
http://dmoz.org/Computers/Software/Licensing/License_Management/
http://dmoz.org/Computers/Security/Products_and_Tools/Software_Protection_and_License_Control/
--------------------
It is what is is!
|
|
|
|
|
there are C++ examples, such as Nish's one[^] that do what you are asking, maybe you can port those over to C#.
To those who didn't make it, we will remember you. To those who did is back. - Megan Forbes in Black FridayAnother Post by NnamdiOnyeyiri
|
|
|
|
|
Hi
Is there any method by which I can make an app transparent...like even if it appears(not completely transparent), it should not respond to mouse clicks (say if the ctrl key wasnt pressed along with a mouse click) and should transfer the ctrl to the app behind it...
Example:
Letz a scoreboard display and behind it IE...u dont need any user triggered event for it...so even if i click in the display, IE should respond and not the display..
Is there any method in C#?
Thanks
|
|
|
|
|
Oh most definately, there is a property in the System.Windows.Forms.Form class! Make a form with these properties:
/////
this.TransparencyKey = System.Drawing.SystemColors.Control;
this.Opacity = .8;
/////
Setting the TRANSPARENCYKEY to that will make the form seem invisible. Not visibly, but... like you said, it makes it so when the user clicks, it responds to whatever is running behind it.
Setting the OPACITY makes it look invisible. Setting it to "1.0" makes it very slightly invisible, however, when set to ".1" you can hardly see it.
Hope this helps!
|
|
|
|
|
kewl thanks..ill try it...
|
|
|
|
|
But is it possible to get the controls to this transparent window when needed (like it shud respond whenever i click the mouse along with the ctrl key)...?? Because from what you said..it seems that windows will manage the ctrls and decide only based on opacity and not on programmer's setting right?
|
|
|
|
|
Here ya are! Best I can come up with so far! Any questions?
<br />
public class Joshua : Form {<br />
[STAThread]<br />
public static void Main() {<br />
Application.Run(new Joshua());<br />
}<br />
<br />
public Joshua() {<br />
this.ClientSize = new Size(520, 310);<br />
this.Name = "Form1";<br />
this.ShowInTaskbar = false;<br />
this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide;<br />
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;<br />
this.TopMost = true;<br />
this.TransparencyKey = System.Drawing.SystemColors.Control;<br />
this.Opacity = .8;<br />
}<br />
<br />
protected override void OnKeyDown(KeyEventArgs kea) {<br />
if(kea.KeyCode == Keys.ControlKey) {<br />
this.TransparencyKey = System.Drawing.Color.Empty;<br />
}<br />
}<br />
<br />
protected override void OnKeyUp(KeyEventArgs kea) {<br />
if(kea.KeyCode == Keys.ControlKey) {<br />
this.TransparencyKey = System.Drawing.SystemColors.Control;<br />
}<br />
}<br />
}<br />
<br />
|
|
|
|
|
Yo buddy..
tat works...need to build my app (it is just a cricket(a game) scorecard )..as existing ones occupy my desktop
thanks again pal...tat was one awesome quickness uve got!!
|
|
|
|
|
Great! Glad I could help !
|
|
|
|
|
hi every body!
I want to write a program that can take all unread mail from OutLook, but don't know how to do it, any one have experience about it, please give me some suggest!
Thanks alot!
xyz
|
|
|
|
|
You could use a third party IMAP control. IMAP has a flag that can be checked if a message has been read. However, with IMAP, you will have to have the username and password to "login" to the account you want to check.
I have used the IMAP control from http://www.quiksoftcorp.com/.
|
|
|
|
|
hello dave,
how r u?? i hope u r okay,,,,as u r the one who advice me here very good advices...today i want to trace MSN Chat sessions...so what do u suggest??
and their history of course
|
|
|
|