|
how about copying it there?
|
|
|
|
|
Will not work, it has to be installed!
I'm also looking for a code solution fro that.
|
|
|
|
|
Hi, I need a FTP client and FTP server source code for Linux, please, help me.
|
|
|
|
|
err..since C# is a microsoft language this would be the LAST place you should ask in o_O
|
|
|
|
|
Have people never heard of Google[^]?, I just typed in Linux ftp server and that was the third hit.
|
|
|
|
|
I am running through a list (named sublist in my code) of lines checking to see if any match where the user has clicked. At the moment I am using the following code which does work
bool test = false;
int hold;
int i =0;
while (!test && i < sublist.Count)
{
test = sublist[i].DeleteLine(new Point(e.X, e.Y));
if (test)
hold = i;
i++;
}
If there is a match I will delete the line from the list, so I need to know the location where the match occurred. I would like to just be able to use i, but either I get an out of bounds error or miss the last line in the array. I have looked at do/while with the same results. With for/foreach I either go through the whole list and still need to remember where the match occurred or use break which I understand is poor coding practice in a for loop.
My question is, is there a way to not have to use the variable hold with a do/while or while loop?
|
|
|
|
|
Try looping backwards from sublist.count to 0.
|
|
|
|
|
there is nothing wrong with using break in this case, try this;
int i=0;
do
{
if (sublist[i].DeleteLine(new Point(e.X, e.Y)))
break;
} while (i++ < sublist.Count);
If you are determined not to use a break you can do something like this, but I think the first example is easier to read and understand.
int i=0;
do { } while ( !sublist[i].DeleteLine(new Point(e.X, e.Y)) && (i++ < sublist.Count ));
Tara
|
|
|
|
|
try this:
int i=0;
do { } while ( !sublist[i].DeleteLine(new Point(e.X, e.Y)) && (i++ < sublist.Count ));
actually I would prefer to use the break statement, it is easier to understand
int i = 0;
do {
if ( sublist[i].DeleteLine(new Point(e.X, e.Y) ) )
break;
} while (i++ < sublist.Count);
Tara
|
|
|
|
|
Hi,
you have an index (i), an initialisation, a continuation test, and an increment.
That is called a for loop.
To avoid needing the index outside the for loop, do the delete inside it,
something like:
for (int i=0; i<count; i++) {
if (some test) {
do whatever needs to be done to item i
break;
}
}
There is nothing wrong with break; it is intended to be used for an early termination
of a loop, so it is a natural here.
Luc Pattyn
|
|
|
|
|
I hav 100 records in a dataset.how can i fetch the first 5 records from the dataset
|
|
|
|
|
I know that when you have a sql statement MySql support Limit 5. Then you get 5 records. But i dont know if all the database applications support it. Hope it helps.
|
|
|
|
|
select top 5 fieldname1, ....
|
|
|
|
|
<br />
ResultForm.richTextBox1.Text += "Return Result # " + (beginResultPage + i + 1).ToString() + "\r";<br />
ResultForm.richTextBox1.Text += gresult.resultElements[i].title + "\r";<br />
ResultForm.richTextBox1.Text += gresult.resultElements[i].snippet + "\r";<br />
ResultForm.richTextBox1.Text += gresult.resultElements[i].URL + "\r\r";<br />
Hi
from the codes above, i want to bold some of the results that is recieved through the richTextBox control in the form.
For eg, if i want to make bold the title that is produced using this line of code,
ResultForm.richTextBox1.Text += gresult.resultElements[i].title + "\r";
What do i need to add in to ensure that the title is in bold?
I tried with FontStyle.Bold but i can't seem to get this right.
Help!,
frossie
|
|
|
|
|
I would try selecting the relevant text then:
richTextBox.SelectionFont = new Font(richTextBox.SelectionFont, FontStyle.Bold);
|
|
|
|
|
Problem: Hidden text not being set for RichTextBox initialized in an MDI Child Form.
Initialize a RichTextBox in an MDi Child form:
RichTextBox rtb = new RichTextBox();
rtb.SelectedRtf is initially set to empty string. Expected result is (rtb.SelectedRtf == "{\\rtf1\\ansi\\ansicpg1252\\deff0\\deflang1033\\uc1 }\r\n").
Also set rtb.SelectedRtf = @"{\rtf1\ansi " + "visibleText" + @"\v " + "hiddenText" + @"\v0}";
The result is rtb.Text = "visibleText". (rtb.Text should be "visibleTexthiddenText").
i.e. the hidden text is not being updated when rtb is initialized in an MDIChild.
Anyone know the cause/workaround? Your help is appreciated.
Thanks, B
|
|
|
|
|
Hi
Is there a way to change the Form look so it will have round corners - or change it to a shape that I like? Draw it myself?
Is there a way to change the controlBox look as well - set different colors and different buttons?
I know that in c++ it's possible
thanks in advance
|
|
|
|
|
Of course you can do it!
For example, in the Form1_Paint() handler you could use:
System.Drawing.Drawing2D.GraphicsPath gPath = new System.Drawing.Drawing2D.GraphicsPath();
System.Drawing.Rectangle formRectangle = this.Bounds;
gPath.AddEllipse(0, 0, formRectangle.Width, formRectangle.Height);
this.Region = new System.Drawing.Region(gPath);
This will turn your form into an ellipse.
Just use your imagination
SkyWalker
|
|
|
|
|
|
By the way.
Usually, when I want to drag a winodw, I click and hold the ControlBox and drag the window.
How can make move the window when I click and hold on a place in the window itself?
|
|
|
|
|
Hello,
Here is a code which might helps you.
I used the methods in a basic form and my inherit form called the public method. (Just in case you are wondering why it's public)
private Point _startDragPoint;
private System.Timers.Timer TimerMovePad;
this.MouseUp += new System.Windows.Forms.MouseEventHandler(this.yourFormMouseUp);
this.MouseMove += new System.Windows.Forms.MouseEventHandler(this.yourFormMouseMove);
this.MouseDown += new System.Windows.Forms.MouseEventHandler(this.yourFormMouseDown);
public void MovePadMouseDown(System.Windows.Forms.MouseEventArgs e)
{
_dragModeEnabled = true;
_startDragPoint = new Point(e.X, e.Y);
}
public void MovePadMouseMove(System.Windows.Forms.MouseEventArgs e)
{
if (_dragModeEnabled == false)
return;
MovePad(e);
}
public void MovePadMouseUp(System.Windows.Forms.MouseEventArgs e)
{
if (_dragModeEnabled == false)
return;
_dragModeEnabled = false;
MovePad(e);
}
private void MovePad(System.Windows.Forms.MouseEventArgs e)
{
if(TimerMovePad == null)
{
this.TimerMovePad = new System.Timers.Timer();
this.TimerMovePad.Interval = 100;
this.TimerMovePad.Elapsed +=new System.Timers.ElapsedEventHandler(TimerMovePad_Elapsed);
}
if (TimerMovePad.Enabled == false)
{
TimerMovePad.Enabled = true;
}
if(_movementok == true)
{
_movementok = false;
int delta_x = e.X - _startDragPoint.X;
int delta_y = e.Y - _startDragPoint.Y;
this.Location = new Point((this.Location.X + delta_x), (this.Location.Y + delta_y));
}
}
private void TimerMovePad_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
{
TimerMovePad.Enabled = false;
_movementok = true;
}
private void yourFormMouseDown(object sender, System.Windows.Forms.MouseEventArgs e)
{
MovePadMouseDown(e);
}
private void yourFormMouseMove(object sender, System.Windows.Forms.MouseEventArgs e)
{
MovePadMouseMove(e);
}
private void yourFormMouseUp(object sender, System.Windows.Forms.MouseEventArgs e)
{
MovePadMouseUp(e);
}
Hope it helps!
All the best,
Martin
|
|
|
|
|
thanks
|
|
|
|
|
hi..
how to set a button as default..
that when i press the Enter button, the button event should occur
regards,
hiremath
|
|
|
|
|
I don't know how you can set a button as default... But instead of this, you can set the KeyPreview property value "true" and add handle the KeyDown event of the form, and call the same method that you call with the button click event.
|
|
|
|
|
Hello,
I think the AcceptButton property is what you are looking for.
yourform.AcceptButton = yourbutton;
All the best,
Martin
|
|
|
|