|
|
Comments and Discussions
|
|
 |

|
Hi,
dont' like the default scroll behavior of a ScrollableControl, because this ignores my mouse scroll wheel settings specified in the system control panel.
I wanted the scroll behavior to use the system settings to scroll just the specified number of lines when the mouse wheel is turned a step. Further more I want that the text scrolls exact always full lines so that if I scoll that the new line is as the exact same position as a other line was before scrolling.
So I commended out the "base.OnMouseWheel(e);" line and replaces the following code.
Unfortunately I couldn't figure out how to calculate the line hight exact.
This equation does not always match the actually line hight:
return (int)fontSize + (int)Math.Ceiling(fontSize / 2);
So I tried it out and builded a table for fonts up to a size of 40.
I now, this is not good programming style
But I didn't found out a better solution ... and it worked.
So here is the code for the mouse scrolling. Now the controls behaves exactly like Notepad, Wordpad or Visual Studio.
protected override void OnMouseWheel(MouseEventArgs e)
{
Invalidate();
if (lastModifiers == Keys.Control)
{
ChangeFontSize(Math.Sign(e.Delta));
}
else
{
int lineHeight = CalculateLineHeight(this.Font.Size);
int numberOfVisibleLines = this.Height / lineHeight;
int mouseWheelScrollLinesSetting = GetControlPanelWheelScrollLinesValue();
int offset;
if ((mouseWheelScrollLinesSetting == -1) || (mouseWheelScrollLinesSetting > numberOfVisibleLines))
{
offset = lineHeight * numberOfVisibleLines;
}
else
{
offset = lineHeight * mouseWheelScrollLinesSetting;
}
if (e.Delta > 0)
{
this.AutoScrollPosition = new Point(-this.AutoScrollPosition.X, -this.AutoScrollPosition.Y - offset);
}
else
{
this.AutoScrollPosition = new Point(-this.AutoScrollPosition.X, -this.AutoScrollPosition.Y + offset);
}
}
OnVisibleRangeChanged();
}
|
|
|
|

|
Hi,
Thanks for suggestion and code example.
You are right, better to support system's settings.
I made some changes in your code and released it. New version is available on Github.
My version is following:
protected override void OnMouseWheel(MouseEventArgs e)
{
Invalidate();
if (lastModifiers == Keys.Control)
{
ChangeFontSize(Math.Sign(e.Delta));
OnVisibleRangeChanged();
}
else
if(VerticalScroll.Visible)
{
int lineHeight = CharHeight;
int numberOfVisibleLines = ClientSize.Height / lineHeight;
int mouseWheelScrollLinesSetting = GetControlPanelWheelScrollLinesValue();
int offset;
if ((mouseWheelScrollLinesSetting == -1) || (mouseWheelScrollLinesSetting > numberOfVisibleLines))
offset = lineHeight * numberOfVisibleLines;
else
offset = lineHeight * mouseWheelScrollLinesSetting;
var newScrollPos = VerticalScroll.Value - Math.Sign(e.Delta)* offset;
var ea = new ScrollEventArgs(e.Delta < 0 ? ScrollEventType.SmallIncrement : ScrollEventType.SmallDecrement,
VerticalScroll.Value,
newScrollPos,
ScrollOrientation.VerticalScroll);
OnScroll(ea);
}
}
private static int GetControlPanelWheelScrollLinesValue()
{
try
{
using (RegistryKey key = Registry.CurrentUser.OpenSubKey(@"Control Panel\Desktop", false))
{
return Convert.ToInt32(key.GetValue("WheelScrollLines"));
}
}
catch
{
return 1;
}
}
rittergig wrote: Unfortunately I couldn't figure out how to calculate the line hight exact.
It is simply CharHeight property
|
|
|
|

|
Thanks.
You are right. To use CharHeight is much easier
|
|
|
|

|
Installed components:
Windows 7, VS2010, Infragistics, DevExpress, VSCommands, Developer Powertools.
When running an application in the debugger, copying to the clipboard works ony 98 out of 100 times.
This succes ratio has nothing to do with your component, somehow it is a fact on my machine and may be related to the installed components.
The problem with your component is what happens in those 2%.
Right now it does not have any exception handling, which means it brings down the host application, without any means for my code to prevent that.
The way I handle it in my own code is that I allow the copy attempt a few retries before
silently failing. I'm not failing explicitly, because the worst thing that happens if it did not work, is that the user thinks they pressed the wrong keys.
I also use the 'DebuggerNonUserCode'-attribute on the method so that the caught exception does not trigger a debugger-breakpoint. I'm not going to deny there is a chance that I am breaking a few laws here. But it has proven to be wonderfully robust in our applications.
[DebuggerNonUserCode]
public bool CopyToClipboard(this string subject)
{
int retriesLeft = 10;
var result = false;
while (retriesLeft-- > 0)
{
try
{
if (string.IsNullOrEmpty(subject))
{
Clipboard.Clear();
}
else
{
Clipboard.SetData(DataFormats.Text, subject);
}
result = true;
break;
}
catch
{
System.Windows.Forms.Application.DoEvents();
Thread.Sleep(10);
}
}
return result;
}
EDIT: I write this comment now because it has just now happened for the third time.
again, not your fault, but you can help.
|
|
|
|

|
Hi,
Hey, this bug was fixed 14 Feb 2013
But I do not run cycle and I do not call Application.DoEvents. I think this is bad practice. However if it is useful for you then let it be...
I solved it by following way:
[DllImport("user32.dll")]
static extern IntPtr CloseClipboard();
void SetClipboard(DataObject data)
{
try
{
CloseClipboard();
Clipboard.SetDataObject(data, true, 5, 100);
}
catch(ExternalException)
{
}
}
The exception throws when clipboard is opened by another process (at my case it was TeamViewer). Unfortunately I do not know robust method to resolve this problem. So I simply ignore this error (but text does not copy in this case of course).
|
|
|
|

|
Hi. I really appreciate your work. This is gorgeous!
But i found a bug:
The descreasing for the indent for a single line does not work.
If I do this:
1.) select one single line and select some characters of it
2.) Press SHIFT + TAB
then the selected line is deleted.
I can't figure the bug out myself
Please help.
|
|
|
|

|
Hi,
Ok, I fixed it. Download latest version from Github.
|
|
|
|

|
Wow! That was fast
Thank you very much.
But I found another bug.
An example:
1.) You set the following options/properties of the fctb control:
AutoIndent=true, AutoIndentExistingLines=true, LeftBracket="", LeftBracket2="", RightBracket="", RightBracket2=""
2.) You opened or inserted the following text in your fctb control:
(
123
456
)
789
3) Then you want to add characters behind the ")" character.
If you do this, then the line with the ")" is shifted to the right.
After I added the '#'-char (for example) I get this:
(
123
456
)#
789
Is this a feature or a bug?
However, if I disable the AutoIndentExistingLines option then this doesn't happen. Besides this behavior (bug?) where is the difference between AutoIndentExistingLine=false and AutoIndentExistingLines=true?
|
|
|
|

|
Hi,
I think this is no bug.
If property AutoIndentExistingLine=false then control does no indent for non empty line. At this mode autoindenting works only for new lines (when user press Enter).
When AutoIndentExistingLine=true, the control trying to indent any line (new, empty, non empty). In your case it does indent by previous line and inserts tab before bracket.
In principle, you can manually handle event AutoIndentNeeded and adjust indents as you need.
Also, take in atention that indention is depending from code foldings.
|
|
|
|

