Arkadaşlar programım icin gerekli olan bir WYSIWYG editoru icin cok guzel ve problemsiz calışan bir dll dosyası buldum kaynak kodunu Vb.net'e ceviremiyorum cok hata veriyor ustesinden gelemiyorum yardımcı olabilirmisiniz? Visual Studio'da Yeni Proje diyoruz ordanda Windows Form Denetim Kitaplığı'nı seciyoruz (Bendeki turkce dil paketi yuklu olduğu icin boyle dil paketi yuklu olmayanlarda bu seceneğin ingilizcesini secmeli) Acılan formda bir adet WebBrowser1 ve bir adet ToolStrip1 var ToolStrip icindede yazıyı kalınlaştırma renklendirme vesaire bu buttonlar var hesi bu projenin C# kodu aşağıda
HTMLTextBox.cs isimli Kullanıcı Denetimi Dosyasındaki Kod
Kod:
using System; using System.Collections.Generic; using System.ComponentModel; using System.Drawing; using System.Data; using System.Text; using System.Windows.Forms; using System.Runtime.InteropServices; namespace HTMLEditor.Windows.Forms #region Properties /// /// Gets or sets the current text in the HTMLTextBox /// public override string Text set } /// /// Gets the collection of the image path in the HTMLTextBox /// public string[] Images } return images.ToArray(); } } #endregion #region Methods /// /// Initialize controls /// private void InitializeControls() toolStripComboBoxSize.Items.AddRange(FontSize.All. ToArray()); // Web Browser WebBrowser1.DocumentText = string.Empty; WebBrowser1.Document.Click += new HtmlElementEventHandler(webBrowserBody_DocumentCli ck); WebBrowser1.Document.Focusing += new HtmlElementEventHandler(webBrowserBody_DocumentFoc using); WebBrowser1.Document.ExecCommand("EditMode", false, null); WebBrowser1.Document.ExecCommand("LiveResize", false, null); EndUpdate(); } /// /// Refresh tool bar buttons /// private void RefreshToolBar() catch (Exception e) finally } #endregion #region Updating private int dataUpdate; private bool Updating } private void BeginUpdate() private void EndUpdate() #endregion #region Tool Bar private void toolStripComboBoxName_SelectedIndexChanged(object sender, EventArgs e) WebBrowser1.Document.ExecCommand("FontName", false, toolStripComboBoxName.Text); } private void toolStripComboBoxSize_SelectedIndexChanged(object sender, EventArgs e) int size = (toolStripComboBoxSize.SelectedItem == null) ? 1 : (toolStripComboBoxSize.SelectedItem as FontSize).Value; WebBrowser1.Document.ExecCommand("FontSize", false, size); } private void toolStripButtonBold_Click(object sender, EventArgs e) WebBrowser1.Document.ExecCommand("Bold", false, null); RefreshToolBar(); } private void toolStripButtonItalic_Click(object sender, EventArgs e) WebBrowser1.Document.ExecCommand("Italic", false, null); RefreshToolBar(); } private void toolStripButtonUnderline_Click(object sender, EventArgs e) WebBrowser1.Document.ExecCommand("Underline", false, null); RefreshToolBar(); } private void toolStripButtonColor_Click(object sender, EventArgs e) int fontcolor = (int)((mshtml.IHTMLDocument2)WebBrowser1.Document. DomDocument).queryCommandValue("ForeColor"); ColorDialog dialog = new ColorDialog(); dialog.Color = Color.FromArgb(0xff, fontcolor & 0xff, (fontcolor >> 8) & 0xff, (fontcolor >> 16) & 0xff); DialogResult result = dialog.ShowDialog(); if (result == DialogResult.OK) WebBrowser1.Document.ExecCommand("ForeColor", false, color); } RefreshToolBar(); } private void toolStripButtonNumbers_Click(object sender, EventArgs e) WebBrowser1.Document.ExecCommand("InsertOrderedLis t", false, null); RefreshToolBar(); } private void toolStripButtonBullets_Click(object sender, EventArgs e) WebBrowser1.Document.ExecCommand("InsertUnorderedL ist", false, null); RefreshToolBar(); } private void toolStripButtonOutdent_Click(object sender, EventArgs e) WebBrowser1.Document.ExecCommand("Outdent", false, null); RefreshToolBar(); } private void toolStripButtonIndent_Click(object sender, EventArgs e) WebBrowser1.Document.ExecCommand("Indent", false, null); RefreshToolBar(); } private void toolStripButtonLeft_Click(object sender, EventArgs e) WebBrowser1.Document.ExecCommand("JustifyLeft", false, null); RefreshToolBar(); } private void toolStripButtonCenter_Click(object sender, EventArgs e) WebBrowser1.Document.ExecCommand("JustifyCenter", false, null); RefreshToolBar(); } private void toolStripButtonRight_Click(object sender, EventArgs e) WebBrowser1.Document.ExecCommand("JustifyRight", false, null); RefreshToolBar(); } private void toolStripButtonFull_Click(object sender, EventArgs e) WebBrowser1.Document.ExecCommand("JustifyFull", false, null); RefreshToolBar(); } private void toolStripButtonLine_Click(object sender, EventArgs e) WebBrowser1.Document.ExecCommand("InsertHorizontal Rule", false, null); RefreshToolBar(); } private void toolStripButtonHyperlink_Click(object sender, EventArgs e) WebBrowser1.Document.ExecCommand("CreateLink", true, null); RefreshToolBar(); } private void toolStripButtonPicture_Click(object sender, EventArgs e) WebBrowser1.Document.ExecCommand("InsertImage", true, null); RefreshToolBar(); } #endregion #region Web Browser private void webBrowserBody_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e) private void webBrowserBody_PreviewKeyDown(object sender, PreviewKeyDownEventArgs e) RefreshToolBar(); } private void webBrowserBody_DocumentClick(object sender, HtmlElementEventArgs e) private void webBrowserBody_DocumentFocusing(object sender, HtmlElementEventArgs e) #endregion #region Font Size private class FontSize return allFontSize; } } public static FontSize Find(int value) if (value > 7) return All[value - 1]; } private FontSize(int display, int value) private int valueSize; public int Value } private int displaySize; public int Display } public override string ToString() } #endregion #region ToolStripComboBox private class ToolStripComboBoxEx : ToolStripComboBox } #endregion } }
__________________
C# dilinde yazılmış bir user kontrol dll projesinin Vb.net'e cevirebilirmisiniz?
C#0 Mesaj
●39 Görüntüleme
- ReadBull.net
- Programlama ve Yazılım
- Programlama Dilleri
- C#
- C# dilinde yazılmış bir user kontrol dll projesinin Vb.net'e cevirebilirmisiniz?