|
Ok thanks but am searching for this kind of article please check it it is really niceCodeProject Article
these kind of articles that would make a developer better that others and this is what am searching for
|
|
|
|
|
hi all,
i have a datagridview, i want to check cell value in CellEndEdit event. if the cell is empty, don't allow to leave it.
how can i do it?
|
|
|
|
|
set property
CauseValidation = true;
in CellValidating() event handler
dtGrdView_CellValidating(object sender, DataGridViewCellValidatingEventArgs e)
{
here e will provide you the data entered in the data grid view
if (e.ColumnIndex > 0)
{
e.Cancel = true;
}
}
thats it!!
reg,
Deep
Happy Coding
modified on Wednesday, August 19, 2009 5:24 AM
|
|
|
|
|
thanks for Your answer, but
(i want check blank cells, when it's edit && now leaved)
when i check blank cell into if statement (for example if(datagrid[x,y].value.ToString()=="")) the cell value is the previous value
and it is True, only the cell is already empty.
What is the solution?
|
|
|
|
|
HI all,
i m using SmsSendMessage api for sending sms , its working fine .
i have one problem its still working when mobile have no sufficient balance for sending sms,in that case i want when mobile have no sufficient balance for sending sms than it display a message for balance enquiry and stop the message sending process.
please tell me how can i check the balance of mobile phone with codeing.
if possible please explain me with any example.
thanks in advance.
To accomplish great things, we must not only act, but also dream;
not only plan, but also believe.
|
|
|
|
|
This question has nothing to do with any sort of standard API offered by Microsoft in the .NET framework. So, you need to look at the library you are using, and see if it offers the functionality you need.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
|
Oh. you're using the compact framework. Why didn't you say so ? What have you done to try to find APIs that check if a phone still has credits ? I would be surprised if such a thing existed.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
actully i m inserting this exe in Windows based mobile and send sms tru this exe.
To accomplish great things, we must not only act, but also dream;
not only plan, but also believe.
|
|
|
|
|
Hi,
I'm trying to connect with telnet to a switch a by typing it's user and password to be able to connect to it.
i found this code:
at - Here
i think the return message that i recieve it to long for the byte[].
The application fall he:
numBytesRead = ns.Read(readBuffer, 0, readBuffer.Length);
but i don't reciere any error message.
Can some please help me here ???
modified on Wednesday, August 19, 2009 7:36 AM
|
|
|
|
|
Is there any option to check how many bytes are waiting?
It's supposed to be some property of the NetworkStream?
|
|
|
|
|
Dear All,
I need to develop a program that gets signals continuously and then play them. So I play audio streams in 100ms periods. My problem is that there is an undesired sound in the onset and offset of each stream. For example I write a program which plays an audio stream with constant values as follow, but it makes a noisy sound instead of constant sound.
What's the problem? and what's the solution?
using System;
using System.Windows.Forms;
using Microsoft.DirectX.DirectSound;
using System.IO;
namespace TestSound
{
class CSound : Form
{
const int HEADER_SIZE = 44;
const bool FLAG_STEREO = true;
const short BITS_PER_SAMPLE = 16;
const int SAMPLE_RATE = 44100;
int numberOfSamples;
MemoryStream stream;
BinaryWriter writer;
Device ApplicationDevice = null;
SecondaryBuffer buffer = null;
BufferDescription description;
public CSound()
{
try
{
ApplicationDevice = new Device();
}
catch
{
MessageBox.Show("Unable to create sound device.");
ApplicationDevice = null;
return;
}
ApplicationDevice.SetCooperativeLevel(this, CooperativeLevel.Priority);
description = new BufferDescription();
description.ControlEffects = false;
stream = new MemoryStream();
writer = new BinaryWriter(stream);
}
private void AddHeader()
{
stream.Position = 0;
writer.Write(0x46464952);
writer.Write((int)(HEADER_SIZE + (numberOfSamples * BITS_PER_SAMPLE * (FLAG_STEREO ? 2 : 1) / 8)) - 8);
writer.Write(0x45564157);
writer.Write(0x20746d66);
writer.Write(16);
writer.Write((short)1);
writer.Write((short)(FLAG_STEREO ? 2 : 1));
writer.Write(SAMPLE_RATE);
writer.Write(SAMPLE_RATE * (FLAG_STEREO ? 2 : 1) * BITS_PER_SAMPLE / 8);
writer.Write((short)((FLAG_STEREO ? 2 : 1) * BITS_PER_SAMPLE / 8));
writer.Write(BITS_PER_SAMPLE);
writer.Write(0x61746164);
writer.Write((int)(numberOfSamples * BITS_PER_SAMPLE * (FLAG_STEREO ? 2 : 1) / 8));
}
public void Play(short[] samples)
{
if (ApplicationDevice == null)
return;
stream.Position = HEADER_SIZE;
numberOfSamples = samples.Length;
for (int i = 0; i < numberOfSamples; i++)
{
writer.Write(samples[i]);
if (FLAG_STEREO)
writer.Write(samples[i]);
}
AddHeader();
stream.Position = 0;
try
{
if (buffer != null)
{
buffer.Dispose();
buffer = null;
}
buffer = new SecondaryBuffer(stream, description, ApplicationDevice);
buffer.Play(0, BufferPlayFlags.Default);
}
catch (Exception e)
{
MessageBox.Show(e.Message);
}
}
static short[] samples = new short[4410];
static CSound sound;
static void Main()
{
Form form = new Form();
form.Show();
sound = new CSound();
Random random = new Random();
for (int i = 0; i < samples.Length; i++)
samples[i] = 1000;
while (true)
{
sound.Play(samples);
System.Threading.Thread.Sleep(100);
}
}
}
}
|
|
|
|
|
Hi Everybody
With Graphics Class in C# for example I draw a line on the panel, But after minimizing the form and show again the line disappear in the other hands, after refreshing form all graphic objects will be disappear.
What is your recommendation for permanent graphic object in the form?
Best Regards,
Reza Shojaee
modified on Wednesday, August 19, 2009 1:01 AM
|
|
|
|
|
You are using the CreateGraphics method. This is completely useless unless you're drawing something temporary. Handle the Paint event and draw your line there, that's what it is for
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
i'm trying to create a question using a given paragraph dynamically, is there any one who has done this kind of function, at the moment i'm trying to do it using templates , but it doesn't seem to be work fine.
|
|
|
|
|
I've read this five times and I still have no idea what you mean. you want to take a random paragraph and rephrase it as a question ?
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
|
You want to generate questions based on some text you have?
I don't think you will be able to do this unless your code can "understand" the paragraph and then ask questions.
It's not necessary to be so stupid, either, but people manage it. - Christian Graus, 2009 AD
|
|
|
|
|
sorry for uncleanness, what i'm trying to do is, create a question relevant to a paragraph, means just imagine i have a C# article and i want to generate a question relevant to this article through a c# application.
i think this is not easy , but i want to know if there is a better way for this.
|
|
|
|
|
There is no trivial way to do this. I would suggest there's little chance of you coming up with a method that asks questions that appear to have been written by a human.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
As I said earlier, this can be done ONLY if the computer can UNDERSTAND the paragraph. And if the paragraph is a random one, there a very minute chance that this can be done.
That too only if the paragraph is like: "my name is XYZ" and questions should be like "what is my name". But to interpret the text, you need a human.
It's not necessary to be so stupid, either, but people manage it. - Christian Graus, 2009 AD
|
|
|
|
|
I'm trying to set ToolStripControlHost backcolor as ToolStripMenuItem but it only fill control's backcolor. I tried with custom Renderer and override almost every event method but nothing found working...
here is the screenshot of problem
http://i476.photobucket.com/albums/rr121/xmen_xwk/fullbackColor.png
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L
%^]*IRXD#@GKCQ`R\^SF_WcHbORY87֦ʻ6ϣN8ȤBcRAV\Z^&SU~%CSWQ@#2
W_AD`EPABIKRDFVS)EVLQK)JKQUFK[M`UKs*$GwU#QDXBER@CBN%
R0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-iTV.C\y<pjxsg-b$f4ia>
-----------------------------------------------
128 bit encrypted signature, crack if you can
|
|
|
|
|
Hello,
I have implemented a logger which is writing the data to a text file. But, the file size gets huge if all the data is written to it.
I want to keep only last one hour data in file. The logger should keep writing all data till one hour and after that it should follow LIFO structure. So that the file size will not be uncontrolled.
How it can be done in C#?
Thanks a lot.
|
|
|
|
|
LIFO is going to be a PITA - why not split the log files into hourly files, just keep withing to the file name, on the hour create a new file and then your garbage collection is a simple jod to delete the old files. Saves thrashing around inside the text file.
|
|
|
|
|
Thanks Holmes,
Actually, the data is getting logged from two different events to same file and i am just writing over there. At a given condition only one event will be fired. The file creation is done in constructor and the same name is referred to write into it.
If we can limit either text length or size then it would be easier.
|
|
|
|