|
When I open a file with fctb I get gradient background and I'm using a tabcontrol to start and open files and when I switch tabs I get a big red X inside a red box covering entire page and all text is gone.
Please help!
Here's what I have so far ...
Imports System.Text.RegularExpressions
Imports FastColoredTextBoxNS
Imports System.Drawing.Drawing2D
Imports System.IO
Imports System.Text
Public Class Form1
Private fctb As New FastColoredTextBox
'Private cmMark As ContextMenuStrip
Private markAsYellowToolStripMenuItem As ToolStripMenuItem
Private markAsRedToolStripMenuItem As ToolStripMenuItem
Private markAsGreenToolStripMenuItem As ToolStripMenuItem
Private toolStripMenuItem100 As ToolStripSeparator
Private clearMarkedToolStripMenuItem As ToolStripMenuItem
Private markLineBackgroundToolStripMenuItem As ToolStripMenuItem
Private toolStripMenuItem200 As ToolStripSeparator
Private shortCutStyle As ShortcutStyle = New ShortcutStyle(Pens.Red)
Private YellowStyle As MarkerStyle = New MarkerStyle(New SolidBrush(Color.FromArgb(180, Color.Yellow)))
Private RedStyle As MarkerStyle = New MarkerStyle(New SolidBrush(Color.FromArgb(180, Color.Red)))
Private GreenStyle As MarkerStyle = New MarkerStyle(New SolidBrush(Color.FromArgb(180, Color.Green)))
' Key - Line.UniqueId
Dim bookmarksLineId As New Dictionary(Of Integer, Integer)()
' Index - bookmark number, Value - Line.UniqueId
Dim bookmarks As New List(Of Integer)()
Dim IsRebuildingBookmarks As Boolean = False
Private Sub ClearClipboard()
Clipboard.SetDataObject(New DataObject)
End Sub
Private Sub fctb_SelectionChangedDelayed(sender As Object, e As EventArgs)
Dim selection As Range = CType(tc1.SelectedTab.Controls.Item(0), FastColoredTextBox).Selection
CType(tc1.SelectedTab.Controls.Item(0), FastColoredTextBox).VisibleRange.ClearStyle(New Style() {shortCutStyle})
If Not selection.IsEmpty Then
Dim r As Range = selection.Clone()
r.Normalize()
r.Start = r.[End]
r.GoLeft(True)
r.SetStyle(Me.shortCutStyle)
End If
End Sub
#Region "Form Load"
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
makenewtab()
CType(tc1.SelectedTab.Controls.Item(0), FastColoredTextBox).Text = File.ReadAllText("html.txt")
tc1.SelectedTab.Text = "New HTML Document.html"
makepopup()
End Sub
#End Region
#Region "MakeNewTab"
Public Function makenewtab()
Dim tp As New TabPage
'Dim fctb As New FastColoredTextBox
tc1.Controls.Add(tp)
With tp
.Text = "New HTML Document.txt"
.Controls.Add(fctb)
.ImageIndex = 11
End With
With fctb
.AutoIndent = False
.AutoScrollMinSize = New Size(0, 15)
.BackBrush = Nothing
'.ContextMenuStrip = cmfctb
.Cursor = Cursors.IBeam
.DelayedEventsInterval = 500
.DisabledColor = Color.FromArgb(100, 180, 180, 180)
.Dock = DockStyle.Fill
.Enabled = True
.Font = New Font("Consolas", 9.75F)
.IndentBackColor = Color.FromArgb(50, 255, 255, 255)
.Language = Language.HTML
.LeftBracket = "("
.LeftPadding = 15
.Location = New Point(0, 0)
.Name = "fctb" & tc1.TabIndex
.Paddings = New Padding(0)
.RightBracket = ")"
.SelectionColor = Color.FromArgb(50, 0, 0, 255)
.Size = New Size(447, 262)
.TabIndex = 0
.WordWrap = True
.AddStyle(Me.YellowStyle)
.AddStyle(Me.RedStyle)
.AddStyle(Me.GreenStyle)
.AddStyle(Me.shortCutStyle)
End With
AddHandler fctb.SelectionChangedDelayed, New EventHandler(AddressOf fctb_SelectionChangedDelayed)
AddHandler fctb.VisualMarkerClick, New EventHandler(Of VisualMarkerEventArgs)(AddressOf fctb_VisualMarkerClick)
AddHandler fctb.PaintLine, New EventHandler(Of PaintLineEventArgs)(AddressOf fctb_PaintLine)
AddHandler fctb.Resize, New EventHandler(AddressOf fctb_Resize)
'Me.cmMark.ResumeLayout(False)
tc1.SelectedTab = tp
Return tp
End Function
#End Region
#Region "Autocomplete - Intellisence"
Private popupMenu As AutocompleteMenu
'Private keywords As String() = {"abstract", "as", "<b>", "base", "bool", "break", "byte", _
' "case", "catch", "char", "checked", "class", "const", _
' "continue", "decimal", "default", "delegate", "do", "double", _
' "else", "enum", "event", "explicit", "extern", "false", _
' "finally", "fixed", "float", "for", "foreach", "goto", _
' "if", "implicit", "in", "int", "interface", "internal", _
' "is", "lock", "long", "namespace", "new", "null", _
' "object", "operator", "out", "override", "params", "private", _
' "protected", "public", "readonly", "ref", "return", "sbyte", _
' "sealed", "short", "sizeof", "stackalloc", "static", "string", _
' "struct", "switch", "this", "throw", "true", "try", _
' "typeof", "uint", "ulong", "unchecked", "unsafe", "ushort", _
' "using", "virtual", "void", "volatile", "while", "add", _
' "alias", "ascending", "descending", "dynamic", "from", "get", _
' "global", "group", "into", "join", "let", "orderby", _
' "partial", "remove", "select", "set", "value", "var", _
' "where", "yield"}
Private keywords As String() = {"<!--...-->", "<!DOCTYPE>", "<a>", "<abbr>", "<acronym>", "<address>", "<applet>", "<area />", _
"<b>", "<base />", "<basefont />", "<bdo>", "<big>", "<blockquote>", "<body>", "<br />", "<button>", "<caption>", "<center>", "<cite>", _
"<code>", "<col />", "<colgroup>", "<dd>", "<del>", "<dfn>", "<dir>", "<div>", "<dl>", "<dt>", "<em>", "<fieldset>", "<font>", _
"<form>", "<frame />", "<frameset>", "<head>", "<hr />", "<html>", "<i>", "<iframe>", "<img />", "<input />", "<ins>", "<kbd>", _
"<label>", "<legend>", "<li>", "<link />", "<map>", "<menu>", "<meta />", "<noframes>", "<noscript>", "<object>", "<ol>", "<optgroup>", _
"<option>", "<p>", "<param />", "<pre>", "<q>", "<s>", "<samp>", "<script>", "<select>", "<small>", "<span>", "<strike>", "<strong>", "<style>", _
"<sub>", "<sup>", "<table>", "<tbody>", "<td>", "<textarea>", "<tfoot>", "<th>", "<thead>", "<title>", "<tr>", "<tt>", "<u>", "<ul>", "<var>", "<xmp>"}
'Private methods As String() = {"Equals()", "GetHashCode()", "GetType()", "ToString()"}
'Private snippets As String() = {"if(^)" & vbLf & "{" & vbLf & ";" & vbLf & "}", "if(^)" & vbLf & "{" & vbLf & ";" & vbLf & "}" & vbLf & "else" & vbLf & "{" & vbLf & ";" & vbLf & "}", "for(^;;)" & vbLf & "{" & vbLf & ";" & vbLf & "}", "while(^)" & vbLf & "{" & vbLf & ";" & vbLf & "}", "do${" & vbLf & "^;" & vbLf & "}while();", "switch(^)" & vbLf & "{" & vbLf & "case : break;" & vbLf & "}"}
'Private declarationSnippets As String() = {"public class ^" & vbLf & "{" & vbLf & "}", "private class ^" & vbLf & "{" & vbLf & "}", "internal class ^" & vbLf & "{" & vbLf & "}", "public struct ^" & vbLf & "{" & vbLf & ";" & vbLf & "}", "private struct ^" & vbLf & "{" & vbLf & ";" & vbLf & "}", "internal struct ^" & vbLf & "{" & vbLf & ";" & vbLf & "}", _
' "public void ^()" & vbLf & "{" & vbLf & ";" & vbLf & "}", "private void ^()" & vbLf & "{" & vbLf & ";" & vbLf & "}", "internal void ^()" & vbLf & "{" & vbLf & ";" & vbLf & "}", "protected void ^()" & vbLf & "{" & vbLf & ";" & vbLf & "}", "public ^{ get; set; }", "private ^{ get; set; }", _
' "internal ^{ get; set; }", "protected ^{ get; set; }"}
Private Sub BuildAutocompleteMenu()
Dim items As New List(Of AutocompleteItem)()
'For Each item As String In snippets
' items.Add(New SnippetAutocompleteItem(item) With {.ImageIndex = 1})
'Next
'For Each item As String In declarationSnippets
' items.Add(New DeclarationSnippet(item) With {.ImageIndex = 0})
'Next
'For Each item As String In methods
' items.Add(New MethodAutocompleteItem(item) With {.ImageIndex = 2})
'Next
For Each item As String In keywords
items.Add(New AutocompleteItem(item) With {.ImageIndex = 10})
Next
items.Add(New InsertSpaceSnippet())
items.Add(New InsertSpaceSnippet("^(\w+)([=<>!:]+)(\w+)$"))
items.Add(New InsertEnterSnippet())
'set as autocomplete source
popupMenu.Items.SetAutocompleteItems(items)
End Sub
''' <summary>
''' This item appears when any part of snippet text is typed
''' </summary>
Private Class DeclarationSnippet
Inherits SnippetAutocompleteItem
Public Sub New(ByVal snippet As String)
MyBase.New(snippet)
End Sub
Public Overrides Function Compare(ByVal fragmentText As String) As CompareResult
Dim pattern = Regex.Escape(fragmentText)
If Regex.IsMatch(Text, "\b" & pattern, RegexOptions.IgnoreCase) Then
Return CompareResult.Visible
End If
Return CompareResult.Hidden
End Function
End Class
''' <summary>
''' Divides numbers and words: "123AND456" -> "123 AND 456"
''' Or "i=2" -> "i = 2"
''' </summary>
Private Class InsertSpaceSnippet
Inherits AutocompleteItem
Private pattern As String
Public Sub New(ByVal pattern As String)
MyBase.New("")
Me.pattern = pattern
End Sub
Public Sub New()
Me.New("^(\d+)([a-zA-Z_]+)(\d*)$")
End Sub
Public Overrides Function Compare(ByVal fragmentText As String) As CompareResult
If Regex.IsMatch(fragmentText, pattern) Then
Text = InsertSpaces(fragmentText)
If Text <> fragmentText Then
Return CompareResult.Visible
End If
End If
Return CompareResult.Hidden
End Function
Public Function InsertSpaces(ByVal fragment As String) As String
Dim m = Regex.Match(fragment, pattern)
If m Is Nothing Then
Return fragment
End If
If m.Groups(1).Value = "" AndAlso m.Groups(3).Value = "" Then
Return fragment
End If
Return (m.Groups(1).Value & " " & m.Groups(2).Value & " " & m.Groups(3).Value).Trim()
End Function
Public Overrides Property ToolTipTitle() As String
Get
Return Text
End Get
Set(ByVal value As String)
End Set
End Property
End Class
''' <summary>
''' Inerts line break after '}'
''' </summary>
Private Class InsertEnterSnippet
Inherits AutocompleteItem
Private enterPlace As Place = Place.Empty
Public Sub New()
MyBase.New("[Line break]")
End Sub
Public Overrides Function Compare(ByVal fragmentText As String) As CompareResult
Dim r = Parent.Fragment.Clone()
While r.Start.iChar > 0
If r.CharBeforeStart = "}"c Then
enterPlace = r.Start
Return CompareResult.Visible
End If
r.GoLeftThroughFolded()
End While
Return CompareResult.Hidden
End Function
Public Overrides Function GetTextForReplace() As String
'extend range
Dim r As Range = Parent.Fragment
Dim [end] As Place = r.[End]
r.Start = enterPlace
r.[End] = r.[End]
'insert line break
Return Environment.NewLine + r.Text
End Function
Public Overrides Sub OnSelected(ByVal popupMenu As AutocompleteMenu, ByVal e As SelectedEventArgs)
MyBase.OnSelected(popupMenu, e)
If Parent.Fragment.tb.AutoIndent Then
Parent.Fragment.tb.DoAutoIndent()
End If
End Sub
Public Overrides Property ToolTipTitle() As String
Get
Return "Insert line break after '}'"
End Get
Set(ByVal value As String)
End Set
End Property
End Class
'Public Sub New()
' InitializeComponent()
' 'create autocomplete popup menu
' popupMenu = New AutocompleteMenu(fctb)
' popupMenu.Items.ImageList = ImageList1
' popupMenu.SearchPattern = "[\w\.:=!<>]"
' BuildAutocompleteMenu()
'End Sub
Public Function makepopup()
'create autocomplete popup menu
popupMenu = New AutocompleteMenu(fctb)
popupMenu.Items.ImageList = ImageList1
popupMenu.SearchPattern = "[\w\.:=!<>]"
BuildAutocompleteMenu()
Return Nothing
End Function
#End Region
#Region "Markers"
Private Sub fctb_VisualMarkerClick(sender As Object, e As VisualMarkerEventArgs)
If e.Style Is shortCutStyle Then
cmMark2.Show(CType(tc1.SelectedTab.Controls.Item(0), FastColoredTextBox).PointToScreen(e.Location))
End If
End Sub
Private Sub TrimSelection()
Dim sel As Range = CType(tc1.SelectedTab.Controls.Item(0), FastColoredTextBox).Selection
sel.Normalize()
While Char.IsWhiteSpace(sel.CharAfterStart) AndAlso sel.Start < sel.[End]
sel.GoRight(True)
End While
sel.Inverse()
While Char.IsWhiteSpace(sel.CharBeforeStart) AndAlso sel.Start > sel.[End]
sel.GoLeft(True)
End While
End Sub
Private Sub Yellow_Click(sender As Object, e As EventArgs) Handles Yellow.Click
TrimSelection()
CType(tc1.SelectedTab.Controls.Item(0), FastColoredTextBox).Selection.SetStyle(YellowStyle)
End Sub
Private Sub Red_Click(sender As Object, e As EventArgs) Handles Red.Click
TrimSelection()
CType(tc1.SelectedTab.Controls.Item(0), FastColoredTextBox).Selection.SetStyle(RedStyle)
End Sub
Private Sub Green_Click(sender As Object, e As EventArgs) Handles Green.Click
TrimSelection()
CType(tc1.SelectedTab.Controls.Item(0), FastColoredTextBox).Selection.SetStyle(GreenStyle)
End Sub
Private Sub MarkLine_Click(sender As Object, e As EventArgs) Handles Markline.Click
TrimSelection()
CType(tc1.SelectedTab.Controls.Item(0), FastColoredTextBox).Selection.SetStyle(shortCutStyle)
End Sub
Private Sub ClearMarked_Click(sender As Object, e As EventArgs) Handles Clearmarked.Click
CType(tc1.SelectedTab.Controls.Item(0), FastColoredTextBox).Selection.ClearStyle(New Style() {YellowStyle, RedStyle, GreenStyle})
CType(tc1.SelectedTab.Controls.Item(0), FastColoredTextBox)(CType(tc1.SelectedTab.Controls.Item(0), FastColoredTextBox).Selection.Start.iLine).BackgroundBrush = Nothing
End Sub
Private Sub fctb_Resize(sender As Object, e As EventArgs)
CType(tc1.SelectedTab.Controls.Item(0), FastColoredTextBox).BackBrush = New LinearGradientBrush(CType(tc1.SelectedTab.Controls.Item(0), FastColoredTextBox).ClientRectangle, Color.White, Color.Silver, LinearGradientMode.Vertical)
End Sub
Private Sub fctb_PaintLine(sender As Object, e As PaintLineEventArgs)
If e.LineIndex = CType(tc1.SelectedTab.Controls.Item(0), FastColoredTextBox).Selection.Start.iLine Then
e.Graphics.FillEllipse(New LinearGradientBrush(New Rectangle(0, e.LineRect.Top, 15, 15), Color.LightPink, Color.Red, 45.0F), 0, e.LineRect.Top, 15, 15)
End If
'draw bookmark
If bookmarksLineId.ContainsKey(CType(tc1.SelectedTab.Controls.Item(0), FastColoredTextBox)(e.LineIndex).UniqueId) Then
e.Graphics.FillEllipse(New LinearGradientBrush(New Rectangle(0, e.LineRect.Top, 15, 15), Color.White, Color.PowderBlue, 45), 0, e.LineRect.Top, 15, 15)
e.Graphics.DrawEllipse(Pens.PowderBlue, 0, e.LineRect.Top, 15, 15)
End If
End Sub
#End Region
#Region "Bookmarks"
Private Sub btGo_DropDownItemClicked_1(sender As Object, e As ToolStripItemClickedEventArgs) Handles btGo.DropDownItemClicked
TryCast(e.ClickedItem.Tag, Bookmark).DoVisible()
End Sub
Private Sub btAddBookmark_Click_1(sender As Object, e As EventArgs) Handles btAddBookmark.Click
CType(tc1.SelectedTab.Controls.Item(0), FastColoredTextBox).Bookmarks.Add(CType(tc1.SelectedTab.Controls.Item(0), FastColoredTextBox).Selection.Start.iLine)
End Sub
Private Sub btRemoveBookmark_Click_1(sender As Object, e As EventArgs) Handles btRemoveBookmark.Click
CType(tc1.SelectedTab.Controls.Item(0), FastColoredTextBox).Bookmarks.Remove(CType(tc1.SelectedTab.Controls.Item(0), FastColoredTextBox).Selection.Start.iLine)
End Sub
Private Sub btGo_DropDownOpening_1(sender As Object, e As EventArgs) Handles btGo.DropDownOpening
btGo.DropDownItems.Clear()
For Each bookmark In CType(tc1.SelectedTab.Controls.Item(0), FastColoredTextBox).Bookmarks
Dim item = btGo.DropDownItems.Add(bookmark.Name)
item.Tag = bookmark
Next
End Sub
#End Region
#Region "menuFile"
#Region "fileNew"
Private Sub fileNew_Click(sender As Object, e As EventArgs) Handles fileNew.Click, btnNew.Click
makenewtab()
CType(tc1.SelectedTab.Controls.Item(0), FastColoredTextBox).Text = File.ReadAllText("html.txt")
tc1.SelectedTab.Text = "New HTML Document.html"
End Sub
#End Region
#Region "fileOpen"
Private Sub fileOpen_Click(sender As Object, e As EventArgs) Handles fileOpen.Click, OpenToolStripButton.Click
ofd1.Filter =
"HTML Files (*.htm;*.html)|*.htm;*.html|" _
& "All Files(*.*)|*.*"
ofd1.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.Personal)
If (ofd1.ShowDialog() = DialogResult.OK) Then
makenewtab()
CType(tc1.SelectedTab.Controls.Item(0), FastColoredTextBox).Language = Language.HTML
CType(tc1.SelectedTab.Controls.Item(0), FastColoredTextBox).Text = File.ReadAllText(ofd1.FileName)
tc1.SelectedTab.Text = Path.GetFileName(ofd1.FileName)
End If
End Sub
#End Region
#Region "menuFileSave"
Private Sub fileSave_Click(sender As Object, e As EventArgs) Handles fileSave.Click, SaveToolStripButton.Click
Dim [unicode] As Encoding = Encoding.Unicode
If CType(tc1.SelectedTab.Controls.Item(0), FastColoredTextBox).Tag = Nothing Then
SaveFile()
Else
CType(tc1.SelectedTab.Controls.Item(0), FastColoredTextBox).SaveToFile(CType(tc1.SelectedTab.Controls.Item(0), FastColoredTextBox).Tag, unicode)
End If
End Sub
#End Region
#Region "menuFileSaveAs"
Public Function SaveFile()
Dim fctb As FastColoredTextBox
Dim [unicode] As Encoding = Encoding.Unicode
fctb = CType(tc1.SelectedTab.Controls.Item(0), FastColoredTextBox)
sfd1.Filter =
"HTML Files (*.htm;*.html)|*.htm;*.html|" _
& "All Files(*.*)|*.*"
sfd1.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.Personal)
If (sfd1.ShowDialog() = DialogResult.OK) Then
CType(tc1.SelectedTab.Controls.Item(0), FastColoredTextBox).SaveToFile(sfd1.FileName, unicode)
tc1.SelectedTab.Text = Path.GetFileName(sfd1.FileName)
'CType(tc1.selectedtab.Controls.Item(0), FastColoredTextBox).Tag = sfd1.FileName
'CType(tc1.selectedtab.Controls.Item(0), RichTextBox).Tag = ofd1.FileName
If tc1.SelectedTab.Controls.Contains(fctb) Then
CType(tc1.SelectedTab.Controls.Item(0), FastColoredTextBox).Tag = sfd1.FileName
End If
End If
Return Nothing
End Function
Private Sub fileSaveAs_Click(sender As Object, e As EventArgs) Handles fileSaveAs.Click
SaveFile()
End Sub
#End Region
#Region "Printing"
Private Sub PrintDocument1_PrintPage(sender As Object, e As Printing.PrintPageEventArgs) Handles PrintDocument1.PrintPage
e.Graphics.DrawString(CType(tc1.SelectedTab.Controls.Item(0), FastColoredTextBox).Text, CType(tc1.SelectedTab.Controls.Item(0), _
FastColoredTextBox).Font, Brushes.Blue, 100, 100)
End Sub
Private Sub PrintToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles PrintToolStripMenuItem.Click
Dim PrintDialog1 As New PrintDialog()
PrintDialog1.Document = PrintDocument1
If PrintDialog1.ShowDialog() = DialogResult.OK Then
PrintDocument1.Print()
End If
End Sub
Private Sub filePrint_Click(sender As Object, e As EventArgs) Handles filePrint.Click
PrintDocument1.DocumentName = CType(tc1.SelectedTab.Controls.Item(0), FastColoredTextBox).Tag
' Make a PrintDocument and attach it to
' the PrintPreview dialog.
dlgPrintPreview.Document = PrintDocument1
' Preview.
dlgPrintPreview.WindowState = FormWindowState.Maximized
dlgPrintPreview.ShowDialog()
End Sub
Private Sub fileQuickPrint_Click(sender As Object, e As EventArgs) Handles fileQuickPrint.Click
' Print immediately.
PrintDocument1.Print()
End Sub
Private Sub filePageSetup_Click(sender As Object, e As EventArgs) Handles filePageSetup.Click
Dim psd As New PageSetupDialog
With psd
.AllowMargins = True
.AllowOrientation = True
.AllowPaper = True
.AllowPrinter = True
.ShowHelp = True
.ShowNetwork = True
.Document = PrintDocument1
End With
psd.ShowDialog()
End Sub
#End Region
Private Sub ExitToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles ExitToolStripMenuItem.Click
Me.Close()
End Sub
#End Region
#Region "menuEdit"
Private Sub editCopy_Click(sender As Object, e As EventArgs) Handles editCopy.Click, CopyToolStripButton.Click
CType(tc1.SelectedTab.Controls.Item(0), FastColoredTextBox).Copy()
End Sub
Private Sub editPaste_Click(sender As Object, e As EventArgs) Handles editPaste.Click, PasteToolStripButton.Click
CType(tc1.SelectedTab.Controls.Item(0), FastColoredTextBox).Paste()
End Sub
Private Sub editUndo_Click(sender As Object, e As EventArgs) Handles editUndo.Click, btnUndo.Click
CType(tc1.SelectedTab.Controls.Item(0), FastColoredTextBox).Undo()
End Sub
Private Sub editRedo_Click(sender As Object, e As EventArgs) Handles editRedo.Click, btnRedo.Click
CType(tc1.SelectedTab.Controls.Item(0), FastColoredTextBox).Redo()
End Sub
Private Sub editCut_Click(sender As Object, e As EventArgs) Handles editCut.Click, CutToolStripButton.Click
CType(tc1.SelectedTab.Controls.Item(0), FastColoredTextBox).Cut()
End Sub
Private Sub editSelectAll_Click(sender As Object, e As EventArgs) Handles editSelectAll.Click
CType(tc1.SelectedTab.Controls.Item(0), FastColoredTextBox).SelectAll()
End Sub
#End Region
Private Sub toolsBrowser_Click(sender As Object, e As EventArgs) Handles toolsBrowser.Click
tcMain.SelectedTab = tabBrowser
Browser.Navigate(tc1.SelectedTab.Text)
End Sub
End Class
|
|
|
|

