|
Ah click, I've been binding the DGV, then changing the columns, and paying the price. So get the table, define the columns based on the table and then bind the datatable. Oh bloody hell, my utils does this it just doesn't do the datatype formatting - stupid frikking twat
Thank you
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
As we can create Regions in code like
#Region "1).Declarations"
Dim con As SqlConnection
end region
similarly can we make sub blocks or sub regions with in a region
Best Of regards,
Softdev
Best Of Regards,
SOFTDEV
Sad like books with torn pages, sad like unfinished stories ...
|
|
|
|
|
The easiest way to resolve a question like this is to try it.
What can it break?
Be brave!
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
yes could not find any sub blocks with in regions did u try and found something
Best Of Regards,
SOFTDEV
Sad like books with torn pages, sad like unfinished stories ...
|
|
|
|
|
AFAIK you can nest #region/#end region blocks several layers deep. Not sure if there is a limit.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
thanks i got it v can
Best Of Regards,
SOFTDEV
Sad like books with torn pages, sad like unfinished stories ...
|
|
|
|
|
But how ca we make regions in Function Bodies
Best Of Regards,
SOFTDEV
Sad like books with torn pages, sad like unfinished stories ...
|
|
|
|
|
Hello,
I'm developing a simple text highlighting editor, and I can't disable scroll bars when I call the Select(int start, int length) method of the RTB, for example The cursor is on the 40th line and I want to select an expression at line 1 and do something on that, but doing this causes the RTB to scroll to the first line and so this is considered a bug !
can anyone help me ??
Thanks,
ashkan s.
|
|
|
|
|
Is not this its default behavior which i have doubt that you can change , try to work on your selection of expression thing code it will be more better and prospective then to this scroll bar thing
Best Of Regards,
SOFTDEV
Sad like books with torn pages, sad like unfinished stories ...
|
|
|
|
|
Can you explain more ? Unfortunately I didn't understand ....
thank you,
ashkan s.
|
|
|
|
|
I'm shocked by this bug.
Create a scrollbar and in the Scroll event write some code to tell you the value of the scrollbar, ie. the text in a label etc.
What I've noticed:
1.) It is impossible for it to be dragged to the value of 100.
2.) If you slowly drag it all the way to the end of the scrollbar, you might get a value of 86 or 90, but if drag it quick enough you might get something as low as 59.
Has anyone else noticed this?
If everything was not true, would it be not true that everything is not true? So by saying everything is not true, you are automatically denying that everything is not true. Im so confused...
FreeDOS
- An open source modern
MS-DOS/PC-DOS replacement.
|
|
|
|
|
Hi,
It's not a bug, it's by design or at least that's the story on MSDN.
The value of a scroll bar cannot reach its maximum value through user interaction at run time. The maximum value that can be reached is equal to the Maximum property value minus the LargeChange property value plus 1. The maximum value can only be reached programmatically.
It is a bit odd as I don't think that Trackbar exhibits this behaviour.
Alan.
|
|
|
|
|
just change the large change Property to 1 or whatever from 10
Best Of Regards,
SOFTDEV
Sad like books with torn pages, sad like unfinished stories ...
|
|
|
|
|
Or set the maximum to (maxYouReallyWant + LargeChange - 1) which is what I do...
There are three kinds of people in the world - those who can count and those who can't...
|
|
|
|
|
I kept wondering why my Undo/Redo buttons sometimes didn't work as expected. Just noticed that toggling the WordWrap on and off is the culprit. Has anyone else encountered this?
The code below is a stripped down version just to illustrate the problem. Paste it into a form called "Form1". Drag in a RichTextBox named "rtf" and a ToolStrip. Add 3 buttons to the ToolStrip:
Set the CheckOnClick property for tb_WW to true (toggles the WordWrap in the RTB).
Here's the code:
Private Sub tb_Undo_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tb_Undo.Click
rtf.Undo()
End Sub
Private Sub tb_UndoWW_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tb_UndoWW.Click
If rtf.CanUndo Then
rtf.Undo()
End If
End Sub
Private Sub tb_WW_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tb_WW.Click
rtf.WordWrap = tb_WW.Checked
End Sub
Private Sub rtf_SelectionChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles rtf.SelectionChanged
tb_UndoWW.Enabled = rtf.CanUndo
End Sub
Add some text the RichTextBox, then backspace or whatever to change it. Then toggle the word wrap a time or two. Watch the tb_UndoWW ToolStrip button. It'll disable because the CanUndo property changes to false.
Is this a bug (couldn't find it at MSDN) or am I doing something really dumb here?
|
|
|
|
|
|
|
Both of the text editors to which you provided links have the same bug I referred to above. Toggling word wrap sets the RichTextBox.CanUndo to False. The one at A1VBCode also seems beset with disappearing tool bar icons.
Is anyone else encountering this? For all I know the problem may be with my computer and not the RichTextBox. I'd love to know.
|
|
|
|
|
Hi Alan,
This must be feature of the textbox, both rich and normal, as Notepad shows the same behaviour. I can't offer any helpful suggestions to circumvent the issue but I'd be confident that neither you nor your computer are to blame.
Alan,
|
|
|
|
|
I never even thought about checking NotePad. NoteTab Lite also displays the same behavior. Worth noting that NotePad++ does not. Several line-related functions in my app depend upon word wrap being off when they occur, and that stops a user from being able to undo them if WW must be switched off and back on. I'll have to implement my own undo/redo (evidently that's what the author of NotePad++ has done). What the heck - should be interesting.
Thanks for the info!
AB
|
|
|
|
|
In a project using a RichTextBox, when I copy text and paste it into some other applications, the line breaks are missing. This happens in MS NotePad and the sample text area in Expresso. The text pastes correctly (line breaks are present) with WordPad, NoteTab Lite and NotePad++.
Here's the code used to copy text (RichTextBox is named "rtf"):
Private Sub menuEdit_Copy_Click(ByVal sender As Object, ByVal e As EventArgs) Handles menuEdit_Copy.Click, tb_Copy.Click, popup_Copy.Click
Try
If rtf.SelectedText.Length > 0 Then
Clipboard.SetText(rtf.SelectedText, TextDataFormat.Text)
End If
Catch ex As Exception
MsgBox(ex.ToString, MsgBoxStyle.Exclamation, title)
End Try
End Sub
Any ideas why some apps paste okay and some do not?
Thanks
AB
|
|
|
|
|
you have answered your own question as you are using Rich Text Box some other applications they used different control as Text Box so they have different functionality that's why behavior of your copied text is different in different applications
Best of regards,
SOFTDEV
|
|
|
|
|
Hi,
the problem relates to the representation of line breaks, i.e. the difference between Environment.NewLine (which equals "\r\n" on Windows) and the ASCII CR and LF characters (carriage return \r and line feed \n).
when you use most applications or most Controls, and copy some text then some processing occurs:
1. all line breaks use "\r\n"
2. several different text formats (Text, UnicodeText, RichTextFormat, ...) are put on the Clipboard, so the receiver can pick the most informative format he understands
when you simply do Clipboard.SetText(rtf.SelectedText, TextDataFormat.Text) then the text is copied as is (no Newline processing) and only two formats are stored (Text, UnicodeText).
Some programs are rather fussy about Newlines, and Notepad is the most popular of those.
Suggestion: use RichTextBox.Copy() method to copy selected text to the clipboard.
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
Problem solved. Thanks!
|
|
|
|
|
Hi,
Apologies if this has been answered already, but I've done quite a lot of searching and haven't yet uncovered an answer.
I can't see a good reason why the DateTimePicker is limited to dates after 01/01/01753. I'm writing some genealogy software and am having problems with this somewhat arbitrary limitation.
So I've been trying to figure out if there's a way to amend this setting. Not being an expert in C# I'm not sure if there's some way I can force the static readonly field MinDateTime to something different even though the design has tried to stop me. Is it possible to do such a thing? I don't even mind if someone has a massive hack that would enable me to change this value
I've tried many things, including using Reflection to get hold of the field and change it (it won't get hold of the field for me, just returns null). Have now reached the limits of my knowledge, so that's why I'm asking you knowledgeable people!
Thanks in advance for any help or suggestions
PS It's worth mentioning that I'm not after writing a completely new control for this as it's a home project, I'm not blessed with much free time and DateTimePicker is absolutely fine for my use barring this one limitation. But if anyone knows of a decent quality free control I'm willing to give it a try as an alternative.
|
|
|
|