|
|
Is there a way to disable the [x]that closes the form (upper-right corner)?
|
|
|
|
|
add
this.ControlBox= false;
in the InitializeComponent() function or u can directly disable this in the windows style property of the form
sathy
|
|
|
|
|
I'm trying to access my forms (Form1) child objects, such as panels, sliderbars, toolbars, etc from a second class that i've added to the project.
Currently i'm accessing Form1 via Form1.ActiveForm the problem that i'm having is that i can access the standard stuff from the form class, but nothing else, is this because Form1 is a public class, and all the child objects are private?
if this is the case is it safe for me to change only the objects that i need to access to public, or is that unsafe coding?
Is there a better way?
or am i just going about this all wrong?
|
|
|
|
|
Is it safe? Yeah.
Is it proper coding practice? No way!
Your second class shouldn't know anything about the form that called it. Your Form should be passing the data it needs to to the class methods and processing any return data required. Your second class should not be trying to modify the form, or read from it, at all.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
JstDaNuGuy wrote: if this is the case is it safe for me to change only the objects that i need to access to public, or is that unsafe coding?
You should not make any field in a class public. See this article on Why make fields in a class private, why not make them public?[^]
JstDaNuGuy wrote: Is there a better way?
Yes. But it depends on what you are trying to do. What is the purpose of the second class? And what is the reason for the interaction?
ColinMackay.net
"Man who stand on hill with mouth open will wait long time for roast duck to drop in." -- Confucius
"If a man empties his purse into his head, no man can take it away from him, for an investment in knowledge pays the best interest." -- Joseph E. O'Donnell
|
|
|
|
|
thanks for the information guys...
what im' trying to do is set the form state upon load then save on exit. but i have much more to set/save than just the form size, and i was just trying to do it from a different class
i'm still learning...
|
|
|
|
|
i want to run a file past to my function with the default program reader, that is:
if the file passed is a .xls run that file in Microsoft Excel,
if it is a .gif run the file in the Windows Image Preview
if it is an .html run the file with Explorer, and so on...
|
|
|
|
|
Simple. Just launch the file using the Process[^] class, just like launching any .EXE. Make sure you set the ProcessStartInfo.UseShellExecute property to true. This will make it launch just like you double-clicked it.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Anyone know if any links or where I get a COM for it?
I need to read the bulkmail folder.
Any Ideas, other than peeking at windows all day.
Nick
1 line of code equals many bugs. So don't write any!!
|
|
|
|
|
Outlook Express doesn't expose a COM model.
It does, however, make heavy use of the Messaging API[^].
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I just wanted to read the bulk mail.
I can create my own, but then I would have to add all the additonal support for news and junk. Which I dont want to do.
1 line of code equals many bugs. So don't write any!!
|
|
|
|
|
So just code reading the mail! Where did you get this "You MUST implement a news reader." junk?
Outlook Express uses the MAPI API to download mail from a server. If that's all you want to do, then you just use the MAPI API to do it.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Yeah, but since hotmail and others are a POP server then it pops off.
Using MAPI, can I just peek at the message? Rather than taking it. I don't want this to become a mail application, or at least not right now.
Nick
1 line of code equals many bugs. So don't write any!!
|
|
|
|
|
MAPI is not a way around the features of a POP3 or SMTP server, it is an interface to use those servers. If the server does not support "peeking" at a message, then you can't peek at it.
Most server, though, will let you download a message AND leave it on the server. You just have to check with the POP3 spec to see what the standard commands are and see if MAPI will support them.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Ok, I wasn't sure.
I didnt want to actually take them away, then I would need all kinds of functionality. I just want to scan the messages for spammers And report them.
Thank you for helping.
Thanks,
Nick
1 line of code equals many bugs. So don't write any!!
|
|
|
|
|
in design mode i've set a textbox PasswordChar to *
During the running i want to go back the password textbox to normal, so to let see all the characters.
How can i do?
|
|
|
|
|
this.textBox1.PasswordChar = char.MinValue;
ColinMackay.net
"Man who stand on hill with mouth open will wait long time for roast duck to drop in." -- Confucius
"If a man empties his purse into his head, no man can take it away from him, for an investment in knowledge pays the best interest." -- Joseph E. O'Donnell
|
|
|
|
|
it doesn't work.
I see ******* anyway
|
|
|
|
|
That's odd - It works for me.
ColinMackay.net
"Man who stand on hill with mouth open will wait long time for roast duck to drop in." -- Confucius
"If a man empties his purse into his head, no man can take it away from him, for an investment in knowledge pays the best interest." -- Joseph E. O'Donnell
|
|
|
|
|
// In C# 2.0, you can use the default keyword.
this.textBox1.PasswordChar = default(char);
|
|
|
|
|
i can't use default(char), maybe i've not c# 2.0 becouse i'm in VS.NET 2003
|
|
|
|
|
Yeah, in VS 2003, one can only use .NET 1.1. All you need to do is set the PasswordChar property to whatever is the default value for a character. I believe the default character value is '\0'.
Tech, life, family, faith: Give me a visit.
I'm currently blogging about: Bought a House!
Judah Himango
|
|
|
|
|
I use this:
txtPassword.PasswordChar = '\0'; and it works in .NET 1.x.
I hope it helps!
-- LuisR
Luis Alonso Ramos
Intelectix - Chihuahua, Mexico
Not much here: My CP Blog!
The amount of sleep the average person needs is five more minutes. -- Vikram A Punathambekar, Aug. 11, 2005
|
|
|
|
|