|
Excellent! *rubbing hands together, with an evil grin on my face*
Now, how do I do that?
|
|
|
|
|
You could also just do it the easy way:
Click once on the button, and then keep holding down the Enter-key on your keyboard.
Virtual1ty
"Any fool can learn from his own mistakes, but a wise man learns from mistakes of others"
|
|
|
|
|
There's no keyboard. This is for a touch screen.
|
|
|
|
|
Oh, okay
Virtual1ty
"Any fool can learn from his own mistakes, but a wise man learns from mistakes of others"
|
|
|
|
|
I created a new windows form with a button and a rich text box. The following code produces the effect you want. Granted, you'll need to add more logic in there, but it should be enough to get your started:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace WindowsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
this.m_Timer = new Timer();
this.m_Timer.Interval = 100;
this.m_Timer.Tick += new EventHandler(m_Timer_Tick);
}
private Timer m_Timer;
private void button1_MouseDown(object sender, MouseEventArgs e)
{
lock (this.m_Timer)
{
if (!this.m_Timer.Enabled)
this.m_Timer.Start();
}
}
private void button1_MouseUp(object sender, MouseEventArgs e)
{
lock (this.m_Timer)
{
if (this.m_Timer.Enabled)
this.m_Timer.Stop();
}
}
private void button1_Click(object sender, EventArgs e)
{
this.richTextBox1.Text += string.Format("Clicked - {0}{1}",
DateTime.Now.ToLongTimeString(),
Environment.NewLine);
}
private void m_Timer_Tick(object sender, EventArgs e)
{
this.button1_Click(this.button1, EventArgs.Empty);
}
}
}
|
|
|
|
|
Yup...that will get me headed in the right direction. Thank you very much.
|
|
|
|
|
Hello Every 1.
I have a strange problem with webclient. I have the following method in a class created to download files from a website. I download files sequentially i.e download one file dispose the download class object then create a new object and call the download method and so on....
public void DownloadVideo()
{
try
{
WebClient wcDownload = new WebClient();
webRequest = (HttpWebRequest)WebRequest.Create(_VideoUrl);
webRequest.Credentials = CredentialCache.DefaultCredentials;
webResponse = (HttpWebResponse)webRequest.GetResponse();
if (webResponse.ResponseUri.ToString() != "http://www.xyz.com/error.htm")
{
Int64 fileSize = webResponse.ContentLength;
strResponse = wcDownload.OpenRead(_VideoUrl);
strLocal = new FileStream(_VideoPath, FileMode.Create, FileAccess.Write, FileShare.None);
int bytesSize = 0;
byte[] downBuffer = new byte[2048];
while ((bytesSize = strResponse.Read(downBuffer, 0, downBuffer.Length)) > 0)
{
strLocal.Write(downBuffer, 0, bytesSize);
UpdateVideoProgressEventArgs uvpea = new UpdateVideoProgressEventArgs(strLocal.Length, fileSize);
UpdateVideoProgressEvent(this, uvpea);
}
}
}
catch (Exception exp)
{
MessageBox.Show("Error in startDownload due to : " + exp.Message);
}
finally
{
if (strLocal != null)
strLocal.Close();
if (strResponse != null)
strResponse.Close();
webRequest = null;
webResponse = null;
}
}
It works fine for the first file download but fails for the second file because it just hangs up @
strResponse = wcDownload.OpenRead(_VideoUrl);
and eventually time out.
o O º(`'·.,(`'·., ☆,.·''),.·'')º O o°
»·'"`»* *☆ t4ure4n ☆* *«·'"`«
°o O º(,.·''(,.·'' ☆`'·.,)`'·.,)º O o°
|
|
|
|
|
Here i am facing a problem
I m displaying a gridview data in that i want the sno is automatically to be generated for each and every row the grid is binding
can any one pls help me
Thanks in advance
sai krishna
|
|
|
|
|
|
such create a dummy cloumn and assign current row index value to the column...that's it..my friend
|
|
|
|
|
i only got it
<
asp:TemplateField HeaderText="Item Count">
<itemtemplate>
<%#Container.DataItemIndex + 1%>
Thanks
sai krishna
|
|
|
|
|
welcome...
|
|
|
|
|
hai Friend,
Please show how to edit / Insert the text to a csv file at middle
when multiuser working with the same file
kannan.R
kannan_chinna@email.com
|
|
|
|
|
RamasamyKannan wrote: when multiuser working with the same file
That's not really possible. If your users write to the same file, either they will do it at the same time and one will fail, or the last one to write, will win, and all changes are lost. Unless you were to do some sort of diff and merge in any changes that occured with your own changes, which is complex.
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've never heard of it, but I still found it with google, in seconds.
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 )
|
|
|
|
|
There[^] you go. Enjoy.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Hi All.
In AD i have two users - u1 and u2. I want to check - has user u1 rights to update some attributes of user u2.
how i can check it in C# 2.0, framework 2.0 ?
|
|
|
|
|
hi all
i am inserting date to the text box on the datagrid template.There is 2 column for that. one receive date and the other due date. due date should be greater than receive date. and the date format is dd/mm/yyyy. how to validate this. since the date format is dd.mm.yyyy, am not able to compare it with different month.plz help me to solve this. am doing this from past 4 days. but didnt end up with a solution
sample code is given below
if(((TextBox)(dgDetailData.Items[total].Cells[7].Controls[1])).Text != "")
{
try
{
DateTime txt=Convert.ToDateTime(((TextBox)(dgDetailData.Items[total].Cells[6].Controls[1])).Text);
DateTime tst=Convert.ToDateTime(((TextBox)(dgDetailData.Items[total].Cells[7].Controls[1])).Text);
string date=month+"/"+day+"/"+year;
if(DateTime.Compare(txt,tst)>0)
{
lblmsg.Text="error";
lbl1.Text=date.ToString();
}
else
{
lbl1.Text=txt.ToString();
InsertParam[9].Value=Production.FORMATYMONDTIME(((TextBox)(dgDetailData.Items[total].Cells[7].Controls[1])).Text);
}
}
catch(Exception err)
{
RegisterStartupScript("startup","<script>window.alert('1.Error:"+err.ToString()+"')</script>");
}
}
else
{
InsertParam[9].Value=DBNull.Value;
}
-- modified at 22:46 Thursday 4th October, 2007
|
|
|
|
|
P_Elza wrote: since the date format is dd.mm.yyyy, am not able to compare it with different month
Why not ?
if (txt > tst)
should work just fine.
What's going wrong with this code when you step through it now ?
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 )
|
|
|
|
|
Hello guys,
is there any way, how can I change IP address and other network settings programmatically ? [using C#, or unmanaged C++].
thanks in advance
VirtualVoid.NET
|
|
|
|
|
Dear all,
Is there a way to put the cursor say Hourglass to appear on form? Like the Disk Defragmenter in Vista, when you click on the "Defragment now" button, an hourglass will be shown at the side of the label "Defragmenting hard disks...".
Additionally, in IE7, while a web page is loading, you can see an hourglass cursor on the edge of the tab.
Many thanks!
|
|
|
|
|
It won't be a cursor, but you can draw anything you like on your form.
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 )
|
|
|
|
|
try put image there with some properties like "visible" which will be set to true (and then displayed) when some action is processed
VirtualVoid.NET
|
|
|
|
|
Set Form.Cursor=Cursors.WaitCursor and hover the form...
Luc Pattyn [Forum Guidelines] [My Articles]
this weeks tips:
- make Visual display line numbers: Tools/Options/TextEditor/...
- show exceptions with ToString() to see all information
- before you ask a question here, search CodeProject, then Google
|
|
|
|