|
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.
|
|
|
|
|
codeprojectalanr wrote: I can't see a good reason why the DateTimePicker is limited to dates after 01/01/01753.
Take a look at the entry for January 1[^].
The problem is calculating dates in the Julian Calendar because of leap years, which is why we switched to the Gregorian version.
I don't know if it will help you but there is a Julian Calendar Class[^] in the .Net Framework.
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 for the reply Henry. I'm still not convinced that it's necessary to impose the fact that there are some problems converting between the calendars on the control itself - this is surely a problem that the programmer creating the application should be in control of.
Despite my claims that I don't have much spare time, I've now taken the short amount of time needed to create a basic TextBox-based control that validates the date. I include the code here for anyone who might find it useful. Shame I haven't got a calendar control to accompany it, but hey, can't win everything!
public partial class DateTimeTextBox : UserControl
{
private DateTime m_value = DateTime.MinValue;
public DateTimeTextBox()
{
InitializeComponent();
}
public DateTime Value
{
get
{
return m_value;
}
set
{
m_value = value;
textBoxDate.Text = m_value.Date.ToShortDateString();
}
}
private bool ValidateDate(string date, out DateTime validatedDate)
{
validatedDate = DateTime.MinValue;
DateTimeConverter dtc = new DateTimeConverter();
try
{
validatedDate = (DateTime)dtc.ConvertFromString(date);
}
catch
{
return false;
}
return true;
}
private void textBoxDate_Leave(object sender, EventArgs e)
{
TextBox textbox = (TextBox)sender;
if (textbox != null)
{
bool validDate = ValidateDate(textbox.Text, out m_value);
if (!validDate)
{
MessageBox.Show("Invalid date");
textbox.Focus();
}
}
}
}
|
|
|
|
|
Thanks for posting your code!
It's a reasonable effort, I suppose. But it doesn't cope with BC Dates, so I can't check my Birthday.
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.”
|
|
|
|
|
The date conversion is tied to the control because it has to know what calendar you are using in order to display the correct calendar for any date before 1753...
Having said that, I don't see why the control's designers didn't just allow us to set a simple isJulian bool that would tell the control that the calendar is (or is not) using the Julian/Gregorian system. Then it could handle any date and it would leave it to the user to know when and when not to use the Julian calendar.
If you ask me the designers at Microsoft just chose to take the easy (lazy) way out.
|
|
|
|
|
Hi
I am using group box in my app. I want to remove the Border of GroupBox.
.Net Version used: 2.0
|
|
|
|
|
Hi,
IIRC you can make it invisible by setting some properties, say ForeColor=BackColor and Text="";
however the border area is still wasted. AFAIK you can't shrink it to just it contents; it that is what you want, why not just use a Panel?
PS: I don't think you can have it with title but no border lines.
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.
|
|
|
|
|
That would result in the same functionality as a Panel control.
|
|
|
|
|
its better to use other control such as Panel Control
or if still you want to do this then you can create your own control by inheriting the group box control but it will be like inventing the wheel.
Best of Regards,
SOFTDEV
|
|
|
|
|
I have a similar problem, and I can't use a panel, or really don't want to, because am using linq to gather all controls of a radiobutton type and linq does not find the controls in a panel, but it will find the controls in a groupbox. Any other ideas?
|
|
|
|
|
You can use css for the same.
.GroupPanel, .GroupPanel Legend
{
text-decoration: none;
border: 0;
}
|
|
|
|
|
Hi,
I m working as a software developer(.NET). I have a windows application(c#) using flash for GUI. I want to run our application on two screens simultaneously(Dual screen functionality). That will used at Point of sale one is saleaperson facing and other is customer facing.He(customer) should be able to view whatever salesperson is doing on the screen at the same time that should be reflected on customer facing screen. IT IS THE CLIENT REQUIREMENT.
can anybody give me an idea, how can i do this?? That would be a great help for me.
Thanks in advance....
Or you can reply on my mail also.... rohits@chetu.com(off)
rohitsrivastava21@gmail.com(personal)
|
|
|
|
|
Hi,
my laptop has that functionality built-in: when an external monitor is connected you can choose any of four modes:
- internal only
- external only
- both give same image
- both are part of one large desktop
The disadvantage is the customer would see everything you see, even before you have opened your app.
(Probably there are ways for your app to change the monitor setting to cope with that).
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.
|
|
|
|
|
A dual head video card can do the exact same thing. nVidia and ATI both supply drivers that will do mirroring, without writing a single line of code.
|
|
|
|
|
There are so many solutions to do this
1). key loggers are available in both software as well as hardware
2). Screen capturing softwares
3). Try to read windows services there are some services which can also provide this functionality
4). If you are using any db on back end and wants only transaction log then you can make it by using your db features as in sql server there is a option for c2 which creates audit log for the db for any insertion , deletion as well as for updation and there are other so many options depending upon the tools
Thanks,
SOFTDEV
Microsoft NVP
No Valuable person
|
|
|
|
|
Hi,
A critical vulnerability "IIS 5.0 Denial of Service" has been identified in my web application by HP WebInspect tool.
we need to remediate this vulnerability ASAP.
I have checked for WebDev in IIS manager, it is disabled.
I am trying to search for best solution for this vulnerability, but still not able to search.
Please help me on this.
Thanks,
Ankur Bakliwal
|
|
|
|
|
|
This question should have been posted in the Web Development forum only. Do NOT spam multiple forums with the same question.
|
|
|
|
|
Thanks in advance
I want to create report writer (user can create reports on run time by selecting field)
in VS 2008 / 2005 by using SQL Server on Back end and crystal report or any other report writer for reporting
Best of Regards,
SOFTDEV
Reply·Email
|
|
|
|