|
You'd probably have to use a hook. Hook the keyboard, and see if you can cancel the message. Although this is not advisable, unless you'r making some kind of kiosk thing. There are articles here on how to hook the keyboard and mouse and whatnot.
My current favourite word is: Bauble!
-SK Genius
|
|
|
|
|
hi guys
i want to handle the rowadded event of c1flex grid
but i am unable to find any event handler there ,
so if there is any alternative to handle the event when there is new row
inserted in cqflex grid ,.,
thansk in advance
hello
|
|
|
|
|
Hi,
actually what u wanna do ?
Thanks,
Sun Rays
To get something you must have to try once.
My Articles
|
|
|
|
|
no these events are not available
there ,
i just want to hanlde the event when a new row is added , if rowadded would hv been there so there
was no problem at all but its not there ,,,
thanks in advance
hello
|
|
|
|
|
Hello All,
I am getting an unknown error when trying to create a huge word document. It will create somwhere arround 37 pages of word document thene it will pop up error message stating..
error HRESULT E_FAIL has been returned from a call to a COM component.
Thanks in advance.
Bharath.S Ron
|
|
|
|
|
|
Hi,
I am trying to use logging but it's giving th problem.
Please suggest whatr can be done.
public void TraceLog(string strTraceLog)<br />
{<br />
try<br />
{<br />
TextWriterTraceListener objTraceListener = new TextWriterTraceListener(m_LogFilePath);<br />
Trace.Listeners.Add(objTraceListener);<br />
Trace.WriteLine(strTraceLog);<br />
<br />
Trace.Flush();<br />
<br />
}<br />
catch (Exception ex)<br />
{<br />
throw ex;<br />
}<br />
<br />
<br />
<br />
}
why is this giving me error that other process is using it or cannot access closed file.
Thanks
Develop2Program & Program2Develop
|
|
|
|
|
Hi
I am developing an application using C#.NET and SQL Server 2000.
I want to create and implement triggers in select update and insert statements
|
|
|
|
|
You do that through the database.
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
is there a way to call thread.join to thread from the threadpool?
|
|
|
|
|
If you want to synchronize one of your threads with a queued worker item, I would suggest
you use an AutoResetEvent or ManualResetEvent object; the worker item could call its Set()
method, the interested thread could use its WaitOne().
Luc Pattyn [Forum Guidelines] [My Articles]
this months tips:
- before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use PRE tags to preserve formatting when showing multi-line code snippets
|
|
|
|
|
Hi,
I have created a window application. I have to provide security to it. I have to provide a login form with username and password. The username and password are present in the database. When i click the login button it should compare the username and password entered in the form with that in database and give access to the Window application that i first created. How to do it.
Please help
Nitin Raj Bidkikar
Nitin Raj Bidkikar
|
|
|
|
|
You just take the username and password from the windows form, have them be in the where clause of your query, if the query returns 1 row, then you let them log in. Simple enough.
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
I am writing a program that stores date, as fixed width data. The record is supposed to be 532 characters wrong. When I do the getRecordLength method it says that the record is 548 characters wrong. I looked at the file and its adding a strange character ( [], (, #, $, etc...) to each thing im writing. Why is it adding this and how do i get rid of this.
Thanks.
Kyle
Kyle Maldonado
|
|
|
|
|
Because your name is Kyle.
Could you post a small section of the code that is performing the write?
|
|
|
|
|
this is the code
clsContact myData = new clsContact();
string Filename = "Employee.dat";
int flag;
string State = cboState.Text;
string Country = cboCountry.Text;
string Birthday = txtBdayMonth.Text + '/' + txtBdayDay.Text + '/' + txtBdayYear.Text;
string Anniversary = txtAnnMonth.Text + '/' + txtAnnDay.Text + '/' + txtAnnYear.Text;
string HomePhone = txtHAreaCode.Text + '-' + txtHPrefix.Text + '-' + txtHLast.Text;
string CellPhone = txtCAreaCode.Text + '-' + txtCPrefix.Text + '-' + txtCLast.Text;
string EmployeePictureFile = txtLName.Text + txtFName.Text + ".jpg";
myData.FirstName = txtFName.Text;
myData.LastName = txtLName.Text;
myData.MI = txtMI.Text;
myData.SSN = txtSSN.Text;
myData.AddressLine1 = txtAddressLine1.Text;
myData.AddressLine2 = txtAddressLine2.Text;
myData.Zip = txtZip.Text;
myData.OfficeExtension = txtOfficeExt.Text;
myData.Email = txtEmail.Text;
myData.Spouse = txtSpouse.Text;
myData.Department = cboDepartment.Text;
myData.State = cboState.Text;
myData.Country = cboCountry.Text;
myData.City = txtCity.Text;
myData.Birthday = Birthday;
myData.Anniversary = Anniversary;
myData.HomePhoneNumber = HomePhone;
myData.CellPhoneNumber = CellPhone;
myData.EmployeePictureFile = EmployeePictureFile;
BinaryWriter bw = null;
if (!validation())
{
return;
}
myData.FileName = Filename;
flag = myData.Create(Filename);
if (flag == 0) //An error
{
return;
}
{
{
try
{
int recs = (int)myData.getRecordCount();
//getInputValues();
myData.WriteOneRecord(recs);
}
catch (Exception ex)
{
MessageBox.Show("Error saving contact" + contact.FileName + ex.Message);
}
finally
{
if (bw != null)
{
bw.Close();
}
}
lstContacts.Items.Add(myData.LastName + "\t" + myData.FirstName);
contact = null;
}
}
}
and its calling these methods from a class
public long getRecordCount()
{
long records = 0;
long remainder;
try
{
if (myFile != null)
{
// Position the file pointer
records = myFile.Seek(0, SeekOrigin.End);
}
}
catch (IOException ex)
{
errorMessage = ex.Message;
return 0;
}
// See if there is a partial record
remainder = records % RECORDSIZE;
// Calculate the records
records = records / RECORDSIZE;
// If there was a partial record...
if (remainder > 0)
// ...up the counter to account for it.
records++;
return records;
}
and
public int WriteOneRecord(int num)
{
int errorFlag = 1;
try
{
if (myFile != null && bw != null)
{
//Postions the file pointer
myFile.Seek(num * RECORDSIZE, SeekOrigin.Begin);
bw.Write(LastName);
bw.Write(FirstName);
bw.Write(MI);
bw.Write(SSN);
bw.Write(AddressLine1);
bw.Write(AddressLine2);
bw.Write(City);
bw.Write(State);
bw.Write(Country);
bw.Write(Zip);
bw.Write(HomePhoneNumber);
bw.Write(CellPhoneNumber);
bw.Write(OfficeExtension);
bw.Write(Department);
bw.Write(Email);
bw.Write(Spouse);
bw.Write(Birthday);
bw.Write(Anniversary);
bw.Write(EmployeePictureFile);
}
}
catch (IOException ex)
{
errorMessage = ex.Message; //In case they want to view it
errorFlag = 0;
}
return errorFlag;
}
Thanks for the help in advance
Kyle Maldonado
|
|
|
|
|
Anyone see anything wrong?
Kyle Maldonado
|
|
|
|
|
I guess from the code, your thing would be much easier to handle as a SQL (or simply a Database) task. Still, I have question: Why is it important the size you stated in your 1st post?
to avoid strange chars:
you can use streamwriter instead of binarywriter with proper encoding (eg.: Encoding.UTF-16 - as a parameter-) if you expect other than eng. characters.
cheers, geri
|
|
|
|
|
Its for a school project, we have to use a text file, using a fixed witdth. And we have to use binary.
Kyle Maldonado
|
|
|
|
|
still don't understand why to use a fixed size (do you mean fixed size, when you write fixed width?):
an idea to your code: it 's always useful to close your writer in a finally block like:
binarywriter.close();
|
|
|
|
|
When I say fixed size i mean that
NAMESIZE = 30
if (txtName.length < NAMESIZE)
{
txtName.PadRight(NAMESIZE).Substring(0,NAMESIZE);
}
so then all the records are the same size so its easier to pull data out.
(The above code was just written fast, may not be correct)
Kyle Maldonado
|
|
|
|
|
|
Hi,
from MSDN on BinaryWriter.Write Method (String):
"Writes a length-prefixed string to this stream in the current encoding of the BinaryWriter,
and advances the current position of the stream in accordance with the encoding used and the
specific characters being written to the stream"
Luc Pattyn [Forum Guidelines] [My Articles]
this months tips:
- before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use PRE tags to preserve formatting when showing multi-line code snippets
|
|
|
|
|
In the code I have it create a form, then a button. The button is added to the newly created form. When the user clicks on the button I want it to run a function that includes closing the form. Can this be done?
|
|
|
|
|
Jordanwb wrote: Can this be done?
Of course it can be done...just a shot in the dark here...
maybe form.close();
A craft is an enemy if not well learned.
|
|
|
|