私はインターネットでいくつかのことを経験しましたが、ビジュアルスタジオ2010がツールボックスにスペルチェックボタンのオプションを持っているように、ビジュアルスタジオ2008がスペルチェックのオプションをサポートしているかどうかを理解できませんでした...もしそうなら、誰かが提案できます電子メールメッセージで使用できるようにする方法(送信する前に電子メールのスペルチェックオプションを使用したい)....サービスパック2と関係がありますか....
以下は私のアプリケーションでメールを送信するためのコードです。テキストを入力する唯一の場所であるため、メッセージの本文をスペルチェックする必要があります。
private void setEmailValues()
{
var eml = new EmailInformation
{
SendTo = this.ctlDocDelivery.EmailAddresses,
SendCc = this.ctlDocDelivery.CC,
SendBcc = this.ctlDocDelivery.BCC,
Subject = this.ctlDocDelivery.Subject,
Body = this.ctlDocDelivery.MessageBody,
SendAsAttachment = (this.ctlDocDelivery.SendAs == DocumentDeliveryControl.SendAsSelections.ATTACHMENT),
DoNotSend = !this.ctlDocDelivery.ShowEmailPanel
};
// Mark as do not send if we're not showing the email panel:
this.setApproverSecondApproverValues();
Session[AppConstants.SK_EMAILINFORMATION] = eml;
}
private void setApproverSecondApproverValues()
{
var acct = (Account) Session[AppConstants.SK_ACTION_ACCOUNT];
if (ctlDocDelivery.ShowApprovalPanel)
{
acct.CurrentRisk.ApprovedById = ctlDocDelivery.ApprovalUnderwriterId;
acct.CurrentRisk.ApprovedDate = ctlDocDelivery.ApprovalDate;
}
if (!this.ctlDocDelivery.ShowSecondApprovalPanel)
return;
acct.CurrentRisk.SecondApprovedById = this.ctlDocDelivery.SecondApprovalUnderwriterId;
acct.CurrentRisk.SecondApprovedDate = this.ctlDocDelivery.SecondApprovalDate;
}
private void cleanUpCachedEntities()
{
var formSessionKeys = (ArrayList) Session[AppConstants.SK_FORM_SESSION_KEYS];
foreach (string sessionKey in formSessionKeys)
Session.Remove(sessionKey);
}
private void generatePageScripts()
{
if (Page.ClientScript.IsClientScriptBlockRegistered(this.GetType(), "DocumentDelivery"))
return;
var sb = new StringBuilder(2048);
sb.AppendFormat("function {0}_OnClick() {{" + Environment.NewLine, this.ctlDocDelivery.ChkBoxAllReviewsCompletedClientID);
sb.AppendLine(" var chkBox = document.getElementById('" + this.ctlDocDelivery.ChkBoxAllReviewsCompletedClientID + "');");
sb.AppendLine(" var btnSendForReview = ig_getWebControlById('" + this.btnSendforReview.ClientID + "');");
sb.AppendLine(" var btnRelease = ig_getWebControlById('" + this.btnRelease.ClientID + "');");
sb.AppendLine(" var gbBxDlvryInfo = document.getElementById('" + this.ctlDocDelivery.gbBoxDeliveryInfoClientID + "');");
sb.AppendLine(" var txtToBox = document.getElementById('" + this.ctlDocDelivery.txtToClientId + "');");
sb.AppendLine(" var txtCCBox = document.getElementById('" + this.ctlDocDelivery.txtCCClientId + "');");
sb.AppendLine(" var txtBCCBox = document.getElementById('" + this.ctlDocDelivery.txtBCCClientId + "');");
sb.AppendLine(" var txtSubBox = document.getElementById('" + this.ctlDocDelivery.txtSubClientId + "');");
sb.AppendLine(" var txtBodyBox = document.getElementById('" + this.ctlDocDelivery.txtMsgBodyClientId + "');");
sb.AppendLine(" if (txtToBox !== null) txtToBox.disabled = !chkBox.checked;");
sb.AppendLine(" if (txtCCBox !== null) txtCCBox.disabled = !chkBox.checked;");
sb.AppendLine(" if (txtBCCBox !== null) txtBCCBox.disabled = !chkBox.checked;");
sb.AppendLine(" if (txtSubBox !== null) txtSubBox.disabled = !chkBox.checked;");
sb.AppendLine(" if (txtBodyBox !== null) txtBodyBox.disabled = !chkBox.checked;");
sb.AppendLine(" btnSendForReview.setEnabled(!chkBox.checked);");
sb.AppendLine(" var elemBtnSendForRev = btnSendForReview.getElement();");
sb.AppendLine(" btnRelease.setEnabled(chkBox.checked);");
sb.AppendLine(" var elemBtnRel = btnRelease.getElement();");
sb.AppendLine("");
sb.AppendLine(" if(btnSendForReview.getEnabled())");
sb.AppendLine(" elemBtnSendForRev.style.cursor = 'hand';");
sb.AppendLine(" else");
sb.AppendLine(" elemBtnSendForRev.style.cursor = 'auto';");
sb.AppendLine("");
sb.AppendLine(" var lblNotificationMessage = document.getElementById('" + this.ctlDocDelivery.lblNotificationMessageClientId + "');");
sb.AppendLine(" var tblNotificationMessage = document.getElementById('" + this.ctlDocDelivery.tblNotificationMessageClientId + "');");
sb.AppendLine(" if(btnRelease.getEnabled())");
sb.AppendLine(" {");
var acct = (Account) this.Session[AppConstants.SK_ACTION_ACCOUNT];
var displayNotificationMessage = acct.CurrentRisk
.ValidationResults
.Cast<ValidationResult>()
.Any(validationResult => validationResult.ValidationTypeId == (int) EnumValidationType.NOTIFICATION);
if (displayNotificationMessage)
sb.AppendLine(" tblNotificationMessage.style.visibility = 'visible';");
sb.AppendLine(" elemBtnRel.style.cursor = 'hand';");
sb.AppendLine(" }");
sb.AppendLine(" else");
sb.AppendLine(" {");
sb.AppendLine(" tblNotificationMessage.style.visibility = 'hidden';");
sb.AppendLine(" elemBtnRel.style.cursor = 'auto';");
sb.AppendLine(" }");
sb.AppendLine("");
sb.AppendLine(" if(gbBxDlvryInfo !== null) gbBxDlvryInfo.disabled = !chkBox.checked;");
sb.AppendLine("}");
var chkAllReviewsCompleted = this.Page.FindControl(this.ctlDocDelivery.ChkBoxAllReviewsCompletedUniqueID) as CheckBox;
chkAllReviewsCompleted.Attributes["onclick"] = this.ctlDocDelivery.ChkBoxAllReviewsCompletedClientID + "_OnClick();";
this.Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "DocumentDelivery", sb.ToString(), true);
}
#endregion
}