|
In you project you have created two forms.
Form1 -- this is your MDIParent form
Form2 -- your child base form.
In the properties for Form2, find the Layout / Window State property and change if from Normal to Maximize.
Rebuild your project and your children will now be maximized.
_____________________________________________
The world is a dangerous place. Not because of those that do evil, but because of those who look on and do nothing.
|
|
|
|
|
In my program, I used a DataGrid to display the data from the database. I realized that the column headings are in alphabetical order from left to right, which is not what I want. How can I change the setting to display the columns in my own way? I've tried using the TableMappings property of DataAdapter, but I couldn't make it work. Please give me some instructions about it. Thank you!
|
|
|
|
|
You can use the DataGrid TableStyles.
First you add one GridColumnStyle and a collection of columns to it. Each column you set the 'mapping' value to match the column in ur dataset that u want to display .
No time to breathe
|
|
|
|
|
I got it! Thank you very much!
|
|
|
|
|
I am teaching my self C# and the book I have doesn't show how to scroll to the next record. The standard thing I do is to move to the next/prev record check for eof/bof and if that is true, move to first/last then display the record. I can't find how to move to the next/last/prev/first record. I can think of a way using a global variable and tracking the recordcount and check the location, but the way I mention is easier. Can anyone point me to the MSDN page, or other page that gives a nice example of this? Thanks
|
|
|
|
|
Are you working with either a DataReader object or a DataSet object? If not, then check out these objects before you go any further.
Mark Sanders
sanderssolutions.com
|
|
|
|
|
I'm working with a dataset object.
|
|
|
|
|
Because a dataset is a fully disconnected container for data, datasets (unlike ADO recordsets) do not need or support the concept of a current record. Instead, all records in the dataset are available.
A dataset can be made up of multiple DataTable objects which in turn can have DataRow objects and DataColumn objects. You can use a variety of different means to access these objects such as foreach loops or direct minipulation.
You might checkout http://samples.gotdotnet.com/quickstart/howto/doc/adoplus/getdatafromdb.aspx[^]
Mark Sanders
sanderssolutions.com
|
|
|
|
|
So if there is no methods to a the standard first/prev/next/last, would I need to write my own routines to do such things? Or is there another datatype that I can use have access to this?
This makes scrolling though database records one at a time quite a bit more difficult then I think it should be with a new language.
Or perhaps someone has made such routines I can thiev and use.
Thanks
|
|
|
|
|
There are two ways: you can use notation
this.dataSet1.Tables[0].Rows[i] to point the row you are looking for, or you can play with CurrencyManager. CurrencyManager is much more powerful, and probably this is the routine you need.
link to CurrencyManager Class specs (MSDN):
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemwindowsformscurrencymanagerclasstopic.asp
|
|
|
|
|
Hi,
I have very strange problem!
I am deriving my own class, inherited from TabControl.
I need to make my own painting, so I wrote that:
SetStyle(ControlStyles.AllPaintingInWmPaint, true);
SetStyle(ControlStyles.UserPaint, true);
SetStyle(ControlStyles.DoubleBuffer, true);
Then proccessing the OnPaint method worked just fine, but when I decided to handle the scrolling of the tab pages I found out that I CAN'T get rid of the two scroll buttons windows draws on the tab control. I overrode almost every possible virtual method and put "Invalidate" in it, but the scroll buttons still appear
Any idea of how scrolling the pages on my own, without the help of windows?
GAtanasov
|
|
|
|
|
protected override CreateParams CreateParams
{
get
{
System.Windows.Forms.CreateParams param = base.CreateParams;
if (((int)WindowStyles.VSCROLL & param.Style) != 0)
{
param.Style -= (int)WindowStyles.VSCROLL;
}
if (((int)WindowStyles.HSCROLL & param.Style) != 0)
{
param.Style -= (int)WindowStyles.HSCROLL;
}
return param;
}
} This I used for the RichTextBox, should work for a tabcontrol as well.
I rated this article 2 by mistake. It deserves more. I wanted to get to the second page... - vjedlicka 3:33 25 Nov '02
|
|
|
|
|
Well, again
|
|
|
|
|
Thanks ,leppie
Your code should work for ONE CONTROL, but the case here is not that:
I finally found out what is wrong with MyTab
As it wrappers the common controls TabControl when scrolling of the tab pages is needed
a new updown control is created that has nothing to do with the parent TabControl and thus it receives no messages through its parent
Now my question is do you have any idea of how to get to that updown control and prevent it from displaying?
Cheers,
Gogou
GAtanasov
|
|
|
|
|
You shouldn't really use addition or subtraction for bitwise operations. You can just use:
param.Style &= ~(int)(WindowStyles.VSCROLL | WindowStyles.HSCROLL);
"These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer
|
|
|
|
|
Hi!
I would like to know how to convert System.DateTime to System.Runtime.InteropServices.FILETIME?
Thanks!
|
|
|
|
|
long ftime = DateTime.Now.ToFileTime();
FILETIME ft = new FILETIME();
IntPtr pftime = Marshal.AllocHGlobal(Marshal.SizeOf(ftime));
Marshal.Write(ftime);
ft.dwHighDateTime = Marshal.ReadInt32(pftime);
ft.dwLowDateTime = Marshal.ReadInt32(pftime, Marshal.SizeOf(int));
Marshal.FreeHGlobal(pftime);
I rated this article 2 by mistake. It deserves more. I wanted to get to the second page... - vjedlicka 3:33 25 Nov '02
|
|
|
|
|
static FILETIME FileTimeFromDateTime(DateTime date)
{
long ftime = date.ToFileTime();
FILETIME ft = new FILETIME();
ft.dwHighDateTime = (int)(ftime >> 32);
ft.dwLowDateTime = (int)ftime;
return ft;
}
static DateTime DateTimeFromFileTime(FILETIME ft)
{
return DateTime.FromFileTime(
((long)ft.dwHighDateTime << 32)
+ (long)ft.dwLowDateTime);
}
"These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer
|
|
|
|
|
I'm trying to show XML that I get streamed to my app in a browser control. To test, I've dropped a control on a form and let the designer do the init work (BeginInit, misc. code, EndInit). Here's what I've added in my form's ctor :
<br />
object a = string.Empty;<br />
axWebBrowser1.Navigate( "about:blank", ref a, ref a, ref a, ref a );<br />
<br />
string xml = "<ROOT><test_node>42</test_node></ROOT>";<br />
((IHTMLDocument2)axWebBrowser1.Document).body.innerHTML = xml;<br />
The last line throws a NullReferenceException. I'm not sure why -- this code is supposed to work, right? Can someone pass on some advice on how to make this work or on the proper way to show XML in a browser control?
Thanks!
|
|
|
|
|
I believe several things are being confused here.
To get it short, Internet Explorer shows xml content when it loads a document with application/xml mime type, and applies a default (unless specified) xslt stylesheet, producing the nice rendering anyone can see.
You are quicker done by storing the stream to a local file, and call a Navigate2 to this local file.
Unless you do this, there is no association between your xml stream and what Internet Explorer shows : remember an html document is made of html tags (rendering semantics), not xml tags.
|
|
|
|
|
Is there a way to set the mime type on the IHTMLDocument2 object? I could have a ton of XML messages to display according to user selection -- having to save these as temp files or use one file as a temp writing space could be a pain. I could save some trouble if the mime type could be changed...is is possible?
|
|
|
|
|
I am aware of only two ways to associate a mime type to a document, in order to render the document in Internet Explorer :
- have a URI (local file, remote file) to play with, use Internet Explorer API to navigate to this URI
- have a web server generate the appropriate mimetype for you. In your case, the web server would simply redirect the stream, only adding the appropriate http header to it.
I am not aware of a successful way of changing the mimetype on-the-fly playing with the HTML Meta tag, of the form :
<META HTTP-EQUIV="Content-Type" CONTENT="text/html">
|
|
|
|
|
Yeah, playing around I see that the Type property is read-only. PutProperty on the AxWebBrowser doesn't seem to work either, but I can't find any docs on the valid data elements that can be passed to this method. Gotta love it when cool components like this go undocumented!
I think I'll just resort to your first suggestion : stream to a file then load that file in Navigate.
|
|
|
|
|
There some VB.NET (ouch) code (XMLViewer) on GotDotNet just posted last week doing what you want to do, it seems alot easier to work with VB.NET with these HTML interfaces.
I rated this article 2 by mistake. It deserves more. I wanted to get to the second page... - vjedlicka 3:33 25 Nov '02
|
|
|
|
|
clickety[^]
He loads the Xml content from a file, transforms it using a default xslt, and then writes the output html in the web browser.
The sample itself is of no help, unless m_mond writes local files.
The good news is that the .NET System.Xml namespace both can load a xml file or a stream. This provides the required tool.
|
|
|
|