|
Christian Graus wrote:
I'm not sure how to iterate through all documents in an MDI app,
foreach(Form form in this.MdiChildren)
{
TextDocumentForm textForm = form as TextDocumentForm;
if(textForm != null)
{
}
}
Now you know!
-- LuisR
Luis Alonso Ramos
Intelectix - Chihuahua, Mexico
Not much here: My CP Blog!
|
|
|
|
|
I would place this code into the MdiParent, right?
Something tells me that that's the only logical place to put it, but I wanted to be sure.
Thanks again
Brian Turner
|
|
|
|
|
Yes, only an MDI parent window (IsMdiParent property set to true ) can have MDI children.
-- LuisR
Luis Alonso Ramos
Intelectix - Chihuahua, Mexico
Not much here: My CP Blog!
|
|
|
|
|
I think that what I need is a code snippet, know of any good places to get that? Reason being is I learn better by having something to emulate. I'm still learning how to implement various classes. I'll post the code that I have so far, when I am able, so that you can all have something to chuckle at
Thanks for the help
Brian Turner
Some say that ignorance is bliss... Blissful, aren't they?
|
|
|
|
|
string theDocument = LoadString(); // This method does not exist, you need to get the text of the document
theDocument.Replace("oldstring", "newString");
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Hi guys,
Is there anyway I can load and view fonts that are not in the font folder? Scenario, I want to open and browse 3 or four differing folders on my computer with different fonts that I don' want to install till I've seen all of them. And being able to print them is a bonus...!
Cheers for any pointers,
Enumerating system fonts is easy....
|
|
|
|
|
|
Given a table name (e.g. CUSTOMERS), how do I get column names of the table and the data types of the columns the table has?
I am using SQLServer and would like to get that info from my C# code.
|
|
|
|
|
|
Or something similar?
|
|
|
|
|
Well you could say what spawnlp does... it would save me from googling.
Take a look at Process Class[^]
David
|
|
|
|
|
It's gone from C++ .NET apparently...
_spawnlp, _wspawnlp
Create and execute a new process.
int _spawnlp( int mode, const char *cmdname, const char *arg0, const char *arg1, ... const char *argn, NULL );
|
|
|
|
|
I found it thanks.
using System;
using System.Diagnostics;
using System.ComponentModel;
It's Process.Start("someprogram.exe");
|
|
|
|
|
Does anyone know how to override the Listview items property so that it will populate the listview with my custom ListViewItemCollection? I was able to use:
ListViewItemsExtra m_ItemsExtra = new ListViewItemsExtra();
new public ListViewItemsExtra Items
{
get{ return m_ItemsExtra; }
}
this did override the property and adds my custom listview items to the collection, but they do not show up in the listview. I was hoping to overide the ListViewItemCollection and have it use my custom Item without redrawing the objects in the listview.
Lamont Bullock
|
|
|
|
|
I don't know if you can make the ListView using m_ItemsExtra instead of the, probably, private class member it uses to list its items.
Why not trying a different thing? I mean.. if I want more/own functionality in "my" ListViewItem, I'd inherit ListViewItem.
public class MyListViewItem : ListViewItem
I can still use it with the ListView because it is implicitly casted to ListViewItem (I guess on the implicit cast).
|
|
|
|
|
Zarrab,
Sorry for not being more clear on how I went about the Listview control. I did create a new Listview class and it does inherit the properties of the .net listview class. This is why I want to override the listview's items collection with my own. I tried creating a new property called ItemsExtra and a custom ListViewItemExtraCollection to store the ListViewItemsExtra class objects. using the get{} accessor I am able to add ListViewItemsExtra to the collection fine, but the IDE doesnt automatically create the code
below that it does for a normal listview item.
listViewExtra.addrange( new ListViewItemsExtra.ListViewItemsExtraCollection{
this.listViewItemExtra1, this.listViewItemExtra2, this.listViewItemExtra3, etc } )
If I could override the Items property and have it add my custom ItemsExtra object or override the Add() method on the ListViewItemCollection class I may be able to successfully get the ItemExtras in the listview without haveing to redraw them with code. It also works to change the code for a normal listview item to my ItemsExtra object, but that isn't clean like I would like. I want to be able to re-use the control whenever I need it, with the ease of other controls and not have to jerry rig code.
Do you have any suggestions?
Lamont Bullock
|
|
|
|
|
Hi,
Can someone PLEASE help me out.
I keep getting this error: Exception from HRESULT: 0x800A03EC
whenever I get to this line of code:
excel.ThisWorkbook.SaveAs(@"C:/",
Excel.XlFileFormat.xlXMLSpreadsheet, Type.Missing,
Type.Missing, Type.Missing, Type.Missing,
Excel.XlSaveAsAccessMode.xlNoChange, Type.Missing,
Type.Missing, Type.Missing, Type.Missing, Type.Missing);
And the localization is already set to "en-US"
E-mail me if you can help out! schoudhr@hotmail.com
it would be GREATLY appreciated
|
|
|
|
|
First, "C:/" is an invalid path. Second, it also doesn't specify a filename.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
hi,
thanks for the reply, that was just my many attempts to try anything. this is the original code (which gives the same error):
excel.ThisWorkbook.SaveAs(Server.MapPath("Upload/test.xls"),
Excel.XlFileFormat.xlWorkbookNormal/*xlXMLSpreadsheet*/, Type.Missing,
Type.Missing, Type.Missing, Type.Missing,
Excel.XlSaveAsAccessMode.xlNoChange, Type.Missing,
Type.Missing, Type.Missing, Type.Missing, Type.Missing);
I've tried EVERYTHING. If anyone knows how to take that excel object and send it direcly to the client for download as an .xls that would be equally great.
schoudhr@hotmail.com
|
|
|
|
|
I'm creating a custom error dialog, and want it to use the same bell sound as an error MessageBox. I tried writing an ascii 7 (BEL) to the error text, but it didn't work and I'm not sure what else to
|
|
|
|
|
Hello
You can try to interop MessageBeep for that
Andrew
|
|
|
|
|
How? The example project I found here won't build out of the zip. I fixed the reference to the other project in it, but I can't find the two directX references to readd.
http://www.codeproject.com/csharp/MessageBeep.asp?df=100&forumid=14167&exp=0&select=904080#xx904080xx
|
|
|
|
|
for example, something like this:
[DllImport("user32.dll")]
public static extern int MessageBeep(int type);
and some where in your code:
MessageBeep(0);
Andrew
|
|
|
|
|
Andrew Kirillov wrote:
[DllImport("user32.dll")]
public static extern int MessageBeep(int type);
WHen I coppied that code into .net it errors on 'int': "Expected class, delegate, enum, interface, or struct".
|
|
|
|
|
dan neely wrote:
WHen I coppied that code into .net it errors on 'int': "Expected class, delegate, enum, interface, or struct".
Wow, what a strange error. And where did you copy it ? Can you post your code ?
Andrew
|
|
|
|