|
If you're comfortable with C++, then have a review of this[^] and this[^]. And before you ask, no I can't convert this to C# for you - that would take me far too long.
|
|
|
|
|
And if i just find pst file and read it and also convert it into DBX, Live, Thunderbird.
how i do this . give me some example
|
|
|
|
|
situ21 wrote: how i do this
By writing code.
situ21 wrote: give me some example
No.
Did you even bother reading my reply where I told you I wasn't going to do it for you?
|
|
|
|
|
Instead of pleading for other people to tell you how to do it, you could have found these links[^] to get you started.
|
|
|
|
|
Hi,
I have a string 'Name' to be shown on auto-complete of Text-box, which is filled with company name from Data-Set. This field could be 5 characters long to 50 Characters long. I have do some string formatting, so that i could restrict its length to 20 characters.
so, as a result "Hello" will occupy 20 characters with rest as space:
"Hello "
Also, "ThereIsSomeTextHereInThisPost" will also occupy only 20 characters after trim as:
"ThereIsSomeTextHereI"
How do i achieve this in C# language.
Please reply. Thanks.
|
|
|
|
|
|
I think what the OP is asking is restricting it to a max of 20 characters in length specifically for the auto-complete, so PadLeft and PadRight I think may not be appropriate in this circumstance.
You could use the System.Math.Min function like so:
string forAutoCompleteBox = Name.Substring(0, System.Math.Min(20, Name.Length));
This will give you either the first 20 characters of the Name, or the whole Name, whichever is shorter. Did I understand your question correctly?
|
|
|
|
|
Rather than post processing of a text box, which will truncate user input, consider limiting it at the point of entry. This generally feels more natural to users as they do not get typing "thrown away" without them being aware in advance. You can set the TextBox.MaxLength property to 20 characters.
To pad the string to 20 characters, use
string paddedToTwentyChars = String.Format("{0,-20}", myTextBox.Text);
Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together.
Manfred R. Bihy: "Looks as if OP is learning resistant."
|
|
|
|
|
Ravi,
The following does the job simply.
Hope this helps,
Rob
string TwentyChar(string orig)
{
int len = orig.Length;
if (len < 20)
return orig.PadRight(20);
else if (len > 20)
return orig.Substring(0, 20);
else
return orig;
}
|
|
|
|
|
without conditionals:
orig.PadRight(20).Substring(0, 20)
Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.
|
|
|
|
|
Anyone know how to do this in C#? Same as this but programmatically?
Everything makes sense in someone's mind
|
|
|
|
|
|
Hi,
I am deploying a win app using a setup file which downloads and runs from a website.
1 How can I check for new version from withing the application and if possible to force the user to take this version?
2 I am using the settings.settings file to store user values. These are overwritten when a user takes an upgrade. How do I keep these settings? .
I have tried click once but found that if a user does not take an update he does not get another chance and I would have to recompile every time
milenalukic
|
|
|
|
|
ClickOnce[^]
You can code to check for updates each time the application is started and not run until the user updates.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
|
Hello Experts,
I have an Object of Polygon Which I am Drawing In A Rectangle. It Works Successfully.
But i have generate a problem While I want to Shift This Polygon to Left or Top.
So please help me for doing this operation.
Thanks
If you can think then I Can.
|
|
|
|
|
What is the problem?
How are you drawing it? Where are you drawing it? In the Paint event? Or somewhere else?
Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together.
Manfred R. Bihy: "Looks as if OP is learning resistant."
|
|
|
|
|
I have an Object of Polygon Which I want to Align Left.
If you can think then I Can.
|
|
|
|
|
I'm sure this is a language problem, but without better information it is impossible to work out how to help you.
Please, post the fragment of your code that draws the polygon - just the method should be enough - and enclose it in a "code block" by putting <pre> in front of it, and </pre> after it. That preserves the formatting and makes it easier to read:
With code block:
if (condition)
{
statement;
if (condition)
statement;
statement;
}
Without code block:
if (condition)
{
statement;
if (condition)
statement;
statement;
}
Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together.
Manfred R. Bihy: "Looks as if OP is learning resistant."
|
|
|
|
|
Hello Sir,
I am drawing Polygon and Now I want it to shift in Left Side.
In Case of Rectangle We Can Use the Rectangle.X = 0
But How to Shift Polygon.
Code For Drawing Polygon is given below :
Point point1 = new Point(50, 50);
Point point2 = new Point(100, 25);
Point point3 = new Point(200, 5);
Point point4 = new Point(250, 50);
Point point5 = new Point(300, 100);
Point point6 = new Point(350, 200);
Point point7 = new Point(250, 250);
public void DrawPolygonPoint(PaintEventArgs e)
{
Pen blackPen = new Pen(Color.Black, 3);
Point[] curvePoints =
{
point1,
point2,
point3,
point4,
point5,
point6,
point7
};
e.Graphics.DrawPolygon(blackPen, curvePoints);
}
If you can think then I Can.
|
|
|
|
|
Just change all the x-coordinates to move it to the left or right, change the y-coordinates to move it up or down.
|
|
|
|
|
 Good - you are drawing it in the Paint event.
The simplest way is to just add an offset into your curve constructor:
private void panel1_Paint(object sender, PaintEventArgs e)
{
DrawPolygonPoint(e);
DrawPolygonPoint(e, -10, -20);
DrawPolygonPoint(e, -20, 10);
}
Point point1 = new Point(50, 50);
Point point2 = new Point(100, 25);
Point point3 = new Point(200, 5);
Point point4 = new Point(250, 50);
Point point5 = new Point(300, 100);
Point point6 = new Point(350, 200);
Point point7 = new Point(250, 250);
public void DrawPolygonPoint(PaintEventArgs e)
{
DrawPolygonPoint(e, 0, 0);
}
public void DrawPolygonPoint(PaintEventArgs e, int xOffset, int yOffset)
{
Pen blackPen = new Pen(Color.Black, 3);
Point[] curvePoints =
{
AddOffset(point1, xOffset, yOffset),
AddOffset(point2, xOffset, yOffset),
AddOffset(point3, xOffset, yOffset),
AddOffset(point4, xOffset, yOffset),
AddOffset(point5, xOffset, yOffset),
AddOffset(point6, xOffset, yOffset),
AddOffset(point7, xOffset, yOffset)
};
e.Graphics.DrawPolygon(blackPen, curvePoints);
blackPen.Dispose();
}
private Point AddOffset(Point p, int xOffset, int yOffset)
{
return new Point(p.X + xOffset, p.Y + yOffset);
}
(NOTE: If you construct a graphics item, such as a pen, you should dispose of it when you are finished)
Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together.
Manfred R. Bihy: "Looks as if OP is learning resistant."
|
|
|
|
|
The Code Is Not Working Fine as Requirement.
I want to Place this Polygon to Left Side.
If you can think then I Can.
|
|
|
|
|
Then add a negative xOffset, and leave yOffset zero...
Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together.
Manfred R. Bihy: "Looks as if OP is learning resistant."
|
|
|
|
|
It will not work.
My Requirement is If I am Drawing Star or Triangle from Polygon and i want to shift (Align) it to Left.
If you can think then I Can.
|
|
|
|
|