|
Jim,
That worked a treat - many thanks.
I wasn't sure about the syntax - most of the web pages I saw have very complex examples or only code for one specifi thing - not a combination of several.
Once again, thanks for your response.
John.
PS: The smiley in the middle of the expression was interesting!
|
|
|
|
|
Most examples are more complex because they use regular expression to match the entire strings, not just to identify single characters. You should consider using the regular expression for what you are doing, instead of looping through the characters.
---
b { font-weight: normal; }
|
|
|
|
|
Im trying to code an email message. From what ive found is that im supposed to use system.web.mail however when i try to use it, it tells me that the namespace doesnt exist, can anyone help me out?
|
|
|
|
|
I suspect you're writing a windows app ( not ASP.NET ) and need to add a reference to System.Web to your project.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Hi Numbers1thru9,
Christian has given you the one of the reasons why you face the error in the first place.
In the event you want to have a look at some simple code; I had published an aritcle titled "AlarmTimer" located at http://www.codeproject.com/csharp/abyalarmtimer.asp[^] Just some basic stuff when I intiialy started fooling around.
Hope it helps you out...
Thanks and Regards,
Aby
|
|
|
|
|
Ok this might sound like a very dumb questions to many ppl but I have got to understand it so ignore the dumbness of the question .
Anyways, in windows applications (for e.g. Quicken, QuickBooks, MS Money or any other data-extensive application) how and where do they store the data? Do they use a database? if they use a database then why don't they ask us to install a database engine (which should be a prerquisite - MSDE for instance)?
If they don't use database then how in the heck do they keep up with the relational data?
Your help will be appreciated . Thanks in advance.
|
|
|
|
|
I don't know how they store their data, but I guess it's some custom binary format.
But for your own applications you might want to use SQLite.
It's a database similar to MySQL (though lacking some feaetures) which stores a database into a single file
For C# (and .NET) you can use the Mono.Data.SQLite class in your applications
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
How can i play a simple wav file with my application?
rzvme
|
|
|
|
|
Not sure if there's anything built in ( for C# 2.0, I thought there was ), but the PlaySound API can be interoped for wavs, for mp3, you can use the Windows Media Player control.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
i know there is a playsound function and i read on msdn that it is on coredll.dll. the only problem is that i don'y have a coredll.dll.
rzvme
|
|
|
|
|
|
You are looking for one of these functions
[DllImport("Winmm.dll", CallingConvention=CallingConvention.Cdecl)]
static extern int sndPlaySound(IntPtr buffer, int dwFlags);
[DllImport("Winmm.dll", CharSet=CharSet.Ansi,
CallingConvention=CallingConvention.Cdecl)]
static extern int PlaySound(string filespec, int hModule, int dwFlags);
Luc Pattyn
|
|
|
|
|
|
I have bound a DataTable to a DataGrid:
_ds = new System.Data.DataSet("ResultsDataSet");
_resultsTable = new System.Data.DataTable( "ResultsTable" );
_ds.Tables.Add( _resultsTable );
dataGridResults.SetDataBinding(_ds,"ResultsTable");
When the user clicks on a row, I want to get information about that row:
System.Data.DataRow currRow = _resultsTable.Rows[dataGridResults.CurrentRowIndex];
This works fine until I sort the DataGrid by clicking on the column headers. Now the dataGridResults.CurrentRowIndex is out of sync with the _resultsTable. I either need to have the DataTable sort with the DataGrid, or be able to get information directly from the DataGrid. Am I doing something wrong, or do I need to add something?
|
|
|
|
|
Hi,
try this:
System.Data.DataRow currRow = _resultsTable.DefaultView[dataGridResults.CurrentRowIndex].Row;
Robert
|
|
|
|
|
That helped. I had to tinker with it a bit more, but it is working now.
Thanks
|
|
|
|
|
Hi everyone,
Here's what I'm trying to do. I create a RichTextBox object and set some text (in code, I'm not adding it to the form). I want to take what it would look like and draw it onto another control (like a panel).
Am I able to do this somehow? Is it possible without Interop junk?
Thanks,
Nick Spacek
|
|
|
|
|
Are you trying to add one programatically created control to another programatically created control ?or are you trying to add that text box to control added Via the designer?
|
|
|
|
|
Nope, not at all. I just want to take what the RTB control would be drawing and draw it onto the panel control somehow.
|
|
|
|
|
I thought that .NET controls have a method for painting to a bitmap ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
On that note, I went searching. I managed to come across this article where they draw a web browser control onto a picture box and save it:
http://www.developerfusion.co.uk/show/4712/[^]
Thanks for idea, hopefully there's something a little more .NETish though...
Nick
|
|
|
|
|
No, I thought there was a framework method for rendering a control.
But, I can't see it now, so I could be wrong.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
I tried this out and should have realized it wouldn't work quite the way I wanted. For this to work, I think it actually needs to be a visible control since that's the way the BitBlt works...
Nick
|
|
|
|
|
nickspacek wrote: I want to take what it would look like and draw it onto another control (like a panel).
I'm going to ask a silly question. Why not put a RichTextBox control on the panel instead? Seems like you want to do things the hard way?
|
|
|
|
|
Haha, well, it's a good question. I sorta had this idea that this is the best direction to go but I could be completely wrong. Basically I want to have this panel be a media container (stupid name) or something. I stumbled upon another class here that uses DirectShow to render a video given a handle and bounding rectangle. So the idea is to use just some generic control to draw everything on. I could probably have my app switching between different controls I guess...
There's probably a completely better way to do it all. If I want to use DirectShow for videos I suppose I should use DirectX to render the text and stuff too, but then I'd have to write some sort of class for describing rich text, etc. I may go that way in the future I suppose.
Nick
|
|
|
|