|
First you need to change the color of the text before putting it in the rtb.
rtb.SelectionColor = System.Drawing.Color.Red;
rtb.AppendText(outText);
changing other attributes
rtb.SelectionColor = System.Drawing.Color.Blue;
System.Drawing.Font fBold = new System.Drawing.Font("Courier New", 10, fontBold);
rtb.SelectionFont = fBold;
rtb.AppendText(outText);
good luck
|
|
|
|
|
Dear sir,
there are two projects in single dotnet IDE. every project included in separate namespaces.
i want to use one project reference to another project or namespace .
how can i do this???
i tried to use through "using " keyword , but it is not working and giving runtime error.
like this:
The type or namespace name 'TechWayHosting' could not be found (are you missing a using directive or an assembly reference?) D:\Yogesh_Backup\yogesh\New Folder\TechWayHosting-1st April 2009\FTPLibrary\User Controls\FileBrowserControl.cs FTPLibrary
yogesh
|
|
|
|
|
yogesh_softworld123 wrote: are you missing a using directive or an assembly reference?
You have a using directive, so what could be missing?
right-click on the project in the solution pane and fix it.
yogesh_softworld123 wrote: giving runtime error
this is a compile-time error, not a run-time error. Your app is not running yet.
Luc Pattyn [Forum Guidelines] [My Articles]
- before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use the code block button (PRE tags) to preserve formatting when showing multi-line code snippets
|
|
|
|
|
Hi,
You used the "using" directive, which is fine... But before that did u add the reference of the other project in "Add Reference" of your current project...?
|
|
|
|
|
i have a form, i want to change the time and/or date of the system
and now i have found the following code but it just generate errors
i don't know what is exactly the problem
it is not a run time error, it is a compilation error
i am using C# in visual studio 2008
here is the error message :
"Error 39 Attribute 'StructLayout' is not valid on this declaration type. It is only valid on 'class, struct' declarations. D:\visual studio projects\firstCSharp\firstCSharp\settings.cs 16 12 firstCSharp"
here is the code
public partial class settings : Form
{
[StructLayout(LayoutKind.Sequential)]
[DllImport("kernel32.dll", EntryPoint = "SetSystemTime", SetLastError = true)]
private static extern bool SetSystemTime(ref MyDateTime st);
[DllImport("kernel32.dll", EntryPoint = "GetSystemTime", SetLastError = true)]
private extern static void GetSystemTime(ref MyDateTime sysTime);
please tell me how can i handle this error
thank you everybody in Advance
|
|
|
|
|
cppwxwidgetsss wrote: Attribute 'StructLayout' is not valid on this declaration type
Now how about this: a StructLayout tells something about the layout of a struct you define.
Throw it away.
BTW: an app should not mess around with the system settings, such as Regional Settings, current date/time, etc.
Luc Pattyn [Forum Guidelines] [My Articles]
- before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use the code block button (PRE tags) to preserve formatting when showing multi-line code snippets
|
|
|
|
|
Luc Pattyn wrote: an app should not mess around with the system settings, such as Regional Settings, current date/time, etc.
Hear hear!
|
|
|
|
|
Hello there,
I am having a little problem in implementing the separator line in Windows Form. I have taken a label control in my form and have set its height to 2 pixels and borderStyle to fixed3D and set the AutoSize property of the form to False. However, although a Bevel line is created in place of the label, but the line is not Wide. Its only a few centimetres wide. I have set the label wide property to 100-150 but no changes had taken place. Note that I am not implementing any coding here. I am just setting the property of the label. Please tell me, how can I widen the label (now bevel line) on my form according to my wish.
Your help will really be appreciated,
Thanx....
Rajdeep.NET
|
|
|
|
|
Dude, just paint a separator
In the OnPaint event handler of the form do the following
private void Form1_Paint(object sender, PaintEventArgs e)
{
e.Graphics.DrawLine(new Pen(Brushes.Gray), X1, Y1, X2, Y2);
}
Where X1, Y1, X2, Y2 are the coordinates were the line will be drawn
Welcome to the world of GDI, have fun
Harvey Saayman - South Africa
Software Developer
.Net, C#, SQL
you.suck = (you.Passion != Programming & you.Occupation == jobTitles.Programmer)
1000100 1101111 1100101 1110011 100000 1110100 1101000 1101001 1110011 100000 1101101 1100101 1100001 1101110 100000 1101001 1101101 100000 1100001 100000 1100111 1100101 1100101 1101011 111111
|
|
|
|
|
Just a Minute!
How can I paint a separator? U said to pase the code in the OpPaint Event Handler, But I did not find any control in the toolbox like the OnPaint!
Help please,
this project's gotta do with my life and death....
plz plz plz help me....
Rajdeep.NET
|
|
|
|
|
Just a Minute!
How can I paint a separator? U said to paste the code in the OpPaint Event Handler, But I did not find any control in the toolbox like the OnPaint!
Help please,
this project's gotta do with my life and death....
plz plz plz help me....
Rajdeep.NET
|
|
|
|
|
Add a Panel, set its height, anchor it left and right, and set some BackColor.
And please go buy a tutorial book on C# and study that; in less than a week you would have learned ten times more than you have last week by asking all kinds of elementary questions.
Luc Pattyn [Forum Guidelines] [My Articles]
- before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use the code block button (PRE tags) to preserve formatting when showing multi-line code snippets
|
|
|
|
|
This is from memory, so you may have to adapt to what's actually there, but it should be close:
0) Put a label control on the form.
1) Set the border style property to Fixed 3D.
2) Set the Auto Size property to false.
3) Set the height (or width) to 2px (you have to physically type this because the designer won't let you make it that small by dragging the border with the mouse)
4) Clear the Text property.
5) Now you can use the mouse to make the line as big (long/tall) as you need.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
... can anybody else actually understand most of what is written about C# in the MSDN Library? Or am I just stupid? lol
Jason.
j.t.
|
|
|
|
|
don't say that. you are not stupid.That is my mistake either.
it doesn't really help much. Searching in MSDN is a mistake.
.
.
.
.
Or maybe I'm stupid too.
|
|
|
|
|
Aw thanks Hot_ice lol I feel so much better now
Jason.
j.t.
|
|
|
|
|
I've never had any trouble understanding MSDN content. I'm no genius so draw your own conclusion...
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia)
|
|
|
|
|
yes.
most of it is understandable and informative, sometimes the examples are too simple or just missing.
and there are lots of pages explaining the concepts, but those are a tiny bit more difficult to locate.
Luc Pattyn [Forum Guidelines] [My Articles]
- before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use the code block button (PRE tags) to preserve formatting when showing multi-line code snippets
|
|
|
|
|
Buy a book. The MSDN assumes a basic level of knowledge. Just like an encyclopedia assumes you know English.
Christian Graus
Driven to the arms of OSX by Vista.
"I am new to programming world. I have been learning c# for about past four weeks. I am quite acquainted with the fundamentals of c#. Now I have to work on a project which converts given flat files to XML using the XML serialization method" - SK64 ( but the forums have stuff like this posted every day )
|
|
|
|
|
Thanks Christian, I've always enjoyed reading your answers. Are there any books that you'd remcommend?
j.t.
|
|
|
|
|
0) You're stupid.
1) MSDN sucks, so that makes you stupid twice - first, because you're using MSDN, and second, because you don't understand what they've written (what little help they provide is written in clear English).
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
|
Hi All,
I have a doubt in C# XML update Operation.
while inserting/Updating/Deleting the node in XML ,I need to validate the xml with the corresponding Schema definition.Can you provide the solution without using the normal schema validation mechanism using C#.because every time while updating the node the normal validation mechanism takes more time for validating entire record.
|
|
|
|
|
|
Vista Style Button in C#[^]
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L
%^]*IRXD#@GKCQ`R\^SF_WcHbORY87֦ʻ6ϣN8ȤBcRAV\Z^&SU~%CSWQ@#2
W_AD`EPABIKRDFVS)EVLQK)JKQUFK[M`UKs*$GwU#QDXBER@CBN%
R0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-iTV.C\y<pjxsg-b$f4ia>
-----------------------------------------------
128 bit encrypted signature, crack if you can
|
|
|
|