|
Sorry, I can not to debug your code because I have not all code (I do not see code of form initilization).
So, I can debug it only if you give me whole project (or working part of it).
But now I see one error of your code:
In method
Private Sub fctb_Resize(sender As Object, e As EventArgs)
CType(tc1.SelectedTab.Controls.Item(0), FastColoredTextBox).BackBrush = New LinearGradientBrush(CType(tc1.SelectedTab.Controls.Item(0), FastColoredTextBox).ClientRectangle, Color.White, Color.Silver, LinearGradientMode.Vertical)
End Sub
You use FCTB of selected tab page, but you need to use FCTB passed as sender:
Private Sub fctb_Resize(sender As Object, e As EventArgs)
var fctb = CType(sender, FastColoredTextBox)
fctb.BackBrush = New LinearGradientBrush(fctb.ClientRectangle, Color.White, Color.Silver, LinearGradientMode.Vertical)
End Sub
Same mistake in fctb_PaintLine.
Also, LinearGradientBrush is disposable resource, and you need dispose previous brush, before creating of new.
|
|
|
|

|
Thanx for quick reply Pavel
I think this may be what your looking for ...
[Code]
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Partial Class Form1
Inherits System.Windows.Forms.Form
'Form overrides dispose to clean up the component list.
<System.Diagnostics.DebuggerNonUserCode()> _
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
Try
If disposing AndAlso components IsNot Nothing Then
components.Dispose()
End If
Finally
MyBase.Dispose(disposing)
End Try
End Sub
'Required by the Windows Form Designer
Private components As System.ComponentModel.IContainer
'NOTE: The following procedure is required by the Windows Form Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
<System.Diagnostics.DebuggerStepThrough()> _
Private Sub InitializeComponent()
Me.components = New System.ComponentModel.Container()
Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(Form1))
Me.tcMain = New System.Windows.Forms.CustomTabControl()
Me.tabEditor = New System.Windows.Forms.TabPage()
Me.tc1 = New System.Windows.Forms.CustomTabControl()
Me.ImageList1 = New System.Windows.Forms.ImageList(Me.components)
Me.tabBrowser = New System.Windows.Forms.TabPage()
Me.Browser = New System.Windows.Forms.WebBrowser()
Me.MenuStrip1 = New System.Windows.Forms.MenuStrip()
Me.FileToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem()
Me.fileNew = New System.Windows.Forms.ToolStripMenuItem()
Me.fileOpen = New System.Windows.Forms.ToolStripMenuItem()
Me.toolStripSeparator = New System.Windows.Forms.ToolStripSeparator()
Me.fileSave = New System.Windows.Forms.ToolStripMenuItem()
Me.fileSaveAs = New System.Windows.Forms.ToolStripMenuItem()
Me.toolStripSeparator1 = New System.Windows.Forms.ToolStripSeparator()
Me.PrintToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem()
Me.filePrint = New System.Windows.Forms.ToolStripMenuItem()
Me.filePageSetup = New System.Windows.Forms.ToolStripMenuItem()
Me.fileQuickPrint = New System.Windows.Forms.ToolStripMenuItem()
Me.toolStripSeparator2 = New System.Windows.Forms.ToolStripSeparator()
Me.ExitToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem()
Me.EditToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem()
Me.editUndo = New System.Windows.Forms.ToolStripMenuItem()
Me.editRedo = New System.Windows.Forms.ToolStripMenuItem()
Me.toolStripSeparator3 = New System.Windows.Forms.ToolStripSeparator()
Me.editCut = New System.Windows.Forms.ToolStripMenuItem()
Me.editCopy = New System.Windows.Forms.ToolStripMenuItem()
Me.editPaste = New System.Windows.Forms.ToolStripMenuItem()
Me.toolStripSeparator4 = New System.Windows.Forms.ToolStripSeparator()
Me.editSelectAll = New System.Windows.Forms.ToolStripMenuItem()
Me.ToolsToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem()
Me.toolsBrowser = New System.Windows.Forms.ToolStripMenuItem()
Me.ToolStripSeparator10 = New System.Windows.Forms.ToolStripSeparator()
Me.CustomizeToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem()
Me.OptionsToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem()
Me.HelpToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem()
Me.ContentsToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem()
Me.IndexToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem()
Me.SearchToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem()
Me.toolStripSeparator5 = New System.Windows.Forms.ToolStripSeparator()
Me.AboutToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem()
Me.ToolStrip1 = New System.Windows.Forms.ToolStrip()
Me.btnNew = New System.Windows.Forms.ToolStripButton()
Me.OpenToolStripButton = New System.Windows.Forms.ToolStripButton()
Me.SaveToolStripButton = New System.Windows.Forms.ToolStripButton()
Me.PrintToolStripButton = New System.Windows.Forms.ToolStripButton()
Me.toolStripSeparator6 = New System.Windows.Forms.ToolStripSeparator()
Me.btnUndo = New System.Windows.Forms.ToolStripButton()
Me.btnRedo = New System.Windows.Forms.ToolStripButton()
Me.ToolStripSeparator12 = New System.Windows.Forms.ToolStripSeparator()
Me.CutToolStripButton = New System.Windows.Forms.ToolStripButton()
Me.CopyToolStripButton = New System.Windows.Forms.ToolStripButton()
Me.PasteToolStripButton = New System.Windows.Forms.ToolStripButton()
Me.toolStripSeparator7 = New System.Windows.Forms.ToolStripSeparator()
Me.btGo = New System.Windows.Forms.ToolStripDropDownButton()
Me.btAddBookmark = New System.Windows.Forms.ToolStripButton()
Me.btRemoveBookmark = New System.Windows.Forms.ToolStripButton()
Me.ToolStripSeparator11 = New System.Windows.Forms.ToolStripSeparator()
Me.StatusStrip1 = New System.Windows.Forms.StatusStrip()
Me.CustomTabControl1 = New System.Windows.Forms.CustomTabControl()
Me.TabPage2 = New System.Windows.Forms.TabPage()
Me.TabPage3 = New System.Windows.Forms.TabPage()
Me.cmMark2 = New System.Windows.Forms.ContextMenuStrip(Me.components)
Me.Yellow = New System.Windows.Forms.ToolStripMenuItem()
Me.Red = New System.Windows.Forms.ToolStripMenuItem()
Me.Green = New System.Windows.Forms.ToolStripMenuItem()
Me.ToolStripSeparator8 = New System.Windows.Forms.ToolStripSeparator()
Me.Markline = New System.Windows.Forms.ToolStripMenuItem()
Me.ToolStripSeparator9 = New System.Windows.Forms.ToolStripSeparator()
Me.Clearmarked = New System.Windows.Forms.ToolStripMenuItem()
Me.ofd1 = New System.Windows.Forms.OpenFileDialog()
Me.sfd1 = New System.Windows.Forms.SaveFileDialog()
Me.PrintDocument1 = New System.Drawing.Printing.PrintDocument()
Me.dlgPrintPreview = New System.Windows.Forms.PrintPreviewDialog()
Me.DexTreeView1 = New DexEditor.DexTreeView()
Me.tcMain.SuspendLayout()
Me.tabEditor.SuspendLayout()
Me.tabBrowser.SuspendLayout()
Me.MenuStrip1.SuspendLayout()
Me.ToolStrip1.SuspendLayout()
Me.CustomTabControl1.SuspendLayout()
Me.TabPage2.SuspendLayout()
Me.cmMark2.SuspendLayout()
Me.SuspendLayout()
'
'tcMain
'
Me.tcMain.Alignment = System.Windows.Forms.TabAlignment.Bottom
Me.tcMain.Controls.Add(Me.tabEditor)
Me.tcMain.Controls.Add(Me.tabBrowser)
Me.tcMain.DisplayStyle = System.Windows.Forms.TabStyle.Angled
'
'
'
Me.tcMain.DisplayStyleProvider.BorderColor = System.Drawing.SystemColors.ControlDark
Me.tcMain.DisplayStyleProvider.BorderColorHot = System.Drawing.SystemColors.ControlDark
Me.tcMain.DisplayStyleProvider.BorderColorSelected = System.Drawing.Color.FromArgb(CType(CType(127, Byte), Integer), CType(CType(157, Byte), Integer), CType(CType(185, Byte), Integer))
Me.tcMain.DisplayStyleProvider.CloserColor = System.Drawing.Color.DarkGray
Me.tcMain.DisplayStyleProvider.FocusTrack = False
Me.tcMain.DisplayStyleProvider.HotTrack = True
Me.tcMain.DisplayStyleProvider.ImageAlign = System.Drawing.ContentAlignment.MiddleRight
Me.tcMain.DisplayStyleProvider.Opacity = 1.0!
Me.tcMain.DisplayStyleProvider.Overlap = 7
Me.tcMain.DisplayStyleProvider.Padding = New System.Drawing.Point(10, 3)
Me.tcMain.DisplayStyleProvider.Radius = 10
Me.tcMain.DisplayStyleProvider.ShowTabCloser = False
Me.tcMain.DisplayStyleProvider.TextColor = System.Drawing.SystemColors.ControlText
Me.tcMain.DisplayStyleProvider.TextColorDisabled = System.Drawing.SystemColors.ControlDark
Me.tcMain.DisplayStyleProvider.TextColorSelected = System.Drawing.SystemColors.ControlText
Me.tcMain.Dock = System.Windows.Forms.DockStyle.Fill
Me.tcMain.HotTrack = True
Me.tcMain.Location = New System.Drawing.Point(200, 49)
Me.tcMain.Name = "tcMain"
Me.tcMain.SelectedIndex = 0
Me.tcMain.Size = New System.Drawing.Size(662, 376)
Me.tcMain.TabIndex = 0
'
'tabEditor
'
Me.tabEditor.Controls.Add(Me.tc1)
Me.tabEditor.Location = New System.Drawing.Point(4, 4)
Me.tabEditor.Name = "tabEditor"
Me.tabEditor.Padding = New System.Windows.Forms.Padding(3)
Me.tabEditor.Size = New System.Drawing.Size(654, 349)
Me.tabEditor.TabIndex = 0
Me.tabEditor.Text = "Editor"
Me.tabEditor.UseVisualStyleBackColor = True
'
'tc1
'
Me.tc1.DisplayStyle = System.Windows.Forms.TabStyle.VisualStudio
'
'
'
Me.tc1.DisplayStyleProvider.BorderColor = System.Drawing.SystemColors.ControlDark
Me.tc1.DisplayStyleProvider.BorderColorHot = System.Drawing.SystemColors.ControlDark
Me.tc1.DisplayStyleProvider.BorderColorSelected = System.Drawing.Color.FromArgb(CType(CType(127, Byte), Integer), CType(CType(157, Byte), Integer), CType(CType(185, Byte), Integer))
Me.tc1.DisplayStyleProvider.CloserColor = System.Drawing.Color.DarkGray
Me.tc1.DisplayStyleProvider.FocusTrack = False
Me.tc1.DisplayStyleProvider.HotTrack = True
Me.tc1.DisplayStyleProvider.ImageAlign = System.Drawing.ContentAlignment.MiddleRight
Me.tc1.DisplayStyleProvider.Opacity = 1.0!
Me.tc1.DisplayStyleProvider.Overlap = 7
Me.tc1.DisplayStyleProvider.Padding = New System.Drawing.Point(14, 1)
Me.tc1.DisplayStyleProvider.ShowTabCloser = False
Me.tc1.DisplayStyleProvider.TextColor = System.Drawing.SystemColors.ControlText
Me.tc1.DisplayStyleProvider.TextColorDisabled = System.Drawing.SystemColors.ControlDark
Me.tc1.DisplayStyleProvider.TextColorSelected = System.Drawing.SystemColors.ControlText
Me.tc1.Dock = System.Windows.Forms.DockStyle.Fill
Me.tc1.HotTrack = True
Me.tc1.ImageList = Me.ImageList1
Me.tc1.Location = New System.Drawing.Point(3, 3)
Me.tc1.Name = "tc1"
Me.tc1.SelectedIndex = 0
Me.tc1.Size = New System.Drawing.Size(648, 343)
Me.tc1.TabIndex = 0
'
'ImageList1
'
Me.ImageList1.ImageStream = CType(resources.GetObject("ImageList1.ImageStream"), System.Windows.Forms.ImageListStreamer)
Me.ImageList1.TransparentColor = System.Drawing.Color.Transparent
Me.ImageList1.Images.SetKeyName(0, "Code_ClassCS.ico")
Me.ImageList1.Images.SetKeyName(1, "Code_ClassVB.ico")
Me.ImageList1.Images.SetKeyName(2, "Code_CodeFileCS.ico")
Me.ImageList1.Images.SetKeyName(3, "Code_CodeFileVB.ico")
Me.ImageList1.Images.SetKeyName(4, "Code_Component.ico")
Me.ImageList1.Images.SetKeyName(5, "Code_WebService.ico")
Me.ImageList1.Images.SetKeyName(6, "Utility_VBScript.ico")
Me.ImageList1.Images.SetKeyName(7, "UtilityText.ico")
Me.ImageList1.Images.SetKeyName(8, "VSProject_genericproject.ico")
Me.ImageList1.Images.SetKeyName(9, "Web_GlobalAppClass.ico")
Me.ImageList1.Images.SetKeyName(10, "Web_HTML.ico")
Me.ImageList1.Images.SetKeyName(11, "Web_StyleSheet.ico")
Me.ImageList1.Images.SetKeyName(12, "Web_WebConfig.ico")
Me.ImageList1.Images.SetKeyName(13, "Web_XML.ico")
Me.ImageList1.Images.SetKeyName(14, "Web_XSLT.ico")
'
'tabBrowser
'
Me.tabBrowser.Controls.Add(Me.Browser)
Me.tabBrowser.Location = New System.Drawing.Point(4, 4)
Me.tabBrowser.Name = "tabBrowser"
Me.tabBrowser.Padding = New System.Windows.Forms.Padding(3)
Me.tabBrowser.Size = New System.Drawing.Size(654, 349)
Me.tabBrowser.TabIndex = 1
Me.tabBrowser.Text = "Browser"
Me.tabBrowser.UseVisualStyleBackColor = True
'
'Browser
'
Me.Browser.Dock = System.Windows.Forms.DockStyle.Fill
Me.Browser.Location = New System.Drawing.Point(3, 3)
Me.Browser.MinimumSize = New System.Drawing.Size(20, 20)
Me.Browser.Name = "Browser"
Me.Browser.Size = New System.Drawing.Size(648, 343)
Me.Browser.TabIndex = 0
'
'MenuStrip1
'
Me.MenuStrip1.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.FileToolStripMenuItem, Me.EditToolStripMenuItem, Me.ToolsToolStripMenuItem, Me.HelpToolStripMenuItem})
Me.MenuStrip1.Location = New System.Drawing.Point(0, 0)
Me.MenuStrip1.Name = "MenuStrip1"
Me.MenuStrip1.Size = New System.Drawing.Size(862, 24)
Me.MenuStrip1.TabIndex = 1
Me.MenuStrip1.Text = "MenuStrip1"
'
'FileToolStripMenuItem
'
Me.FileToolStripMenuItem.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.fileNew, Me.fileOpen, Me.toolStripSeparator, Me.fileSave, Me.fileSaveAs, Me.toolStripSeparator1, Me.PrintToolStripMenuItem, Me.filePrint, Me.filePageSetup, Me.fileQuickPrint, Me.toolStripSeparator2, Me.ExitToolStripMenuItem})
Me.FileToolStripMenuItem.Name = "FileToolStripMenuItem"
Me.FileToolStripMenuItem.Size = New System.Drawing.Size(37, 20)
Me.FileToolStripMenuItem.Text = "&File"
'
'fileNew
'
Me.fileNew.Image = CType(resources.GetObject("fileNew.Image"), System.Drawing.Image)
Me.fileNew.ImageTransparentColor = System.Drawing.Color.Magenta
Me.fileNew.Name = "fileNew"
Me.fileNew.ShortcutKeys = CType((System.Windows.Forms.Keys.Control Or System.Windows.Forms.Keys.N), System.Windows.Forms.Keys)
Me.fileNew.Size = New System.Drawing.Size(146, 22)
Me.fileNew.Text = "&New"
'
'fileOpen
'
Me.fileOpen.Image = CType(resources.GetObject("fileOpen.Image"), System.Drawing.Image)
Me.fileOpen.ImageTransparentColor = System.Drawing.Color.Magenta
Me.fileOpen.Name = "fileOpen"
Me.fileOpen.ShortcutKeys = CType((System.Windows.Forms.Keys.Control Or System.Windows.Forms.Keys.O), System.Windows.Forms.Keys)
Me.fileOpen.Size = New System.Drawing.Size(146, 22)
Me.fileOpen.Text = "&Open"
'
'toolStripSeparator
'
Me.toolStripSeparator.Name = "toolStripSeparator"
Me.toolStripSeparator.Size = New System.Drawing.Size(143, 6)
'
'fileSave
'
Me.fileSave.Image = CType(resources.GetObject("fileSave.Image"), System.Drawing.Image)
Me.fileSave.ImageTransparentColor = System.Drawing.Color.Magenta
Me.fileSave.Name = "fileSave"
Me.fileSave.ShortcutKeys = CType((System.Windows.Forms.Keys.Control Or System.Windows.Forms.Keys.S), System.Windows.Forms.Keys)
Me.fileSave.Size = New System.Drawing.Size(146, 22)
Me.fileSave.Text = "&Save"
'
'fileSaveAs
'
Me.fileSaveAs.Name = "fileSaveAs"
Me.fileSaveAs.Size = New System.Drawing.Size(146, 22)
Me.fileSaveAs.Text = "Save &As"
'
'toolStripSeparator1
'
Me.toolStripSeparator1.Name = "toolStripSeparator1"
Me.toolStripSeparator1.Size = New System.Drawing.Size(143, 6)
'
'PrintToolStripMenuItem
'
Me.PrintToolStripMenuItem.Image = CType(resources.GetObject("PrintToolStripMenuItem.Image"), System.Drawing.Image)
Me.PrintToolStripMenuItem.ImageTransparentColor = System.Drawing.Color.Magenta
Me.PrintToolStripMenuItem.Name = "PrintToolStripMenuItem"
Me.PrintToolStripMenuItem.ShortcutKeys = CType((System.Windows.Forms.Keys.Control Or System.Windows.Forms.Keys.P), System.Windows.Forms.Keys)
Me.PrintToolStripMenuItem.Size = New System.Drawing.Size(146, 22)
Me.PrintToolStripMenuItem.Text = "&Print"
'
'filePrint
'
Me.filePrint.Image = CType(resources.GetObject("filePrint.Image"), System.Drawing.Image)
Me.filePrint.ImageTransparentColor = System.Drawing.Color.Magenta
Me.filePrint.Name = "filePrint"
Me.filePrint.Size = New System.Drawing.Size(146, 22)
Me.filePrint.Text = "Print Pre&view"
'
'filePageSetup
'
Me.filePageSetup.Image = CType(resources.GetObject("filePageSetup.Image"), System.Drawing.Image)
Me.filePageSetup.Name = "filePageSetup"
Me.filePageSetup.Size = New System.Drawing.Size(146, 22)
Me.filePageSetup.Text = "Page Setup"
'
'fileQuickPrint
'
Me.fileQuickPrint.Name = "fileQuickPrint"
Me.fileQuickPrint.Size = New System.Drawing.Size(146, 22)
Me.fileQuickPrint.Text = "Quick Print"
'
'toolStripSeparator2
'
Me.toolStripSeparator2.Name = "toolStripSeparator2"
Me.toolStripSeparator2.Size = New System.Drawing.Size(143, 6)
'
'ExitToolStripMenuItem
'
Me.ExitToolStripMenuItem.Name = "ExitToolStripMenuItem"
Me.ExitToolStripMenuItem.Size = New System.Drawing.Size(146, 22)
Me.ExitToolStripMenuItem.Text = "E&xit"
'
'EditToolStripMenuItem
'
Me.EditToolStripMenuItem.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.editUndo, Me.editRedo, Me.toolStripSeparator3, Me.editCut, Me.editCopy, Me.editPaste, Me.toolStripSeparator4, Me.editSelectAll})
Me.EditToolStripMenuItem.Name = "EditToolStripMenuItem"
Me.EditToolStripMenuItem.Size = New System.Drawing.Size(39, 20)
Me.EditToolStripMenuItem.Text = "&Edit"
'
'editUndo
'
Me.editUndo.Image = CType(resources.GetObject("editUndo.Image"), System.Drawing.Image)
Me.editUndo.Name = "editUndo"
Me.editUndo.ShortcutKeys = CType((System.Windows.Forms.Keys.Control Or System.Windows.Forms.Keys.Z), System.Windows.Forms.Keys)
Me.editUndo.Size = New System.Drawing.Size(144, 22)
Me.editUndo.Text = "&Undo"
'
'editRedo
'
Me.editRedo.Image = CType(resources.GetObject("editRedo.Image"), System.Drawing.Image)
Me.editRedo.Name = "editRedo"
Me.editRedo.ShortcutKeys = CType((System.Windows.Forms.Keys.Control Or System.Windows.Forms.Keys.Y), System.Windows.Forms.Keys)
Me.editRedo.Size = New System.Drawing.Size(144, 22)
Me.editRedo.Text = "&Redo"
'
'toolStripSeparator3
'
Me.toolStripSeparator3.Name = "toolStripSeparator3"
Me.toolStripSeparator3.Size = New System.Drawing.Size(141, 6)
'
'editCut
'
Me.editCut.Image = CType(resources.GetObject("editCut.Image"), System.Drawing.Image)
Me.editCut.ImageTransparentColor = System.Drawing.Color.Magenta
Me.editCut.Name = "editCut"
Me.editCut.ShortcutKeys = CType((System.Windows.Forms.Keys.Control Or System.Windows.Forms.Keys.X), System.Windows.Forms.Keys)
Me.editCut.Size = New System.Drawing.Size(144, 22)
Me.editCut.Text = "Cu&t"
'
'editCopy
'
Me.editCopy.Image = CType(resources.GetObject("editCopy.Image"), System.Drawing.Image)
Me.editCopy.ImageTransparentColor = System.Drawing.Color.Magenta
Me.editCopy.Name = "editCopy"
Me.editCopy.ShortcutKeys = CType((System.Windows.Forms.Keys.Control Or System.Windows.Forms.Keys.C), System.Windows.Forms.Keys)
Me.editCopy.Size = New System.Drawing.Size(144, 22)
Me.editCopy.Text = "&Copy"
'
'editPaste
'
Me.editPaste.Image = CType(resources.GetObject("editPaste.Image"), System.Drawing.Image)
Me.editPaste.ImageTransparentColor = System.Drawing.Color.Magenta
Me.editPaste.Name = "editPaste"
Me.editPaste.ShortcutKeys = CType((System.Windows.Forms.Keys.Control Or System.Windows.Forms.Keys.V), System.Windows.Forms.Keys)
Me.editPaste.Size = New System.Drawing.Size(144, 22)
Me.editPaste.Text = "&Paste"
'
'toolStripSeparator4
'
Me.toolStripSeparator4.Name = "toolStripSeparator4"
Me.toolStripSeparator4.Size = New System.Drawing.Size(141, 6)
'
'editSelectAll
'
Me.editSelectAll.Image = CType(resources.GetObject("editSelectAll.Image"), System.Drawing.Image)
Me.editSelectAll.Name = "editSelectAll"
Me.editSelectAll.Size = New System.Drawing.Size(144, 22)
Me.editSelectAll.Text = "Select &All"
'
'ToolsToolStripMenuItem
'
Me.ToolsToolStripMenuItem.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.toolsBrowser, Me.ToolStripSeparator10, Me.CustomizeToolStripMenuItem, Me.OptionsToolStripMenuItem})
Me.ToolsToolStripMenuItem.Name = "ToolsToolStripMenuItem"
Me.ToolsToolStripMenuItem.Size = New System.Drawing.Size(48, 20)
Me.ToolsToolStripMenuItem.Text = "&Tools"
'
'toolsBrowser
'
Me.toolsBrowser.Image = CType(resources.GetObject("toolsBrowser.Image"), System.Drawing.Image)
Me.toolsBrowser.Name = "toolsBrowser"
Me.toolsBrowser.Size = New System.Drawing.Size(173, 22)
Me.toolsBrowser.Text = "Preview in Browser"
'
'ToolStripSeparator10
'
Me.ToolStripSeparator10.Name = "ToolStripSeparator10"
Me.ToolStripSeparator10.Size = New System.Drawing.Size(170, 6)
'
'CustomizeToolStripMenuItem
'
Me.CustomizeToolStripMenuItem.Name = "CustomizeToolStripMenuItem"
Me.CustomizeToolStripMenuItem.Size = New System.Drawing.Size(173, 22)
Me.CustomizeToolStripMenuItem.Text = "&Customize"
'
'OptionsToolStripMenuItem
'
Me.OptionsToolStripMenuItem.Name = "OptionsToolStripMenuItem"
Me.OptionsToolStripMenuItem.Size = New System.Drawing.Size(173, 22)
Me.OptionsToolStripMenuItem.Text = "&Options"
'
'HelpToolStripMenuItem
'
Me.HelpToolStripMenuItem.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.ContentsToolStripMenuItem, Me.IndexToolStripMenuItem, Me.SearchToolStripMenuItem, Me.toolStripSeparator5, Me.AboutToolStripMenuItem})
Me.HelpToolStripMenuItem.Name = "HelpToolStripMenuItem"
Me.HelpToolStripMenuItem.Size = New System.Drawing.Size(44, 20)
Me.HelpToolStripMenuItem.Text = "&Help"
'
'ContentsToolStripMenuItem
'
Me.ContentsToolStripMenuItem.Name = "ContentsToolStripMenuItem"
Me.ContentsToolStripMenuItem.Size = New System.Drawing.Size(122, 22)
Me.ContentsToolStripMenuItem.Text = "&Contents"
'
'IndexToolStripMenuItem
'
Me.IndexToolStripMenuItem.Name = "IndexToolStripMenuItem"
Me.IndexToolStripMenuItem.Size = New System.Drawing.Size(122, 22)
Me.IndexToolStripMenuItem.Text = "&Index"
'
'SearchToolStripMenuItem
'
Me.SearchToolStripMenuItem.Name = "SearchToolStripMenuItem"
Me.SearchToolStripMenuItem.Size = New System.Drawing.Size(122, 22)
Me.SearchToolStripMenuItem.Text = "&Search"
'
'toolStripSeparator5
'
Me.toolStripSeparator5.Name = "toolStripSeparator5"
Me.toolStripSeparator5.Size = New System.Drawing.Size(119, 6)
'
'AboutToolStripMenuItem
'
Me.AboutToolStripMenuItem.Name = "AboutToolStripMenuItem"
Me.AboutToolStripMenuItem.Size = New System.Drawing.Size(122, 22)
Me.AboutToolStripMenuItem.Text = "&About..."
'
'ToolStrip1
'
Me.ToolStrip1.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.btnNew, Me.OpenToolStripButton, Me.SaveToolStripButton, Me.PrintToolStripButton, Me.toolStripSeparator6, Me.btnUndo, Me.btnRedo, Me.ToolStripSeparator12, Me.CutToolStripButton, Me.CopyToolStripButton, Me.PasteToolStripButton, Me.toolStripSeparator7, Me.btGo, Me.btAddBookmark, Me.btRemoveBookmark, Me.ToolStripSeparator11})
Me.ToolStrip1.Location = New System.Drawing.Point(0, 24)
Me.ToolStrip1.Name = "ToolStrip1"
Me.ToolStrip1.Size = New System.Drawing.Size(862, 25)
Me.ToolStrip1.TabIndex = 2
Me.ToolStrip1.Text = "ToolStrip1"
'
'btnNew
'
Me.btnNew.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image
Me.btnNew.Image = CType(resources.GetObject("btnNew.Image"), System.Drawing.Image)
Me.btnNew.ImageTransparentColor = System.Drawing.Color.Magenta
Me.btnNew.Name = "btnNew"
Me.btnNew.Size = New System.Drawing.Size(23, 22)
Me.btnNew.Text = "&New"
'
'OpenToolStripButton
'
Me.OpenToolStripButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image
Me.OpenToolStripButton.Image = CType(resources.GetObject("OpenToolStripButton.Image"), System.Drawing.Image)
Me.OpenToolStripButton.ImageTransparentColor = System.Drawing.Color.Magenta
Me.OpenToolStripButton.Name = "OpenToolStripButton"
Me.OpenToolStripButton.Size = New System.Drawing.Size(23, 22)
Me.OpenToolStripButton.Text = "&Open"
'
'SaveToolStripButton
'
Me.SaveToolStripButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image
Me.SaveToolStripButton.Image = CType(resources.GetObject("SaveToolStripButton.Image"), System.Drawing.Image)
Me.SaveToolStripButton.ImageTransparentColor = System.Drawing.Color.Magenta
Me.SaveToolStripButton.Name = "SaveToolStripButton"
Me.SaveToolStripButton.Size = New System.Drawing.Size(23, 22)
Me.SaveToolStripButton.Text = "&Save"
'
'PrintToolStripButton
'
Me.PrintToolStripButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image
Me.PrintToolStripButton.Image = CType(resources.GetObject("PrintToolStripButton.Image"), System.Drawing.Image)
Me.PrintToolStripButton.ImageTransparentColor = System.Drawing.Color.Magenta
Me.PrintToolStripButton.Name = "PrintToolStripButton"
Me.PrintToolStripButton.Size = New System.Drawing.Size(23, 22)
Me.PrintToolStripButton.Text = "&Print"
'
'toolStripSeparator6
'
Me.toolStripSeparator6.Name = "toolStripSeparator6"
Me.toolStripSeparator6.Size = New System.Drawing.Size(6, 25)
'
'btnUndo
'
Me.btnUndo.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image
Me.btnUndo.Image = CType(resources.GetObject("btnUndo.Image"), System.Drawing.Image)
Me.btnUndo.ImageTransparentColor = System.Drawing.Color.Magenta
Me.btnUndo.Name = "btnUndo"
Me.btnUndo.Size = New System.Drawing.Size(23, 22)
Me.btnUndo.Text = "ToolStripButton1"
Me.btnUndo.ToolTipText = "Undo"
'
'btnRedo
'
Me.btnRedo.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image
Me.btnRedo.Image = CType(resources.GetObject("btnRedo.Image"), System.Drawing.Image)
Me.btnRedo.ImageTransparentColor = System.Drawing.Color.Magenta
Me.btnRedo.Name = "btnRedo"
Me.btnRedo.Size = New System.Drawing.Size(23, 22)
Me.btnRedo.Text = "ToolStripButton2"
Me.btnRedo.ToolTipText = "Redo"
'
'ToolStripSeparator12
'
Me.ToolStripSeparator12.Name = "ToolStripSeparator12"
Me.ToolStripSeparator12.Size = New System.Drawing.Size(6, 25)
'
'CutToolStripButton
'
Me.CutToolStripButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image
Me.CutToolStripButton.Image = CType(resources.GetObject("CutToolStripButton.Image"), System.Drawing.Image)
Me.CutToolStripButton.ImageTransparentColor = System.Drawing.Color.Magenta
Me.CutToolStripButton.Name = "CutToolStripButton"
Me.CutToolStripButton.Size = New System.Drawing.Size(23, 22)
Me.CutToolStripButton.Text = "C&ut"
'
'CopyToolStripButton
'
Me.CopyToolStripButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image
Me.CopyToolStripButton.Image = CType(resources.GetObject("CopyToolStripButton.Image"), System.Drawing.Image)
Me.CopyToolStripButton.ImageTransparentColor = System.Drawing.Color.Magenta
Me.CopyToolStripButton.Name = "CopyToolStripButton"
Me.CopyToolStripButton.Size = New System.Drawing.Size(23, 22)
Me.CopyToolStripButton.Text = "&Copy"
'
'PasteToolStripButton
'
Me.PasteToolStripButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image
Me.PasteToolStripButton.Image = CType(resources.GetObject("PasteToolStripButton.Image"), System.Drawing.Image)
Me.PasteToolStripButton.ImageTransparentColor = System.Drawing.Color.Magenta
Me.PasteToolStripButton.Name = "PasteToolStripButton"
Me.PasteToolStripButton.Size = New System.Drawing.Size(23, 22)
Me.PasteToolStripButton.Text = "&Paste"
'
'toolStripSeparator7
'
Me.toolStripSeparator7.Name = "toolStripSeparator7"
Me.toolStripSeparator7.Size = New System.Drawing.Size(6, 25)
'
'btGo
'
Me.btGo.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image
Me.btGo.Image = CType(resources.GetObject("btGo.Image"), System.Drawing.Image)
Me.btGo.ImageTransparentColor = System.Drawing.Color.Magenta
Me.btGo.Name = "btGo"
Me.btGo.Size = New System.Drawing.Size(29, 22)
Me.btGo.Text = "ToolStripDropDownButton1"
Me.btGo.ToolTipText = "Saved Bookmarks"
'
'btAddBookmark
'
Me.btAddBookmark.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image
Me.btAddBookmark.Image = CType(resources.GetObject("btAddBookmark.Image"), System.Drawing.Image)
Me.btAddBookmark.ImageTransparentColor = System.Drawing.Color.Magenta
Me.btAddBookmark.Name = "btAddBookmark"
Me.btAddBookmark.Size = New System.Drawing.Size(23, 22)
Me.btAddBookmark.Text = "ToolStripButton1"
Me.btAddBookmark.ToolTipText = "Add Selected Bookmark"
'
'btRemoveBookmark
'
Me.btRemoveBookmark.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image
Me.btRemoveBookmark.Image = CType(resources.GetObject("btRemoveBookmark.Image"), System.Drawing.Image)
Me.btRemoveBookmark.ImageTransparentColor = System.Drawing.Color.Magenta
Me.btRemoveBookmark.Name = "btRemoveBookmark"
Me.btRemoveBookmark.Size = New System.Drawing.Size(23, 22)
Me.btRemoveBookmark.Text = "ToolStripButton1"
'
'ToolStripSeparator11
'
Me.ToolStripSeparator11.Name = "ToolStripSeparator11"
Me.ToolStripSeparator11.Size = New System.Drawing.Size(6, 25)
'
'StatusStrip1
'
Me.StatusStrip1.Location = New System.Drawing.Point(0, 425)
Me.StatusStrip1.Name = "StatusStrip1"
Me.StatusStrip1.Size = New System.Drawing.Size(862, 22)
Me.StatusStrip1.TabIndex = 3
Me.StatusStrip1.Text = "StatusStrip1"
'
'CustomTabControl1
'
Me.CustomTabControl1.Alignment = System.Windows.Forms.TabAlignment.Bottom
Me.CustomTabControl1.Controls.Add(Me.TabPage2)
Me.CustomTabControl1.Controls.Add(Me.TabPage3)
Me.CustomTabControl1.DisplayStyle = System.Windows.Forms.TabStyle.VisualStudio
'
'
'
Me.CustomTabControl1.DisplayStyleProvider.BorderColor = System.Drawing.SystemColors.ControlDark
Me.CustomTabControl1.DisplayStyleProvider.BorderColorHot = System.Drawing.SystemColors.ControlDark
Me.CustomTabControl1.DisplayStyleProvider.BorderColorSelected = System.Drawing.Color.FromArgb(CType(CType(127, Byte), Integer), CType(CType(157, Byte), Integer), CType(CType(185, Byte), Integer))
Me.CustomTabControl1.DisplayStyleProvider.CloserColor = System.Drawing.Color.DarkGray
Me.CustomTabControl1.DisplayStyleProvider.FocusTrack = False
Me.CustomTabControl1.DisplayStyleProvider.HotTrack = True
Me.CustomTabControl1.DisplayStyleProvider.ImageAlign = System.Drawing.ContentAlignment.MiddleRight
Me.CustomTabControl1.DisplayStyleProvider.Opacity = 1.0!
Me.CustomTabControl1.DisplayStyleProvider.Overlap = 7
Me.CustomTabControl1.DisplayStyleProvider.Padding = New System.Drawing.Point(14, 1)
Me.CustomTabControl1.DisplayStyleProvider.ShowTabCloser = False
Me.CustomTabControl1.DisplayStyleProvider.TextColor = System.Drawing.SystemColors.ControlText
Me.CustomTabControl1.DisplayStyleProvider.TextColorDisabled = System.Drawing.SystemColors.ControlDark
Me.CustomTabControl1.DisplayStyleProvider.TextColorSelected = System.Drawing.SystemColors.ControlText
Me.CustomTabControl1.Dock = System.Windows.Forms.DockStyle.Left
Me.CustomTabControl1.HotTrack = True
Me.CustomTabControl1.Location = New System.Drawing.Point(0, 49)
Me.CustomTabControl1.Name = "CustomTabControl1"
Me.CustomTabControl1.SelectedIndex = 0
Me.CustomTabControl1.Size = New System.Drawing.Size(200, 376)
Me.CustomTabControl1.TabIndex = 4
'
'TabPage2
'
Me.TabPage2.Controls.Add(Me.DexTreeView1)
Me.TabPage2.Location = New System.Drawing.Point(4, 4)
Me.TabPage2.Name = "TabPage2"
Me.TabPage2.Padding = New System.Windows.Forms.Padding(3)
Me.TabPage2.Size = New System.Drawing.Size(192, 351)
Me.TabPage2.TabIndex = 0
Me.TabPage2.Text = "Project Files"
Me.TabPage2.UseVisualStyleBackColor = True
'
'TabPage3
'
Me.TabPage3.Location = New System.Drawing.Point(4, 4)
Me.TabPage3.Name = "TabPage3"
Me.TabPage3.Padding = New System.Windows.Forms.Padding(3)
Me.TabPage3.Size = New System.Drawing.Size(192, 351)
Me.TabPage3.TabIndex = 1
Me.TabPage3.Text = "HTML Code"
Me.TabPage3.UseVisualStyleBackColor = True
'
'cmMark2
'
Me.cmMark2.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.Yellow, Me.Red, Me.Green, Me.ToolStripSeparator8, Me.Markline, Me.ToolStripSeparator9, Me.Clearmarked})
Me.cmMark2.Name = "cmMark2"
Me.cmMark2.Size = New System.Drawing.Size(154, 126)
'
'Yellow
'
Me.Yellow.Name = "Yellow"
Me.Yellow.Size = New System.Drawing.Size(153, 22)
Me.Yellow.Text = "Mark as Yellow"
'
'Red
'
Me.Red.Name = "Red"
Me.Red.Size = New System.Drawing.Size(153, 22)
Me.Red.Text = "Mark as Red"
'
'Green
'
Me.Green.Name = "Green"
Me.Green.Size = New System.Drawing.Size(153, 22)
Me.Green.Text = "Mark as Green"
'
'ToolStripSeparator8
'
Me.ToolStripSeparator8.Name = "ToolStripSeparator8"
Me.ToolStripSeparator8.Size = New System.Drawing.Size(150, 6)
'
'Markline
'
Me.Markline.Name = "Markline"
Me.Markline.Size = New System.Drawing.Size(153, 22)
Me.Markline.Text = "Mark Line"
'
'ToolStripSeparator9
'
Me.ToolStripSeparator9.Name = "ToolStripSeparator9"
Me.ToolStripSeparator9.Size = New System.Drawing.Size(150, 6)
'
'Clearmarked
'
Me.Clearmarked.Name = "Clearmarked"
Me.Clearmarked.Size = New System.Drawing.Size(153, 22)
Me.Clearmarked.Text = "Clear Marked"
'
'PrintDocument1
'
'
'dlgPrintPreview
'
Me.dlgPrintPreview.AutoScrollMargin = New System.Drawing.Size(0, 0)
Me.dlgPrintPreview.AutoScrollMinSize = New System.Drawing.Size(0, 0)
Me.dlgPrintPreview.ClientSize = New System.Drawing.Size(400, 300)
Me.dlgPrintPreview.Enabled = True
Me.dlgPrintPreview.Icon = CType(resources.GetObject("dlgPrintPreview.Icon"), System.Drawing.Icon)
Me.dlgPrintPreview.Name = "dlgPrintPreview"
Me.dlgPrintPreview.Visible = False
'
'DexTreeView1
'
Me.DexTreeView1.Dock = System.Windows.Forms.DockStyle.Fill
Me.DexTreeView1.Location = New System.Drawing.Point(3, 3)
Me.DexTreeView1.Name = "DexTreeView1"
Me.DexTreeView1.RootPath = "C:\Users\Dexter\Documents"
Me.DexTreeView1.Size = New System.Drawing.Size(186, 345)
Me.DexTreeView1.StartPath = DexEditor.Root.MyComputer
Me.DexTreeView1.TabIndex = 0
'
'Form1
'
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.ClientSize = New System.Drawing.Size(862, 447)
Me.Controls.Add(Me.tcMain)
Me.Controls.Add(Me.CustomTabControl1)
Me.Controls.Add(Me.StatusStrip1)
Me.Controls.Add(Me.ToolStrip1)
Me.Controls.Add(Me.MenuStrip1)
Me.MainMenuStrip = Me.MenuStrip1
Me.Name = "Form1"
Me.Text = "DexEditor"
Me.tcMain.ResumeLayout(False)
Me.tabEditor.ResumeLayout(False)
Me.tabBrowser.ResumeLayout(False)
Me.MenuStrip1.ResumeLayout(False)
Me.MenuStrip1.PerformLayout()
Me.ToolStrip1.ResumeLayout(False)
Me.ToolStrip1.PerformLayout()
Me.CustomTabControl1.ResumeLayout(False)
Me.TabPage2.ResumeLayout(False)
Me.cmMark2.ResumeLayout(False)
Me.ResumeLayout(False)
Me.PerformLayout()
End Sub
Friend WithEvents tcMain As System.Windows.Forms.CustomTabControl
Friend WithEvents tabEditor As System.Windows.Forms.TabPage
Friend WithEvents tabBrowser As System.Windows.Forms.TabPage
Friend WithEvents tc1 As System.Windows.Forms.CustomTabControl
Friend WithEvents ImageList1 As System.Windows.Forms.ImageList
Friend WithEvents MenuStrip1 As System.Windows.Forms.MenuStrip
Friend WithEvents FileToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem
Friend WithEvents fileNew As System.Windows.Forms.ToolStripMenuItem
Friend WithEvents fileOpen As System.Windows.Forms.ToolStripMenuItem
Friend WithEvents toolStripSeparator As System.Windows.Forms.ToolStripSeparator
Friend WithEvents fileSave As System.Windows.Forms.ToolStripMenuItem
Friend WithEvents fileSaveAs As System.Windows.Forms.ToolStripMenuItem
Friend WithEvents toolStripSeparator1 As System.Windows.Forms.ToolStripSeparator
Friend WithEvents PrintToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem
Friend WithEvents filePrint As System.Windows.Forms.ToolStripMenuItem
Friend WithEvents toolStripSeparator2 As System.Windows.Forms.ToolStripSeparator
Friend WithEvents ExitToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem
Friend WithEvents EditToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem
Friend WithEvents editUndo As System.Windows.Forms.ToolStripMenuItem
Friend WithEvents editRedo As System.Windows.Forms.ToolStripMenuItem
Friend WithEvents toolStripSeparator3 As System.Windows.Forms.ToolStripSeparator
Friend WithEvents editCut As System.Windows.Forms.ToolStripMenuItem
Friend WithEvents editCopy As System.Windows.Forms.ToolStripMenuItem
Friend WithEvents editPaste As System.Windows.Forms.ToolStripMenuItem
Friend WithEvents toolStripSeparator4 As System.Windows.Forms.ToolStripSeparator
Friend WithEvents editSelectAll As System.Windows.Forms.ToolStripMenuItem
Friend WithEvents ToolsToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem
Friend WithEvents CustomizeToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem
Friend WithEvents OptionsToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem
Friend WithEvents HelpToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem
Friend WithEvents ContentsToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem
Friend WithEvents IndexToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem
Friend WithEvents SearchToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem
Friend WithEvents toolStripSeparator5 As System.Windows.Forms.ToolStripSeparator
Friend WithEvents AboutToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem
Friend WithEvents ToolStrip1 As System.Windows.Forms.ToolStrip
Friend WithEvents btnNew As System.Windows.Forms.ToolStripButton
Friend WithEvents OpenToolStripButton As System.Windows.Forms.ToolStripButton
Friend WithEvents SaveToolStripButton As System.Windows.Forms.ToolStripButton
Friend WithEvents PrintToolStripButton As System.Windows.Forms.ToolStripButton
Friend WithEvents toolStripSeparator6 As System.Windows.Forms.ToolStripSeparator
Friend WithEvents CutToolStripButton As System.Windows.Forms.ToolStripButton
Friend WithEvents CopyToolStripButton As System.Windows.Forms.ToolStripButton
Friend WithEvents PasteToolStripButton As System.Windows.Forms.ToolStripButton
Friend WithEvents toolStripSeparator7 As System.Windows.Forms.ToolStripSeparator
Friend WithEvents StatusStrip1 As System.Windows.Forms.StatusStrip
Friend WithEvents CustomTabControl1 As System.Windows.Forms.CustomTabControl
Friend WithEvents TabPage2 As System.Windows.Forms.TabPage
Friend WithEvents TabPage3 As System.Windows.Forms.TabPage
Friend WithEvents DexTreeView1 As DexEditor.DexTreeView
Friend WithEvents cmMark2 As System.Windows.Forms.ContextMenuStrip
Friend WithEvents Yellow As System.Windows.Forms.ToolStripMenuItem
Friend WithEvents Red As System.Windows.Forms.ToolStripMenuItem
Friend WithEvents Green As System.Windows.Forms.ToolStripMenuItem
Friend WithEvents ToolStripSeparator8 As System.Windows.Forms.ToolStripSeparator
Friend WithEvents Markline As System.Windows.Forms.ToolStripMenuItem
Friend WithEvents ToolStripSeparator9 As System.Windows.Forms.ToolStripSeparator
Friend WithEvents Clearmarked As System.Windows.Forms.ToolStripMenuItem
Friend WithEvents btGo As System.Windows.Forms.ToolStripDropDownButton
Friend WithEvents btAddBookmark As System.Windows.Forms.ToolStripButton
Friend WithEvents btRemoveBookmark As System.Windows.Forms.ToolStripButton
Friend WithEvents ToolStripSeparator11 As System.Windows.Forms.ToolStripSeparator
Friend WithEvents ofd1 As System.Windows.Forms.OpenFileDialog
Friend WithEvents sfd1 As System.Windows.Forms.SaveFileDialog
Friend WithEvents PrintDocument1 As System.Drawing.Printing.PrintDocument
Friend WithEvents dlgPrintPreview As System.Windows.Forms.PrintPreviewDialog
Friend WithEvents fileQuickPrint As System.Windows.Forms.ToolStripMenuItem
Friend WithEvents filePageSetup As System.Windows.Forms.ToolStripMenuItem
Friend WithEvents btnUndo As System.Windows.Forms.ToolStripButton
Friend WithEvents btnRedo As System.Windows.Forms.ToolStripButton
Friend WithEvents ToolStripSeparator12 As System.Windows.Forms.ToolStripSeparator
Friend WithEvents toolsBrowser As System.Windows.Forms.ToolStripMenuItem
Friend WithEvents ToolStripSeparator10 As System.Windows.Forms.ToolStripSeparator
Friend WithEvents Browser As System.Windows.Forms.WebBrowser
End Class
[/Code]
|
|
|
|

