|
|
Thank u for reply,I wanna to write in ascii format.What i wanna is that if i write text as:
abcd
ef
gh
i want to add 123 after e, so it should look like
abcd
e123f
gh
Regards
Chintan
www.visharadsoft.com
(Nothing is so purify as KNOWLEDGE)
|
|
|
|
|
Use the StreamReader and StreamWriter classes. You can use then statemens like MyStream.WriteLine("Mytext"); Please check the documentation of these classes for examples.
Rudolf Heijink
|
|
|
|
|
Hello Every body,
I had used an array to populate the combo box ,(working on windows application with c# )
I am able to populate the displayMember but I am not able to populate its value member.
I am getting folowing error:
Cannot bind to the new display member.
Parameter name: newDisplayMember
Regards,
rahul saini
|
|
|
|
|
monuSaini wrote: Cannot bind to the new display member.
Parameter name: newDisplayMember
Can you show us your code?
I guess, it's not like that. isn't it?
string[] str = new string[] { "One", "Two", "Three" };<br />
comboBox1.DataSource = str;<br />
comboBox1.Refresh();
|
|
|
|
|
Hi Michael,
Thanks for rplying.
I am using following code:
string[] Level = new string[] {"Level A","Level B","Level C" };
int[] LevelValue = new int[] { 0,1, 2 };
for (int i = 0; i < Level.Length ; i++)
{
comboBox.DisplayMember = userLevel[i].ToString();
comboBox.ValueMember = i.ToString();
comboBox.DataSource = Level;
}
Regards,
rahul saini
|
|
|
|
|
Below are parts of the code that i've done, However, it does not detect the mousedown over the area or the rectangle or ellipse. Where did i do the mistake? Can anybody help?
Thanks
public class Form1 : System.Windows.Forms.Form
{
private System.Drawing.Bitmap m_objDrawingSurface;
///
/// Required designer variable.
///
private System.ComponentModel.Container components = null;
Graphics objGraphics;
Rectangle rectBounds;
Rectangle rectangle=new Rectangle(0,10,50,50);
Rectangle ellipse=new Rectangle(100,10,50,50);
private Point mouse_pos;
.................................................................
private void Form1_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e)
{
Point current_pos = Control.MousePosition;
mouse_pos.X = e.X;
mouse_pos.Y = e.Y;
if (rectangle.Contains(current_pos.X,current_pos.Y ))
{ MessageBox.Show("Detect rectangle", "Info", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);}
else if (ellipse.Contains(current_pos.X,current_pos.Y ))
{MessageBox.Show("Detect ellipse", "Info", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);}
else
return;
}
Edit/Delete Message
|
|
|
|
|
cyn8 wrote: Graphics objGraphics;
Why do you have a member graphics object ? I don't see how that's ever a good idea.
cyn8 wrote: Control.MousePosition;
What is this ? Have you tried to trace it's value to see if it's what you expect ?
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
I'm sorry, i'm just a begineer. therefore, there mayb alot of mistakes that i might have done. However, what do you suggest i can do in order to achieve the result. Assume that i need to display 3 shape(circle, rectangle and a triangle). I should be able to select any of them at one time to be drag and drop.
thanks
|
|
|
|
|
Hello Christian,
Christian Graus wrote: Why do you have a member graphics object ? I don't see how that's ever a good idea.
I normaly never need to draw on Images, but I was interested by a question here on the forum.
The task is to Draw on the BackgroundImage of a panel.
I did a little test project and thought this is a good idea:
private Graphics panelGraphics = null;
private Pen leftPen = new Pen(Color.Red,2);
private Pen rightPen = new Pen(Color.White,2);
private Point oldPosition;
private bool init=false;
private void panel2_MouseMove(object sender, System.Windows.Forms.MouseEventArgs e)
{
if((e.Button == MouseButtons.Left) || (e.Button == MouseButtons.Right))
{
Pen actPen;
if(e.Button == MouseButtons.Left)
{
actPen = leftPen;
}
else
{
actPen = rightPen;
}
if(panel2.BackgroundImage==null)
panel2.BackgroundImage= new Bitmap(panel2.Width, panel2.Height);
if(panelGraphics==null)
panelGraphics = Graphics.FromImage(panel2.BackgroundImage);
if(init)
{
Point newPostion = new Point(e.X,e.Y);
panelGraphics.DrawLine(actPen, oldPosition, newPostion);
Refresh();
}
init=true;
oldPosition = new Point(e.X,e.Y);
}
}
private void panel2_MouseUp(object sender, System.Windows.Forms.MouseEventArgs e)
{
init=false;
}
private void panel2_MouseLeave(object sender, System.EventArgs e)
{
init=false;
}
As you can see I also used a member graphics object, and now I'm curious what you think of it.
Thanks for your time!
P.S.: I would Dispose all the IDisposable members in the Dispose method of the form, off course!
All the best,
Martin
|
|
|
|
|
Hello,
It seems that your MouseDown is not even fired, because your Mouse is over an Control.
Therefore you have to Handle the MouseDown on the Control itselfe.
All the best,
Martin
|
|
|
|
|
i quite sure that my mousedown is fired on the form itself. If it doesn't, like what u said, what should i do to fix it?
thanks
|
|
|
|
|
as I know to install SQL server 2005 there should be a server installed .is there any other way to install sql server 2005 in window xp.
in SQLexpress server 2005.
problem is it allows to log on to the server in windows authentication , can create new logins for SQL authentication mode but doesn't allow to logon in sql authentication mode.
|
|
|
|
|
|
Hi,
Can Anyone Give me an article or maybe a tutorial guide about "Custom Tab Control", "Binding Tab Control" or something related to that
Thank You,
Kind Regard,
TCim
|
|
|
|
|
|
I have one server implemented in WIN32 C++. I want to build another server to communicate (Winsock) with this WIN32 server in C#/.NET using Winsock
However I am worried about incompatibility - haven't done Winsock before not sure if things like wiring a custom class over Winsock can be a problem because two ends are implemented in two languages (C++ and C#) and two framework (WIN32 and .NET)
Any suggestion?
|
|
|
|
|
Why not just use the sockets stuff in .Net?
You don't have to use the same network libaries at each end, tcp/ip has the same protocols no magtter what
|
|
|
|
|
originSH wrote: Why not just use the sockets stuff in .Net?
That'd work huh? I never try this, can I wire a C++ class from WIN32 server, then on receiving end (our C# server) read off the socket...? I have a feeling probably intrinsic types would do just fine but ...
Thanks
|
|
|
|
|
There are several layers to network communications. Everything up to network protocol (i.e. tcp/ip most of the time) is standard.
You then have the communications protocol on top of this which can be standard if implimenting an existing one (i.e. the hidious IRC RFC 1459[^]) or custom if your making it yourself.
How you send the data over the communication protocol is what your dealing with here and will govern if (or rather how easily) different frameworks and languages can talk to each other. To send a class over you would have to serialize it at the one end and deserialize it at the other. If you have a serializer in C++ and a deserializer in C# that will work together then it'll be all good
How are you serializing the class at the c++ end?
|
|
|
|
|
yes planning on wiring down a vanilla C++ class
I think my C# server will have to linked+interop with a WIN32 C++ dll (perhaps wrapped by C++ managed/.net dll) ... hope this will work
|
|
|
|
|
I'de definatly go the route of C++/Cli if you have VS2k5 ... it's great for this sorta stuff
|
|
|
|
|
I used to work on a system that relied upon a .Net application communicating via Tcp/IP with a Win32 C++ server. It works and I found no problems with it.
Ok, as for the design, well you'll have to designate one of the applications as the server and one as the client. That way they can communicate. Otherwise you will have to implement both a client and a server in each application.
Look for the C# Chat application article on this web site. That should help.
Phil
|
|
|
|
|
.NET server hasn't been implemented --- to be on the safe side I probably would do it in managed C++ rather than C# so chances of problem in deserialization of the wired C++ class from WIN32 server would be minimize.
thanks
devy
|
|
|
|
|
I am writing an application in which vehicles are moving on their pre-assigned route. The user is capable of choosing a particular vehicleName from a dropdown list and the chosen vehicle attributes get listed on the PropertyGrid. Since, these vehicle objects are dynamically moving, their attribute - 'fuel_remaining' continuously reduces. But, on the PropertyGrid, the value of the GridItem related to 'fuel_remaining' updates only at the instant when I choose the vehilceName from the dropdown list. If I have to see the updated value again, I have to choose the vehicleName again from the list. Is there anyway where I can program it to show the continuously changing value for that attribute field from just one selection of the particular vehicleName from the list?
Thanks for the help, if anyone can provide.
|
|
|
|