|
I have just started writing a vector graphics program with C#. I want to use the Graphics object's ScaleTransform to control zooming. I haven't got to that coding stage yet but I'm wondering if anybody knows how you would enforce bounds when the graphics are scaled. For example, while the mouse is dragging a shape, I want the location change to be canceled if the object would have been dragged out of the drawing bounds.
may your code be error free
|
|
|
|
|
I have a enum.I want to take a string array so that I can check with the enum values with the parameter of that perticular function.
Function AAA(string bbb)
{
String [] ccc ----------will store the enum values.
This values will be check with string bbb.
}
|
|
|
|
|
Try
System.Enum.Parse ( typeof(YourEnumType) , TheStringValueToTest )
|
|
|
|
|
how to write error handling in base page meaning first load page?
email me srpatel1172@yahoo.com
thank you
-- modified at 2:04 Wednesday 11th July, 2007
how to create error handle in master page?
|
|
|
|
|
Please clarify your question
"Any sort of work in VB6 is bound to provide several WTF moments." - Christian Graus
|
|
|
|
|
I need my application to resize one of its forms when the user resizes the window of an external application (different process). It's been suggested to me that using Windows hooks is really the only viable way to do this.
There's just one problem: Apparently the callback that's executed when the hook is processed must be contained in a dll file if the thread/process that set the hook is different than the thread/process to which the hook is attached. From MSDN: "If the application installs a hook procedure for a thread of a different application, the procedure must be in a DLL."
So if my callback has to be contained within a dll, how do I get it to change properties on MY form??
|
|
|
|
|
Gosh! That's an intresting twist on cross posting.
Upcoming events:
* Glasgow: Mock Objects, SQL Server CLR Integration, Reporting Services, db4o, Dependency Injection with Spring ...
"I wouldn't say boo to a goose. I'm not a coward, I just realise that it would be largely pointless."
Ready to Give up - Your help will be much appreciated.
My website
|
|
|
|
|
on my local system I would like to create a application that will directly connect with the exchange server and send a email. I currently have it sending the email thru my outlook, but the problem is I have to use a 3rd party application to click YES I want the email to send (outlook popup window).
Can C# bge configured to talk directly to the exchange server like outlook and not know the difference in what is sending the email?
|
|
|
|
|
Here's what I use to send email:
public static void
SendEmail
(
string Sender
,
string Recipient
,
string Subject
,
string Body
,
string SmtpServer
,
System.IO.FileInfo[] Files
)
{
System.Net.Mail.MailMessage msg = new System.Net.Mail.MailMessage ( Sender , Recipient ) ;
if ( Files != null )
{
System.Text.StringBuilder temp = new System.Text.StringBuilder ( Body ) ;
temp.Append ( string.Format
(
"\n\n{0} attached file{1}:"
,
Files.Length
,
Files.Length==1?"":"s"
) ) ;
foreach ( System.IO.FileInfo att in Files )
{
if ( att != null )
{
temp.Append ( "\n" + att.Name ) ;
if ( att.Exists )
{
msg.Attachments.Add ( new System.Net.Mail.Attachment ( att.FullName ) ) ;
}
else
{
temp.Append ( " -- does not exist!" ) ;
}
}
}
Body = temp.ToString() ;
}
msg.Subject = Subject ;
msg.Body = Body ;
System.Net.Mail.SmtpClient cl = new System.Net.Mail.SmtpClient ( SmtpServer ) ;
cl.Credentials = System.Net.CredentialCache.DefaultNetworkCredentials ;
cl.Send ( msg ) ;
}
|
|
|
|
|
Do you use this on a exchange server? It appears you might be passing the mail.domain.com for what it should login with.
|
|
|
|
|
Brad Wick wrote: Do you use this on a exchange server?
The service that uses that code runs on the same box as the Exchange server, but it doesn't have to.
Brad Wick wrote: It appears you might be passing the mail.domain.com for what it should login with.
Not to my knowledge.
|
|
|
|
|
in case this isn't already what you're using, there's also MS Outlook interop in addition to PIEBALDs solution:
simple example[^]
more than you ever wanted to know[^]
not sure if it's going to show the outlook popup window, but it's a nice thing to know about
|
|
|
|
|
I am trying to store the values of 5 textbxes of a form fr each user into an arrayList and then iterate through the list fr the details of each usern using a foreach statement. I have a problem in writing the code that implements it. ex: UserId, Fname, Lname, addr, city, state -> save these values into an array list and iterate thrugh the list front and back. _-- Please help me out
Shashank
|
|
|
|
|
Theres alot of way doing this. Least of code way would be:
ArrayList lst = new ArrayList();
Foreach( TextBox txt in Form.Controls)
{
lst.Add(txt.Text);
}
//now your Arraylist contains all the data in textboxes on the form.
Hope it helps you.
PS:My C# syntax needs some dusting-off, so the code above may not compile as is - but .NET concept works.
|
|
|
|
|
I need to create an application that will monitor iTunes.
Currently I am using the OnDatabaseChange event to do this, the problem is I am having trouble working out (from the changedObjectsIDs) which items have been added and which have had their metadata edited.
I'm not sure if that's clear. More information available if requird.
Any help would be very much appreciated.
Freedom is the right to say that 2+2=5 if this is so everything else will follow.
|
|
|
|
|
Hello sirs,
I have exhausted my resources and have come seeking help.
I have a windows .net application A written in C# and I have another windows .net application written in C# called B.
B is a simple Form with a button and a listbox. It contains an arrayList that when the button is pressed spits out all the strings in it.
A is ment to Run B and be able to change its arraylist to add strings to it and possible call functions in B.
Example:
I run A which Loads B
B's form shows up and I click the button which displays Hello World.
I goto the A form which has some input to add strings to Bs arrayList.
I reclick Bs button and the new strings show up.
Any ideas?
|
|
|
|
|
|
I need my application to respond when a certain other application window is resized. The other app is completely external (I did not write it, I don't have the source, etc).
Is there a way to do this via .NET structures, or do I have to use Windows Messages? Either way, I'm not sure how this is to be done. If it's the latter case, how do I get the resize message that (I presume) is generated when a user resizes the external application, assuming I already have the windows-handle to the app?
|
|
|
|
|
I guess you have two options here:
a) intercept the window messages (WM_SIZE/WM_RESIZE) of the other window using a hook
b) periodically get the size of the other window in a timer and compare it with the size of the last timer tick (seems like a bad solution, but easier than using a hook)
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
I suspect you will need global hooks which according to ms cannot be implemented in .NET but there is an article on codeproject explaining how to do it.
|
|
|
|
|
Hi All;
I'm working in VS2005, and have a DataGridView that draws from a datasource. Is there a way to change a column to be a link style column after the DataGridView populates? Here's how I populate it:
<br />
DataSet ds = new DataSet();<br />
dgvShipmentHistory.DataSource = null;<br />
SqlDataAdapter da = new SqlDataAdapter(mySQLClass.Query, mySQLClass.SqlCon);<br />
da.MissingSchemaAction = MissingSchemaAction.AddWithKey;<br />
da.Fill(ds, "ShipmentHistory");<br />
dgvShipmentHistory.DataSource = ds.Tables[0];<br />
dgvShipmentHistory.AutoResizeColumns(DataGridViewAutoSizeColumnsMode.AllCells);<br />
I want to be able to change one of the columns to be a link type column so that users can click the hyperlink and I can throw up a page.
Thanks
|
|
|
|
|
|
|
Did u try using DataGridViewLinkColumn?
If ur grid id bound to datasource, goto properties -> Columns -> select the appropriate column from ur columns list -> and change ColumnType property
Let me know if that works or am i thinking too simple.
Ketty
|
|
|
|
|
The only property I can see is the CellStyle property, I dont see a ColumnType property on the datagridview column.
|
|
|
|