I'm developing an application where I need a context highlight edit control (single line and multi-line). I need to be able to use my own tags (words/ID to be highlighted) and colors... and optionally tooltips for the highlighted words. The control need to be fast and able to handle hundrets of tags/highlights. Free would be best but conmmercial controls can also be used - but please no bloaded "complete editor" packages - my requirements are pretty simple and do not want a bloated control if I can avoid it :) Any suggestions? /B
MrBean
Posts
-
Context hightlight editor for VB.NET WinForms -
User Control with container area? [modified]Thanks for your post, but it doesn't help me. I only need a user control (not a custom control) where I can control which panel is the container for the .NET form designer. Also seems like the entire Taskpane control acts like the container and not just a limited area within (panel)... controls can be resized and moved to overlap the toolbarfor example. /B
-
User Control with container area? [modified]Getting a user control to act as a container is pretty easy : After creating a user control in VS 2005, the class code should look something like this:
Public Class MyUserControl1 End Class
Just add the following attribute to the class :< System.ComponentModel.Designer("System.Windows.Forms.Design.ParentControlDesigner, System.Design", GetType(IDesigner)) > _ Public Class MyUserControl1 End Class
That should do the trick ;) If you (or anybody else) find a solution to my problem (read my first post in this thread), please let me know... PLEEEEEESE ;) /B -
User Control with container area? [modified]Hi, I'm developing a WinForms (VB.NET 2.0) application where I have a user control which contains several fixed controls (toolstrip, buttons, panels, etc.). This works just fine - the problem is that I want one (and only one) Panel control within my user control to act as a container where other controls can be placed in the form designer. I can set a designer attribute for the entire user control which causes the entire user control to be a container - but I only want one specific Panel control in the user control to act as a container. How can this be done? Please help, TIA :) /B -- modified at 5:29 Thursday 13th September, 2007
-
String compressing with System.IO.CompressionThanks for the code... I'll try it later :) So far I have solved my problems by using a 3rd party component (Xceed) which was part of a suite we had allready purchased. It workes perfectly, is very easy to use and is apparently more efficient :)
-
String compressing with System.IO.CompressionWell... can't get it to work :( Below is the code that I'm currently "fiddling" with. The CompressString function has been revised and seems to work correctly now. But the Decompress function method somehow still doesn't work. ZipStream.Read simply doesn't decompress the data in the memoryStream and returns 0 ??
Public Function CompressString(ByVal strInput As String) As String Dim bufIn() As Byte = Encoding.UTF8.GetBytes(strInput) Dim bufIn() As Byte = Encoding.UTF8.GetBytes(strInput) Dim ms As New MemoryStream() Dim ZipStream As New GZipStream(ms, CompressionMode.Compress, False) ZipStream.Write(bufIn, 0, bufIn.Length) Dim bufOut() As Byte = ms.GetBuffer ZipStream.Close() Return Convert.ToBase64String(bufOut) End Function Public Function DeCompressString(ByVal strInput As String) As String Dim bufIn() As Byte = Convert.FromBase64String(strInput) Dim ms As New MemoryStream() ms.Write(bufIn, 0, bufIn.Length) ' Compressed data ms.Position = 0 Dim ZipStream As New GZipStream(ms, CompressionMode.Decompress) Dim bufOut(30000) As Byte ' Predefined buffer-size just for test purposes!! Dim nRead As Integer nRead = ZipStream.Read(bufOut, 0, bufOut.Length) ' Returns 0 ???? ZipStream.Close() Return Convert.ToString(bufOut) ' never mind this... WIP End Function
-
String compressing with System.IO.CompressionDave Kreskowiak wrote:
Actually, you are! Consider the String as just a stream of characters in memory. See this[^] for more information.
Yes, you are right - but I'm looking for some code which shows me how to do it in more detail :| I got the compression code to work just fine, but can't seem to decompress it. Here's the compression code which seems to work : Public Function CompressString(ByVal strInput As String) As String Dim buffer() As Byte = Encoding.UTF8.GetBytes(strInput) Dim memoryBuffer As New MemoryStream() Dim compressedZipStream As New GZipStream(memoryBuffer, CompressionMode.Compress, False) compressedZipStream.Write(buffer, 0, buffer.Length) compressedZipStream.Close() Return Convert.ToBase64String(memoryBuffer.GetBuffer) End Function
Dave Kreskowiak wrote:
You could probably do what you want with a StringBuilder[^] object.
Ok, but Convert.ToBase64String seems to work also :)
-
String compressing with System.IO.Compression"You do realize that the Compression class only outputs binary data?" Yes, but this can be converted (encoded) to/from a String with .NET (can't remember the class name right now). Also, I'm NOT looking for something to compress a stream... Anybody else, please ?
-
Columnstyle drag'ndrop in WinForms app (VB.NET 2.0) ?"problem" solved. I have implemented my own drag'n'drop functionality into the FlowLayoutPanel.
-
String compressing with System.IO.CompressionBasicly I want to be able to compress a String using System.IO.Compression to another String and be able to decompress it later. I want to use this for compressing XML (and other string values) into a String variable which I store elsewhere. It MUST be compressed to a String - no binary data. Also, I do not want to save the XML to a file and compress/decompress from there; compressing/decompressing must be in-memory only. Any advice or sample code (VB.NET or C#) ? Thanks in advance ;)
-
Columnstyle drag'ndrop in WinForms app (VB.NET 2.0) ?I'm currently developing a application where the end-user must be able to arrange "fields" in a "panel" via drag'n'drop much like columns are often re-arranged in grid header at runtime. The "panel" must support arranging the order of the "fields" by the end-user and also support adding and removing "fields" from the "panel" from a "stock panel" which contains all available "field"-items. I must be able to implement my own "Field"-item control so I can't just use a normal grid. I'm currently looking into using the new FlowLayoutPanel control but it doesn't support drag'n'drop of items in runtime. Any advice how to implement such a feature ? I'm open towards commercial 3. party components but if this feature can be done for free, it would be best :)
-
Convert String to Double with formattingMy current solution (which is not 100%) works a lot like you describes : detects which comes first, "," or "." But the case where there are no decimals but thousand delimiters... example : 123,456 It impossible to know if this means 123.456 or 12345.00 without knowing the input format. I was just wondering if there was a ".NET way" of converting strings back to doubles and specifying a format string which the parser should use... just like the ParseExact which the Date type supports just fine. It seems this is a big oversight from the .NET team. Unfortunately I can't limit the formats the users can enter to a predefined set - the users expect full freedom here and the old (non-.NET) version of the app had this functionality :(
-
Convert String to Double with formattingPlease read my thread again... it's far more complicated than that; a simple "," replace/removal won't do the job. For example... does "100,123" mean 100.123 or 100123.00 ... it's impossible to tell without actually knowing the format.
-
Convert String to Double with formattingHi, I'm developing an WinForms application in VB.NET where the user can specify custom formats for numeric data entry fields. When I display data in lists, labels, editboxes, etc. I simply use Double.Format(strCustomFormat) to format the double values in the desired format - no problem here. But I'm having a problem converting the strings back to a double since I basicly don't know if the user is using a 1.234.567,09 or 1,234,567.09 format. So basicly I need a Double.Parse method where I can specify the format (similar to the ParseExact that DateTime has)... but this is not available as standard for Doubles :( Is there any other way I can do this ? Thanks you in advance. /Bean
-
Bug when using User Controls within containers ?*triple bump* I can't be the only one with this problem ?
-
Bug when using User Controls within containers ?*double bump*
-
Bug when using User Controls within containers ?*bump* Anyone ?
-
Bug when using User Controls within containers ?When using User Controls in a .NET Windows Forms app, the designer sometimes "activates" controls within a User Control when in design-mode, but only when the User Control have been placed within a container control (like a Panel or Groupbox). Look at this zipped AVI movie which demonstrates the problem : http://www.bean.dk/uctest/UCTest.avi.zip The full source code for the example can be found here : http://www.bean.dk/uctest/UCTest.source.zip This would normally only be a minor thing since the bug only occurs at design-time, but I'm using .NET's designer in my own app. so the users can design forms themselves. Is there a workaround to avoid controls within a User Control to be "activated" when the user clicks on them design-time ? Thanks in advance, /Bean
-
Drive mount/dismount notification ?I'm developing a small VB.NET WinForms application which will be aware of the user connecting a USB memory drive og external harddrive. Is it possible to get a notification/event when a drive letter is mounted and dismounted from the system ? Thanks in advance :)
-
Serialize helpHere's the current and complete test source including the test function :
Imports System.Xml.Serialization Public Class MyReport Public m_Title As String Public m_BackColor As Color Public m_Objects As New ArrayList ' Contains several MyReportObject objects End Class Public Class MyReportObject Public m_Text As String Public m_X As Integer Public m_Y As Integer End Class Module TestFunctions Public Sub Test() ' Making test data... Dim oRep As New MyReport oRep.m_Title = "Some new report..." oRep.m_BackColor = oRep.m_BackColor.WhiteSmoke Dim oObj As New MyReportObject oObj.m_Text = "A text..." oObj.m_X = 10 oObj.m_Y = 10 oRep.m_Objects.Add(oObj) ' Leave this line out, and serializeing below will succeed ! Try ' Serialize to XML file... Dim file As New System.io.FileStream("c:\MyReport.xml", IO.FileMode.Create) Dim ser As New System.Xml.Serialization.XmlSerializer(oRep.GetType) ser.Serialize(file, oRep) ser = Nothing file.Close() file = Nothing MsgBox("Done!") Catch ex As Exception MsgBox(ex.Message & vbCr & vbCr & ex.InnerException.Message) End Try End Sub End Module