Diesel Geezer
Problem with datagridview sorting
after i use
dataGridView1.Sort(dataGridView1.Columns[0], System.ComponentModel.ListSortDirection.Ascending);
The datagridview starts ordering whatever i enter automatically. I thought this was supposed to sort the data only when i ran the command, not make it sort automatically all the time
how do i sort a datagridview only once without the automatic ordering6 replies
System.AccessViolationException: Attempted to read or write protected memory.
i get this exception when i change a multiline textbox to single line:
Visual studio actually throws the exception at the Program.cs at the Application.Run(new Form1()); line, but i found that the issue is caused by the line valTxtBox.Multiline = false; because if i remove it i dont get the exception
What is going on here?
4 replies
❔ Typing whitespace creates 2 more after parsing RTF from RichTextBox and then re-applying it
Lets say i press space between 2 words. When i parse the RTF and then re apply it, i get 2 more spaces so 3 in total. When i remove spaces nothing crazy happens. This happens only when i type them. Though when i type a whitespace in the end of the sentence and THEN i type a word everything is fine. This only happens when i type whitespaces between 2 already existing words/characters. What is going on here?
6 replies
❔ Problems with applying multiple styles on text in RichTextBox
Im trying to apply some styles to a piece of text in a richTextBox and they just won't work properly.
Here is an example: "BeamMP Description".
I want to make the last 2 characters of the word "BeamMP" bold (MP) and the second word bold and underlined. So for the first word i do this:
I set the
selectionStart
to 0 and the selectionLength
to the end of the RTBox. Then this:
RTBox.SelectionFont = new Font(RTBox.SelectionFont, RTBox.SelectionFont.Style | FontStyle.Bold);
Similar way to underline the word "Description"
But the problem here is that the bolding magically dissapears and only the underline at the word Description is applied???10 replies
❔ Make a rich text box with custom formatting codes
is there any way to make a richtextbox with custom formatting codes? When i make a piece of text bold for example, instead of doing it like this:
cat -> \b cat\b0
do it like this
cat -> \customBoldCode cat\EndCustomBoldCode
17 replies
❔ BinaryFormatter does not serialize/deserialize the Tags of listview items
so i have a listview that i want to serialize and then desirialize. I store some values in the tags of each listview item. Problem is that after i clear the listview and deserialize the file, the tags of each listview item is gone. I don't know if this is a problem of the writer or the reader, but i guess its because of the writer skipping the tag property. How can i overcome this issue?
10 replies