|
Hi Pavel,
I use your control in my application and setup a "customFCTB" project in order to be able to make tiny adjustments without loosing option to use your new releases, respective to keep my changes on central location, so it'll be easy to maintain them.
Now there is something I'd like to implement in OnPaint().
But I guess this function is complex, and you implement new stuff in there quite frequently.
Then it contains a call "base.OnPaint()", that I cannot rebuild when I override the complete function.
So I like to ask how you would do that.
To explain my background:
I like to implement a log file viewer with your component: I have implemented StringTextSource > Line this[int i] - that is more direct then Load/Unload. I call here syntax highlight for each line and cache the last 500 lines to avoid redoing the highlighting again and again. This works nicely.
Now you implemented hints, and I like to build my hints in the same way: So I don't like the Hints list, but like to set a current hint in Line this[int], an then call it in OnPaint() like this lines.GetCurrentLineHint().
|
|
|
|

|
Hi,
Are you sure you want to override OnPaint?
The fact that this method is really very large and difficult to break into smaller virtual methods. Because there are a lot of local variables and for performance reasons.
Also, I'm not sure that you really need to override OnPaint.
Tell me exactly what you want to implement there.
In my opinion, better way - use built-in hints. If you want to implement some method like GetCurrentLineHint(), then you can do it by following way (pseudocode):
void fctb_OnSelectionChangedDelayed(...)
{
fctb.Hints.Clear();
foreach(var iLine in currentDisplayedLines)
{
var r = new Range(0, iLine);
r.Expand();
var hint = fctb[iLine].GetHint();
fctb.Hints.Add(new Hint(r, hint));
}
}
Take in to attention: list of Hints is temporary buffer of the hints. You can clear this list anytime (and hints will be removed from the text). So I do not see any reasons do not use hint list.
|
|
|
|

