|
I think your best bet would be creating a simple form with a RichTextBox inside. There should be many code examples, tutorials and/or articles in the internet that cover syntax highlighting with RichTextBox.
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook www.troschuetz.de
|
|
|
|
|
dear programers
in sqlservr database i made field type 'nvarchar' and 'ntext' does not work.
how can i Encode and Decode the utf-8 characters so that i can easly save to database
sikandar
|
|
|
|
|
Standard question #1:
What do you mean by "not working"?
If you have a text saved as UTF-8, you can load it with a StreamReader using the Encoding.UTF8 encoding. When you read a string from the stream it will be decoded to Uncode, that you can store in the database.
---
b { font-weight: normal; }
|
|
|
|
|
HI
i am new in c#
plz tell me
how to define the below in c#
struct link
{
int info;
link *next
};
struct link *start=new link;
Parshant
|
|
|
|
|
Well, you can't have a pointer, so
struct link
{
int info;
link next
};
struct link start=new link();
You don't want to be writing linked list classes tho, you should just use the ones built into the framework.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
sir plz tell me how with abov e.g
|
|
|
|
|
I don't understand - I converted your struct to C#, what else did you need ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
I guess he tried to compile your code and it failed. It doesn't work because you're trying to create an instance of the struct as a member of the very struct you're defining, so it becomes kinda like an infinite recursive definition.
|
|
|
|
|
Structs works differently in C# than in C. In C# a struct is a value type and a class is a reference type, while in C a struct is just a definition and the type depends on how you use it.
As you want to have references to your objects you would want it to be a reference type, so you use a class:
class Link {
public int info;
public Link next;
}
Link start = new Link();
---
b { font-weight: normal; }
|
|
|
|
|
Good point
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
How to create report in VS.Net 2003 using C#
namita dang
|
|
|
|
|
How to create report in VS.Net 2003 using C#
Jitendra Tyagi
|
|
|
|
|
|
Hello
how to make image transparent in Win Appl in c#.NET so that I can see controls behind it,what r the properties that I have to changes for it.
Thanking you
Yogesh_T
|
|
|
|
|
how to map an object of the so called real life to programming world.
Say there is a car. How can we take this to programming world. Car with wheel, engine, etc. Car
can move without even doors, it's movement will be effected if one wheel is with low air pressure.
etc.
Here car should be an object, wheel also an object. Car has wheels, doors etc., but wheel has different
impact than doors as far as motion is concerned.
Can someone help me visualize this object to OOP?
|
|
|
|
|
You can't, not really. Every car has some stains on the seats, are you going to bother to map those ? Chips in the paint ? Oil on the engine ? No. You choose the bits that are important to what you want to write, and you map those to classes. Getting it exactly the way it is in the real world is not the point, mapping the bits you want to interact with so they work smoothly in your program, is.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
>>You can't, not really.
Help me to some extent.
>>Every car has some stains on the seats, are you going to bother to map those ?
Yes, anything with some volume should be able to interact with the seat. There some physics rules should come handy. and so on
>> Chips in the paint ?
Yes, again some interaction with the environment. How environment can effect the car?
>> Oil on the engine ?
Yes, of course. Help me outhere as well.
>> No. You choose the bits that are important to what you want to write, and you map those to classes. Getting it exactly the way it is in the real world is not the point, mapping the bits you want to interact with so they work smoothly in your program, is.
'm want to simulate the max possible.
|
|
|
|
|
sinanju wrote: 'm want to simulate the max possible.
Why ? Are you writing a game ? Why would you care if there's oil ON the engine ( under the hood ), or chips in the paint, or stains in the seat ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
public class Car
{
private Wheel [] wheels;
private Door [] doors;
private SteeringWheel steeringWheel;
private GearBox gearBox;
private Engine engine;
public Car()
{
wheels = new Wheel[4];
doors = new Door[4];
gearBox = new GearBox();
steeringWheel = new SteeringWheel();
engine = new TwoLitreEngine();
}
public void Start()
{
gearBox.SetNeutral();
while(!engine.Started)
{
engine.EngageStarterMotor();
}
engine.DisengageStarterMotor();
}
}
You can go on ad infinitum implementing whatever objects you want to define. The above code relies on an implementation of Wheel , Door , GearBox , and SteeringWheel . Also, a base class called Engine and an implementation of it called TwoLitreEngine is defined.
|
|
|
|
|
Car a is a very large object to map.
This class is a decent basic overview, but due to the massive variations between types of car, you could consider making it abstract and defining specific types of car.
This implementation assumes that a car will have 4 wheels (some had 3), and 4 doors (some have 2), and does the book count as a door? Manual or Auto gearbox, etc.
e.g.
public class VauxhallCorsa : public Car
{
public VauxhallCorsa()
{
wheels = new Wheel[4];
doors = new Door[3];
gearBox = new ManualGearBox();
steeringWheel = new SteeringWheel();
engine = new OneLitreEngine();
}
}
|
|
|
|
|
wheelerbarry wrote: This class is a decent basic overview, but due to the massive variations between types of car, you could consider making it abstract and defining specific types of car.
Considering the OP isnt even proficient in defining objects yet, I tried to stear clear of the obvious abstractions.
Of course, the base class should be called Vehicle allowing definition of a Boat (no wheels, still with engine), Bycycle (2 wheels, no engine/gearbox) etc etc etc.
My answer was simply to give a basic layout of a class, which i think is what the OP asked for!
|
|
|
|
|
Hi,
I am working on a Windows based project using C#.
Using VS 1.1 version.
I am using a datagrid.I have a problem, that if the user
modifies the data in the grid, how will we come to know
that there is a change in value in the grid.
I am not using DataSet...i am using a DataGrid
Plz help me to solve the prob,since i am new to C#
Thanks in advance
Regards,
Vaishali
|
|
|
|
|
how you fill the rows in the grid , what is your data source ??
Tamimi - Code
|
|
|
|
|
hi,
i made a access database and view it on a datagrid, i did this by using the datasource,ea in the toolbar. i can add rows to my database, but i cant find the way to delete one. i can delete one in the datagrid but it is not gone in my database. i tried this code:
try
{
tabel1TableAdapter.Update(db1DataSet.tabel1);
db1DataSet.AcceptChanges();
// refresh after the delete
this.tabel1TableAdapter.Fill(this.db1DataSet.tabel1);
Application.DoEvents();
}
catch (System.Exception ex)
{
db1DataSet.RejectChanges();
lbl_error.Text= ex.Message;
}
but i get an error because there is nog valid delete command,
so i looked that op, now i dont know how to create a deletecommand using the tableadapter that was build by the wizard in the beginning by using the toolbar.
can anybody help, or is there another way to delete items without having an error
thx
|
|
|
|
|
See here[^] maybe it is some helpful to you
|
|
|
|