|
Hello Firends
How can I open Microsoft Outlook to send email to the address with press a button in my
form ??
Thanks In advance
|
|
|
|
|
if outlook is the default email client on the pc then you could use this line of code:
System.Diagnostics.Process.Start("mailto:user@domain.com"); if outlook isnt the default email client on the pc, then whatever is will be opened.
-- modified at 12:18 Friday 30th December, 2005
|
|
|
|
|
1.
When a button is clicked on Form1 it handles the event by creating a new form, like this:
newForm *a=new newForm;
a.Show();
the problem here is that when Form1 is closed newForm disspaears is closed too.
how can a new a form be closed without closing all the forms it created?
2. in the above example newForm also has a button that creates an instance of Form1 when pressed. Form1.h has newForm.h included. the problem here is that when i try to include Form1.h in newForm.h i get an error saying that newForm is not defined in Form1 and Form1 is not defined in newForm.h.
m$: It is normal for your screen to go blank and for your computer to restart itself several times
|
|
|
|
|
in the OnClosing event do:
e.Cancel = false;
|
|
|
|
|
to close form1 i call form1.dispose();
that in turn calls components.dispose();
i dunno where to find the OnClosing event
anyway setting form1.cancel to false will still close the form whiel allowing it's chold forms to exist? i mean really lose it not just hide it.
what about calling Activator.CreateInstance(newForm); i've seen soem refereances to the functione but i have no clue as to what it does.
m$: It is normal for your screen to go blank and for your computer to restart itself several times
-- modified at 9:33 Friday 30th December, 2005
|
|
|
|
|
I do not think there is a way to close a parent form and keep its child forms open.
Darryl Borden
Principal IT Analyst
dborden@eprod.com
|
|
|
|
|
I think the best you can do is to make the parent invisible.
|
|
|
|
|
|
If you have binary data in an image field, you can't just write it out into the response stream. You have to make a proxy page that will get the data from the database and write it out. The proxy page will work just like if it was an image file. E.g.:
A hyperlink field in the database has nothing to do with an html hyperlink, it's a hyperlink that is used by Office applications. You can extract the data from the field and create an html link from it, but it's easier to do if you store the information in regular text fields instead.
---
b { font-weight: normal; }
|
|
|
|
|
How can i set a Location of a form then show it correctly?
If i make this:
MyForm f = new MyForm();
f.Locaion = myPoint;
f.Show();
it doesn't Locate the Form at myPoint position.
|
|
|
|
|
do it onLoad event and will work
|
|
|
|
|
Also, you have to make sure that the StartPosition property is set to Manual for the form.
Darryl Borden
Principal IT Analyst
dborden@eprod.com
|
|
|
|
|
i want to use for the standard button myown png images.
Using for the normal state one png, for the mousemove another and for mouse down another one too.
How?
|
|
|
|
|
Add a handler for MouseDown, MouseUp, MouseOver events for the Button and set the Image property accordingly.
|
|
|
|
|
Hello, here are some beginners questions
First, how do i get a form to return a value? If i allow the user to select something, like a object of some kind, how do i return this object to the class that called the form?
Secondly, how do i determine if a class fulfills a certain interface?
To clarify this question, i have this function that loads DLL:s but theese contain many classes, and i wont it only to load those classes that implements the IMyForm interface, please advice
private Form loadPlugIns(String dllName) {<br />
try<br />
{<br />
Assembly MyAssembly = Assembly.LoadFrom(dllName);<br />
Type[] Types = MyAssembly.GetTypes();<br />
<br />
foreach (Type oType in Types)<br />
{<br />
try<br />
{<br />
if ((oType.IsClass == true))<br />
{ <br />
object ibaseObject = Activator.CreateInstance(oType);<br />
Form form;<br />
form = (Form)oType.InvokeMember("getForm", BindingFlags.Default | BindingFlags.InvokeMethod,<br />
null, ibaseObject, null);<br />
return form;<br />
}<br />
} catch (Exception ex)<br />
{<br />
VirheHallinta.LogException("Failed to load module.", ex);<br />
}<br />
}<br />
return null;<br />
} catch (Exception ex)<br />
{<br />
System.Windows.Forms.MessageBox.Show(ex.ToString());<br />
return null;<br />
}<br />
}
Hm, looks awfull (my code) in the window...
R
Johan
-- modified at 6:01 Friday 30th December, 2005
|
|
|
|
|
Hi,
1. There are several prossibilities.
a) Show the Form as you would normally with ShowDialog and add a property to it so the result can be retrieved afterwards. This is like the built in dialogs of .Net work.
b) Define your own ShowXY function in your form which internally calls ShowDialog on himself and returns the wanted result:
public MyObject ShowMyForm(){
if (this.ShowDialog() == DialogResult.Ok)
return _myResult;
else
return null;
}
2. There are several way to do this. One is:
if (Array.IndexOf(t.GetInterfaces(), typeof(IMyInterface)) >= 0)
Console.WriteLine("Interface implemented");
else
Console.WriteLine("Interface not implemented");
|
|
|
|
|
|
Can forms return a value to, let's say the winmain function, or can something like SendMessage be used to send s message to another window's callback function? If so how?
m$: It is normal for your screen to go blank and for your computer to restart itself several times
|
|
|
|
|
Hi all,
I've created a service that needs to log in a different log then the application log. Therefor I've added the following line of code:
System.Diagnostics.EventLog.CreateEventSource("ServiceOne", "ServiceOneLog");
But when I run the InstallUtil I can see that it automatically adds the eventsource in the application log.
Does anybody have an idea how to make sure that my logs are put in ServiceOneLog? Or is there a way to tell the InstallUtil to which Log he needs to add the source?
Thanks in advance,
Geert
|
|
|
|
|
Hi all,
I'm trying to select a tab from the windows form's standard tab control on right clicking of mouse button.
The mouse event args gives me the location of the mouse pointer.
But the tab control doesn't expose any method or property to get the tab on which my mouse
pointer is hovering.
Has anyone of you faced similar problem like this ? Or atleast it will be nice if anyone can show me a pointer towards solving this problem.
Hoping to hear from you guys...
Thanks and regards,
|
|
|
|
|
You might try this approach...
You can get the coordinates of each tab on the DrawItem event. If you could save those locations and sizes of each tab every time the tab control is drawn, then in the mousedown event you can identify which tab was clicked on by referring to your saved information.
Good Luck!
Darryl Borden
Principal IT Analyst
dborden@eprod.com
|
|
|
|
|
The way to do it is to iterate over the tab pages and for each one call TabControl.GetTabRect. If your mouse coordinate exists inside the returned rectange, set that tab to the selected tab.
"we must lose precision to make significant statements about complex systems."
-deKorvin on uncertainty
|
|
|
|
|
Hi, I have a problem wiht a SQL Sentence, if I have got a field char(30) and this field of one table of my database have for example : "01/12/2005 10:12:25" my question is how can I do a selection if I want do a selection between 01/12/2005 to 31/12/2005 and show the result in a datagrid. I´m working with Sybase
I have tried:
Select * from Table where field between like "01/12/2005%" and
like "31/12/2005%"
Error
If I try
Select * from Table where field like "01/12/2005%"
The result is ok.
Any idea ?????? Any help ???? Any example ????
Thanks in advance.
Coloso
|
|
|
|
|
Hi,
try with the following method
select * from <--table name-->WHERE <--field name--> Between "01/12/2005 00:00:00" AND "31/12/2005 23:59:59";
Thanks
Warm Regards
Prakash-B
|
|
|
|
|
Thank you for you help.
I have try your code and the sentence select all the data, more dates are selected that I need.
01/01/2005 ...... 31/12/2005
I have find the same data in othe field in my table of type TimeStamp (Sybase) and with this code.
SELECT * FROM BatchHeader where StartTime between '2005-12-01 00:00:00' and
'2005-12-31 23:59:59'
it´s work fine. Thank you for the clue.
Coloso
|
|
|
|