|
Well, yes, I saw big trouble ahead, when looking how to override OnPaint().
Your alternative approach is welcome.
This code works as I need it:
void FCTBox_VisibleRangeChangedDelayed(object sender, EventArgs e)
{
if (lines is StringTextSource)
{
Hints.Clear();
int start = VisibleRange.Start.iLine;
int end = VisibleRange.End.iLine;
for (int iLine = start; iLine <= end; iLine++)
{
var r = new Range(this, 0, iLine, 0, iLine);
r.Expand();
Line dummy = ((StringTextSource)lines)[iLine];
Hint h = ((StringTextSource)lines).GetCurrentLineHint();
if (h != null) Hints.Add(h);
}
}
}
modified 18 Feb '13 - 11:57.
|
|
|
|

|
Ok
|
|
|
|
|

|
Very well written article and a splendid program!
|
|
|
|

|
Hi,
thanks for great extension!
I would like to ask, if there is any way to make selection protected like in the richTextBox?
richTextBox1.Text = "LOCKED information";
richTextBox1.Select(0, 6);
richTextBox1.SelectionProtected = true;
I need to make part of the text read only - I want html tags not to being modified.
For now I'm using RTB + regex to highlight tags and lock them - <[^>]+>.
|
|
|
|

|
Hi,
Yes, it is possible.
Please, download latest version of the component, see sample ReadOnlyBlocksSample.
|
|
|
|

