|
What about creating a simple custom tool.
This[^] article is very to the point, I'm guessing that all you'll have to do is read in the contents of the file, replace #include<filename> with the contents of filename and return the bytes.
The article explains more fully what you have to do. I also seem to remember that there was also an article about custom tools here.
Formula 1 - Short for "F1 Racing" - named after the standard "help" key in Windows, it's a sport where participants desperately search through software help files trying to find actual documentation. It's tedious and somewhat cruel, most matches ending in a draw as no participant is able to find anything helpful. - Shog9
|
|
|
|
|
Thanks, I'll have a look.
|
|
|
|
|
Thanks for answering my question from earlier in the day as well
I posted one this morning about writing a custom tool. It was excellent luck that you happened to post exactly what I needed.
|
|
|
|
|
gantww wrote: I posted one this morning about writing a custom tool
Which question what, did I respond to it or did you stumble across this answer?
Formula 1 - Short for "F1 Racing" - named after the standard "help" key in Windows, it's a sport where participants desperately search through software help files trying to find actual documentation. It's tedious and somewhat cruel, most matches ending in a draw as no participant is able to find anything helpful. - Shog9
|
|
|
|
|
John Cardinal wrote: What I'm currently doing is copying and pasting but this is tedious and what I'd really like to do is define the chunks of code that are common and have the compiler insert them into the classes on compiling. AFAIK this isn't a feature in visual studio 2k5 or c#.
Does anyone have any ideas or suggestions?
Hmm, I don't think this is what you're looking for, but code snippets might help automate the copying and pasting. It's not the same as a compiler inserting code into a class at compile time, which, to be honest, I'm not really sure I understand, but it would certain save on key strokes.
|
|
|
|
|
Yes, use abstraction and interfaces, you're working too hard.
|
|
|
|
|
Hello,
I want to force the user to close first the child form befor he/she can click on the mainform. just like those message box.
How do you do that?
Donkaiser
|
|
|
|
|
use ShowDialog() instead of Show()
|
|
|
|
|
My typing is slow
Sincerely,
Elina
Life is great!!!
Enjoy every moment of it!
|
|
|
|
|
|
Open your form as a DialogResult.
In order to do that, open it this way:
myChildForm.ShowDialog()
Hope that helps
Sincerely,
Elina
Life is great!!!
Enjoy every moment of it!
|
|
|
|
|
I want to add images to an imagelist while the program is running but I keep getting an out of memory exception.
My code looks like this:
foreach (string n in classfunctions.fxLoadXML())
{
this.imageList1.Images.Add(Bitmap.FromFile(n));
}
where fxLoadXML returns an array.
//Nick
|
|
|
|
|
First things first, you might want to check and make sure that the file you are sending to Bitmap.FromFile is actually there and is a valid image format.
Also, how many images are we talking about? The imagelist probably has some sort of upper limit. Are the images all the same size, colordepth, format, etc.?
Also, you may want to check the documents on the imagelist. It may not require the Bitmap to hang around after being added to the imagelist - if so, you'll want to dispose it.
|
|
|
|
|
Okay, thanks, the problem was a combination of I was trying to add an image format, which was not supported, and that I didn’t dispose the imagefile.
//Nick
|
|
|
|
|
I wasn't sure which board to post this because it's not technically just C#, or just ASP.NET so I apologize in advance.
I have a connection string key to a SQL Server database. I made a copy of the database on my computer so I can test the edit function of nested datagrids (which I've read can be tricky).
I've never had to point to my own machine before and my key is giving me errors.
This is how I point to the actual real server:
<add key="ConnectionString" value="Data Source=SERVER-SQLSC1;Initial Catalog=Parts;User ID=aspuser;Password=crlamo5" />
This is what I tried for localhost:
<add key = "ConnectionString" value = "Data Source = localhost;Initial Catalog=PartsDB;"/>
I renamed the database PartsDB to avoid confusion. My computer's name is PROC-PC-11. I tried that instead of localhost and I still had an error when trying to retrieve data from the database.
Can someone point me in the right direction?
Many thanks as always!
|
|
|
|
|
I have several instances of a UserControl on a Form. Each UserControl represents one of several possible audio channels.
This UserControl has a public property describing which audio channel the particular instance represents. The list of available audio channels is in an enum.
I've been able to implement "setting" this property and the corresponding updation of a label in the UserControl to reflect which channel that particular instance of the UserControl is currently representing.
The width of the control is constant. The width of the text is not. For example, Left, Right, Left Surr, Right Surr, etc.
How do I get the text centered with respect to the width of the control.
I tried lblChannel.TextAlign = System.Drawing.ContentAlignment.MiddleCenter but that doesn't work. I suppose that only aligns text with respect to the label.
Do I need to calculate the location of the label for each channel selection?
Thanks!
|
|
|
|
|
Well, if middlecenter works to calculate with respect to the label, make the label fill the user control horizontally. As long as AutoSize is turned off and you have the label anchored to the left and right, it should work.
Logifusion[^]
|
|
|
|
|
Thanks for your reply!
Turning Autosize off results in the label's text being truncated. "Left Surround" shows up as "Left".
What am I doing wrong?
|
|
|
|
|
You can either spread the label to the whole width of the usercontrol and then when it is TextAlign = center it will be automaticly centered.
Or you can use this: (this.Size.Width - lbl1.Size.Width - 10) / 2 -> this will be cenetered. (Set it as the location with the y position that you need.)
Hope I helped...
NaNg.
|
|
|
|
|
Ah! Ok... I didn't think about spreading the label to cover the width of the control. (sorry, I'm new to this still!)
Thanks for your reply! It works now.
|
|
|
|
|
table.clear()?
table = null?
table.remove?
|
|
|
|
|
DataSet.Tables["TableName"].remove()
|
|
|
|
|
Well if you have a bad design, you have to work around it. You should never have tables with the same name.
|
|
|
|
|
Ok so you have an xml specification which has a value called ID. These are attributes of an http table not a dataset.table although they can be the same.
If you are talking about tables in a dataset they should match a good relational model. Each table has a different name, each row in the table should have a unique identifier. No different in this case with what you showed, although it looks like you don't have a unique id.
I am not totally familar with sending a dataset to an xml file, but it is supposed to keep all of the design (schema). It should work exactly the same in reverse.
Try this, create a dataset with a table from scratch, then save it off as a xml file, open the file in a regular editor and see what it wrote out there. Then modify your table above to match that schema. (If you can). Otherwise you will have to pull data out of each of the tables above and decide what datarows you want to delete.
|
|
|
|
|
Ok so you know which appointments need to be deleted right?
Let's try to map a design out for this.
You have existing data and new data right?
You want to compare existing to new.
For outdated entries you want to delete the calendar entry?
This sounds like a bridge pattern. But I'd have to check that out.
|
|
|
|