I'm trying to set NumericUpDown control to Flatsyle. Setting Borderstyle as FixedSingle effects only to the numberbox. Is there a way to set also the up/down buttons to flatstyle? jtpaa
jtpaa
Posts
-
Flat NumericUpDown -
Saving rtf-fileThanks for clarifying WordPad behaviour. So, the WordPad does not care about document page setting. But, if the user opens document for example with MS Word, then these settings coul be used. I managed to set the rtf-code by following way. I dont know whether it's clever way or not, but MS Word understood it and opened document in landscape. The created and saved rtf-file is reopened, page settings are inserted into rtf-code, and finally file is saved again.
Me.rtbPrint.SaveFile(Me.SaveFileDialog.FileName, RichTextBoxStreamType.RichText)
Dim FILE_NAME As String = Me.SaveFileDialog.FileName
Dim objReader As New System.IO.StreamReader(FILE_NAME)
Dim sString = objReader.ReadToEnd
objReader.Close()
sString = sString.Insert(6, "\paperw15840\paperh12240\margl720\margr144\margt720\margb288\lndscpsxn")
Dim objWriter As New System.IO.StreamWriter(FILE_NAME)
objWriter.Write(sString)
objWriter.Close()Hope, that the code is seen properly.
-
Saving rtf-fileOk, thank you. The only solution offered for this problem in the web is this MS Word solution, and it is quite "rough" programming. So I wonder if it's possible at all (in code) to set/modify rtf-code part of the rtf-file.
-
Saving rtf-filesText is String, which contains text and linefeeds
Myrtb.SelectionColor = Color.Black
Myrtb.SelectionFont = New Font("Microsoft Sans Serif", 14, FontStyle.Bold, GraphicsUnit.Point)
Myrtb.SelectedText = sText
Myrtb.Rtf = "{\rtf1\landscape}
Myrtb.Rtf = "{\rtf1\lndscpsxn}
Myrtb.SaveFile(Me.SaveFileDialog.FileName, RichTextBoxStreamType.RichText)
-
Saving rtf-fileOK There is RichTextBox (MyRtb), which content is saved as rtf-file. Rtf-file contains page formatting data, which I have tried to modify so that the page orientation is Landscape. I have tried to set Document Formatting Property "\landscape" and Section Text Property "\lndscpsxn". Those properties are documented in rtf specification. Code lines, which I used for setting those properties:
Myrtb.Rtf = "{\rtf1\landscape}"
Myrtb.Rtf = "{\rtf1\lndscpsxn}"
Well, it might be that those parameters are not in the right place in rtf-code. But anyway, it seems that those lines do not affect rtf code at all. And the main question is: Is it possible at all (in code) to modify rtf-file so that the page orientation is in Landscape mode ?
-
Saving rtf-fileYes you are right, the file must follow rtf-format specification. As I mentioned earlier, I have tried to make the file to follow rtf format by following way: Rtf-file contains parameters of page settings and I have tried to modify those parameters, but with no success. I have not been able to set those parameters at all. Is it so that richtextbox does not allow to set Richtextbox.rtf - value ? I have tried to modify rtf-code by setting the "\landscape" or "\lndscpsxn" parameters into rtf-code by: MyRtb.rtf = "{\rtf1\... or MyRtb.selectedrtf = "{\rtf1\... Those lines don't change MyRTb.rtf value.
-
Saving rtf-fileCould You explain what you mean?
-
Saving rtf-fileYes. The user, who opens the file must have Word or similar program to read the rtf-file. But, the user (end user), who creates the rtf-file with my application does not necessarily have MS Word.
-
Saving rtf-fileWhat if the end user does not have Microsoft Word ? Is there a way to set the rtf-code without using Microsoft Word ? Can it be done trough RichTextBox-object ?
-
Saving rtf-fileYes, Windows form RichTextBox.
-
Saving rtf-fileHello Is it possible to save richtextbox-text so, that the page is in landscape format ? Rtf-file contains parameters of page settings and I have tried to modify those parameters, but with no success. I have not been able to set those parameters at all. Is it so that richtextbox does not allow to set Richtextbox.rtf - value ? I have tried to modify rtf-code by setting the "\landscape" or "\lndscpsxn" parameters into rtf-code by: MyRtb.rtf = "{\rtf1\... or MyRtb.selectedrtf = "{\rtf1\... Those lines don't change MyRTb.rtf value. What's wrong ?
-
Alphanumerical sorting for SQL Server CE [modified]Hi Yes, I have searched this topic with google. But I have not found usable solution. If You check those google results and if You find something useful, could You then send notification :) jtpaa
-
Alphanumerical sorting for SQL Server CE [modified]Hi Does anyone know how to make aplhanumerical sorting for SQL Server CE ? CE does not support Isnumeric-function, so it cannot be used. CE version is 3.5, VisualBasic 2010 does not support CE 4.0. jtpaa -- Modified Thursday, August 4, 2011 7:28 AM
-
ListView in virtualmodeOk But could we say that my virtualmode version was atleast 5% virtual :D Yes, the first thing that comes into my mind is that DB operation can be a bit slow because Database can also locate in local network. But this could be solved by taking several items with one search into cache. Second thing is sorting. There are two columns (alphanumeric strings) in my ListView and user must be able to sort both columns. Also in sorting itself there has been difficulties. I haven't find a way to sort mixed strings properly with sql query. jtpaa
-
ListView in virtualmodeThanks First part of Your answer was clarifying. But this is not clear yet: "it does not make sense to have an array that "shadows" your items in a ListView Do you mean that it's not clever to use an array of ListViewItems, because the array itself consumes memory or speed? But how could it be done then? Data needs to be provided somehow for the ListView. Data shown in ListView is stored in Database. During startup data is collected into this baseArray. Do you mean that data could be taken from the database into cache in runtime? jtpaa
-
ListView in virtualmodeHi This is not a problem, I'm just trying to make myself clear how ListView works in virtualmode :) So, I have ListView1 in virtualmode. My ListView1 gets virtualitems from array, "baseArray() as ListViewItem": Private Sub ListView1_RetrieveVirtualItem(..) Dim x As Integer x = e.ItemIndex e.Item = baseArray(x) End Sub This works fine and is really fast. The thing that I don't understand: Changing the text of displayed ListViewItem or it's subitem affects also the corresponding item in baseArray. This: ListView1.Items(iSomeIndex).SubItems(0).Text = "sNewText" Changes also the corresponding item in baseArray. Why this happens? It seems that: ListView1.Items(iSomeIndex) is actually (I mean physically, sorry for the expression) baseArray(iSomeIndex) I earlier thought, that virtualmode copies shown items from baseArray. But it seems that virtualmode does not work quite that way. Could some of you explain what happens when virtualmode gets items from baseArray. Thanks.
-
Testing if a varible is nullWhat if You replace the vbNull with Nothing?
-
ListView: How to link columnheader into subitemYes, this seems to be the final solution. Actually I had this kind of solution earlier for hiding columns. But then something happened and ListView ColumnWidthChanging event stopped working. I mean that ColumnWidthChanging event does not fire att all. And I have not found any solution for that. Do You have any ideas how to get this ColumnWidthChanging-event problem fixed?
-
ListView: How to link columnheader into subitemThanks for Your answer. To hide a column via setting column width is not an option, because the user is and must be able to resize the column width. In Your example, if You first remove 2, 3 and 4 columns. And then insert only 4. column back, it causes an error. Problem is, that there are more subitems than there are columns. And in that case the columnheader can't necessarily be inserted over correct subitem.
-
ListView: How to link columnheader into subitemHi All, I'm using ListView to show several columns of data. (View = Details) Everything worked fine until I wanted to let the user to hide/show certain column(s). I hide the column this way: ListView1.Columns.Remove() Problem is to get the column correctly visible again, so that columnheaders are correctly ordered into subitem-columns. When I use ListView1.Columns.Insert() or ListView1.Columns.Add() to get the column visible again it links the columnheader to wrong subitem-column. Is there any way to link a columnheader into subitem-column?