|
you're the best, thank you!
|
|
|
|

|
Hi Pavel,
Why isn't there a GotoPreviousBookmark()?
|
|
|
|

|
Hi,
Because it is laziness
Ok, it's required method:
public bool GotoPrevBookmark(int iLine)
{
Bookmark nearestBookmark = null;
int maxPrevLineIndex = -1;
Bookmark maxBookmark = null;
int maxLineIndex = -1;
foreach (Bookmark bookmark in bookmarks)
{
if (bookmark.LineIndex > maxLineIndex)
{
maxLineIndex = bookmark.LineIndex;
maxBookmark = bookmark;
}
if (bookmark.LineIndex < iLine && bookmark.LineIndex > maxPrevLineIndex)
{
maxPrevLineIndex = bookmark.LineIndex;
nearestBookmark = bookmark;
}
}
if (nearestBookmark != null)
{
nearestBookmark.DoVisible();
return true;
}
else if (maxBookmark != null)
{
maxBookmark.DoVisible();
return true;
}
return false;
}
I'll release it in next version of FTCB.
|
|
|
|

|
Thanks for the quick response, it works great!
|
|
|
|

|
I forgot to mention, will you be adding a keyboard shortcut for previous bookmark too?
|
|
|
|

|
Ok, method OnKeyDown:
Old edition:
case Keys.N:
if (e.Modifiers == Keys.Control)
GotoNextBookmark(Selection.Start.iLine);
break;
New edition:
case Keys.N:
if (e.Modifiers == Keys.Control)
GotoNextBookmark(Selection.Start.iLine);
if (e.Modifiers == (Keys.Control | Keys.Shift))
GotoPrevBookmark(Selection.Start.iLine);
break;
|
|
|
|

|
Hey, sorry I have not yet tested the new version.
I did however add 'zooming' to my copy of the control; I thought you might like it.
I do not know if there is any 'proper'way to do zooming, but they guys over at Infragistics very helpfully hinted that adjusting the size of your font works quite well.
.....
Edited:
Removed my 'many lines' solution in favor for your shorter one.
modified 9 Feb '13 - 3:44.
|
|
|
|

|
Hi,
Thanks for propositions
I implemented it, but some other way:
protected override void OnMouseWheel(MouseEventArgs e)
{
Invalidate();
if (lastModifiers == Keys.Control)
{
ChangeFontSize(1f + e.Delta/1000f);
DoRangeVisible(Selection, true);
return;
}
base.OnMouseWheel(e);
OnVisibleRangeChanged();
}
public void ChangeFontSize(float koeff)
{
var currentSize = Font.SizeInPoints;
if (currentSize < float.Epsilon)
currentSize = 8.0f;
float newSize = currentSize * koeff;
newSize = Math.Max(Math.Min(300, newSize), 3);
if (Math.Abs(currentSize - newSize) > float.Epsilon)
{
var oldFont = Font;
Font = new Font(Font.FontFamily, newSize, Font.Style);
oldFont.Dispose();
}
}
It will be released with next version of FCTB.
|
|
|
|

|
Hi Pavel,
First - your control is awesome. I am really enjoying using it.
While using it I have found a few things though.
a) When you are using tooltips on hover (TooltipNeeded event), the last tooltip will reappear when the text is changed, even if you do not have the cursor over something that generates a tooltip.
This is because the Tooltip is associated with the control. The fix change the CancelTooltip to the following:
private void CancelToolTip()
{
timer3.Stop();
if (ToolTip != null)
{
ToolTip.Hide(this);
ToolTip.SetToolTip(this, null);
}
}
b) I have an international keyboard. Normally when I press " (double quote), it doesn't appear until I press another letter (to be able to make ö for example). Normally, when I do want the " to appear, I press , which will make the " appear without the space.
The FastColoredTextBox makes the space appear before the quotes now, creating strings like "hello ", while I wanted "hello".
I have looked at the code to try and fix it, but haven't made really progress except that the InsertChar(' '); on line 2986. But I guess that will break other things.
|
|
|
|

|
Hi,
Ok, I fixed tooltip as you suggest.
In regard to keyboard. I have not such keyboard... So I need some emulator... Can you suggest some virtual analog of your keyboard?
|
|
|
|

|
Hello Pavel,
first of all, I really love the Fast Colored Textbox. Awesome work!
I have found a Bug and hope you could fix it in one of the next versions
You just need your tester project and 2 pc's (or your pc and one Virtual Machine).
Now open the Tester and create a Teamviewer Session (dont know if you can use a similar tool).
You need to Control the pc which has the Tester running.
Now do some copy, cut and paste through Teamviewer window.
After a short time it should crash completly.
Without Teamviewer i couldnt reproduce it.
regards
Belial09
|
|
|
|

|
Hi,
Yes, there is such error. It is due to the fact that the TeamViewer opens the buffer and does not close it.
Now I catch this exception to prevent crashing. But copying from FCTB in fact does not work under TeamViewer, unfortunately.
I'll upload this bugfix into next version. But now you can fix method Copy() manually:
public void Copy()
{
if (Selection.IsEmpty)
Selection.Expand();
if (!Selection.IsEmpty)
{
var exp = new ExportToHTML();
exp.UseBr = false;
exp.UseNbsp = false;
exp.UseStyleTag = true;
string html = "<pre>" + exp.GetHtml(Selection.Clone()) + "</pre>";
var data = new DataObject();
data.SetData(DataFormats.UnicodeText, true, Selection.Text);
data.SetData(DataFormats.Html, PrepareHtmlForClipboard(html));
var thread = new Thread(() => SetClipboard(data));
thread.SetApartmentState(ApartmentState.STA);
thread.Start();
thread.Join();
}
}
[System.Runtime.InteropServices.DllImport("user32.dll")]
static extern IntPtr GetOpenClipboardWindow();
[System.Runtime.InteropServices.DllImport("user32.dll")]
static extern IntPtr CloseClipboard();
void SetClipboard(DataObject data)
{
try
{
while (GetOpenClipboardWindow() != IntPtr.Zero)
Thread.Sleep(0);
Clipboard.SetDataObject(data, true, 5, 100);
}
catch(ExternalException)
{
}
}
|
|
|
|

|
Hey Pavel,
thanks for the quick repsonse.
Works much better now
Thank you!
|
|
|
|

|
For HTML formatting, is there a way to prevent the control from creating a new line whenever there is a & #xA; character?
Thanks
|
|
|
|

|
You can handle event TextChanging and replace \n on &xA;
|
|
|
|

|
Pavel you deserve a 10 out of 5!
Thanks!
|
|
|
|

|
Thank you for your helpful suggestions
|
|
|
|

|
Hi Pavel,
Have you dropped support for visual studio 2008 recently? I'm asking because I've just downloaded your source and when trying to build it from VS2008 I get lots of 'default parameter specifiers are not permitted' errors. I know the obvious answer is to upgrade to (at least) vs2010 but I'm reluctant to do this just yet.
It's only an issue because under some circumstances I can get your control to throw an exception and I used to be able to fix this before. This is the original post:
http://www.codeproject.com/Messages/4322453/Invalid-parameter-exception.aspx[^]
modified 1 Feb '13 - 9:18.
|
|
|
|

|
Hi,
I keep forgetting that the VS2008 does not support C#4.0
Optional parameters is very useful feature...
Ok, I uploaded correct vs2008 solution.
|
|
|
|

|
Excellent, thank you very much. Your control helps make a lot of commodore developers very happy!
|
|
|
|

|
Thanks for creating this great control!
I have implemented synchronised scrolling of two FCTBs side by side as per your split example. Unfortunately the scrolling of the slave box is not smooth when dragging the scrollbar. The slave box lags the master box by about a second.
I also tried implementing the same functionality by directly overriding the Windows message handler for the scroll message, but the results were about the same.
Is there a deliberate delay on reacting to scroll messages, or any other reason why the second box would not scroll smoothly? Any recommendations on the best way to implement this? Happy to modify the control and contribute the code if you can point me at the relevant areas.
Thanks
|
|
|
|

|
Okay, try this example:
using System;
using System.Drawing;
using System.Windows.Forms;
using FastColoredTextBoxNS;
namespace WindowsFormsApplication131
{
public partial class Form1 : Form
{
FastColoredTextBox tb1;
FastColoredTextBox tb2;
int updating;
public Form1()
{
Width = 700;
var pn = new SplitContainer();
pn.Parent = this;
pn.Dock = DockStyle.Fill;
tb1 = new FastColoredTextBox();
tb1.Parent = pn.Panel1;
tb1.Dock = DockStyle.Fill;
tb1.CurrentLineColor = Color.Magenta;
tb1.Language = Language.SQL;
tb2 = new FastColoredTextBox();
tb2.Parent = pn.Panel2;
tb2.Dock = DockStyle.Fill;
tb2.CurrentLineColor = Color.Magenta;
tb2.Width = 300;
tb2.Language = Language.SQL;
tb1.VisibleRangeChanged += new EventHandler(tb_VisibleRangeChanged);
tb1.SelectionChanged += new EventHandler(tb_VisibleRangeChanged);
tb2.VisibleRangeChanged += new EventHandler(tb_VisibleRangeChanged);
tb2.SelectionChanged += new EventHandler(tb_VisibleRangeChanged);
}
void tb_VisibleRangeChanged(object sender, EventArgs e)
{
var vPos = (sender as FastColoredTextBox).VerticalScroll.Value;
var curLine = (sender as FastColoredTextBox).Selection.Start.iLine;
if (sender == tb2)
UpdateScroll(tb1, vPos, curLine);
else
UpdateScroll(tb2, vPos, curLine);
}
void UpdateScroll(FastColoredTextBox tb, int vPos, int curLine)
{
if (updating > 0)
return;
BeginUpdate();
if (vPos <= tb.VerticalScroll.Maximum)
{
tb.VerticalScroll.Value = vPos;
tb.AutoScrollMinSize -= new Size(1, 0);
tb.AutoScrollMinSize += new Size(1, 0);
}
if (curLine < tb.LinesCount)
tb.Selection = new Range(tb, 0, curLine, 0, curLine);
tb1.Refresh();
tb2.Refresh();
EndUpdate();
}
void BeginUpdate()
{
updating++;
}
void EndUpdate()
{
updating--;
}
}
}
|
|
|
|

|
Thanks for the quick response, that's a lot better. There's still a bit more improvement possible though, I've noticed the following:
The default behaviour is to have a "snap" so only whole lines are shown. In this example, the "master" has a snap, and the "slave" doesn't, it scrolls smoothly. I'm going to investigate how the snap works and make the slave have snap as well.
The "master" exhibits jitter. I think this is related to doing a refresh on the slave during UpdateScroll, since if I remove the slave update then the jitter goes away. I'm going to investigate this as well.
|
|
|
|

|
I now understand the problems I was seeing with "snap". The problem was because the raw scroll value was being passed to the slave, before it had been rounded to the nearest line in the function "OnScroll". I moved the "OnVisibleRangeChanged()" call down below the call to "UpdateScrollBars()", this makes the snap match up on both sides.
I haven't tested any other use cases, but you might like to consider making this change in the master code?
Thanks
|
|
|
|

|
Hi,
In fact latest version of the component calls OnVisibleRangeChanged() after UpdateScrollBars().
Download latest version please.
|
|
|
|
|

|
I,too, overwrote the WndProc method. It works REALLY nicely except for the fact that whenever I try to scroll with the scroll bar, it doesn't work. Scrolling with the scroll bar arrows and the mouse works.
I like this solution because I can set when I want to dual scroll something by just setting DualScroll to true.
Make sure you give it a 'Buddy.'
I'm not sure what the problem is but here is my implementation. It's a solution I obtained from: http://stackoverflow.com/a/3823319[^]
[DllImport("user32.dll", CharSet = CharSet.Auto)]
private static extern IntPtr SendMessage(IntPtr hWnd, int msg, IntPtr wp, IntPtr lp);
[DefaultValue(null)]
[Description("Another control whose scrolling is going to be synchronized.")]
public Control Buddy { get; set; }
[DefaultValue(false)]
[Description("If the control has a Buddy (another scrollable control), then indicates whether or not their scrolling should be syncronized. ")]
public bool DualScroll { get; set; }
private const int WM_MOUSEWHEEL = 0x20A;
private static bool _scrolling; protected override void WndProc(ref Message m)
{
if (m.Msg == WM_HSCROLL || m.Msg == WM_VSCROLL)
if (m.WParam.ToInt32() != SB_ENDSCROLL)
Invalidate();
base.WndProc(ref m);
if (ImeAllowed)
if (m.Msg == WM_IME_SETCONTEXT && m.WParam.ToInt32() == 1)
{
ImmAssociateContext(Handle, m_hImc);
}
if (DualScroll)
{
if ((m.Msg == WM_VSCROLL || m.Msg == WM_MOUSEWHEEL))
{
if (!_scrolling && Buddy != null && Buddy.IsHandleCreated)
{
_scrolling = true;
SendMessage(Buddy.Handle, m.Msg, m.WParam, m.LParam);
_scrolling = false;
}
}
}
}
Any hints/pointers why scrolling with the mouse wheel & the scroll-bar arrows work, but not the dragging of the scroll-bar?
|
|
|
|

|
Very handy, 10x 4 sharing ))
|
|
|
|

|
Hi ... I am using a predefined language defined by .Language = Language.HTML
When I go:
Private Sub TestHarness_TextChanged(ByVal sender As System.Object, ByVal e As FastColoredTextBoxNS.TextChangedEventArgs)
Static ts As New TestStyle(parentFastColoredTextBox)
e.ChangedRange.SetStyle(TestStyle, "apple", System.Text.RegularExpressions.RegexOptions.IgnoreCase)
End Sub
The style doesn't appear if I have apple (in this case) like this:
something="apple" ... as the built in one gets used
I want to use my style in such cases rather than the built in ones.
How can I do this?
Thanks,
Kris
|
|
|
|

|
Ended up doing something like this:
If parentFastColoredTextBox.Styles(0) Is Nothing OrElse Not (TypeOf parentFastColoredTextBox.Styles(0) Is ColorStyle) Then
Dim Styles = (From xItem In parentFastColoredTextBox.Styles Where xItem IsNot cs).ToList
Styles.Insert(0, cs)
For i = LBound(parentFastColoredTextBox.Styles) To UBound(parentFastColoredTextBox.Styles)
parentFastColoredTextBox.Styles(i) = Styles(i)
Next
End If
... don't know if there is a better way??
Kris
|
|
|
|
 |
|
|
General News Suggestion Question Bug Answer Joke Rant Admin
Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.
|
Custom text editor with syntax highlighting
| Type | Article |
| Licence | LGPL3 |
| First Posted | 24 Feb 2011 |
| Views | 1,577,635 |
| Downloads | 51,052 |
| Bookmarked | 819 times |
|
|