|
So thats the problem, yeah im trying to open it from a button click within the form.
Would i be able to use a 'goto' and put the application.run somewhere else?
public void buttonOptn_Click(object sender, System.EventArgs e)
{
Application.Run (new ChangeText());
}
|
|
|
|
|
You needn't (and shouldn't) do that. If you want the form to be opened to be modal (ie that form takes the focus and you won't be able to go to the main form until you clost it), simply do
MyNewForm f = new MyNewForm();
f.ShowDialog(this);
If you want it to modeless, instead of calling ShowDialog , just call Show()
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
dear all
i need help in how to play flash in C# application
thz all
|
|
|
|
|
The easiest way is to embed a web browser instance inside your app..
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
there's an easier way. If you go to your toolbox add in manager, and search "flash player", there is a ready made component by macromedia you can simply check to add to your toolbox. Drag it to your form, and there is a property that you tell it to navigate to a url or local file to play. I'm not sure exactly what the "flash player" is called, but it is something like that. Hope this helps.
|
|
|
|
|
its helpfull
many many many thx
|
|
|
|
|
hi,
any method to add versioning information automatically in .NET? or, any method to place the build date/time in the source file then i can read it back in the binary?
thanks,
jim
|
|
|
|
|
No, but you can easily read the PE filetimestamp using the following.
DateTime compiletime = new DateTime(1970, 1,1).AddSeconds(BitConverter.ToUInt32(data, 136));
where data is a byte[] representing the PE file (assembly).
xacc-ide 0.0.15 now with C#, MSIL, C, XML, ASP.NET, Nemerle, MyXaml and HLSL coloring - Screenshots
|
|
|
|
|
|
yes, this is great! thanks!!!
|
|
|
|
|
Hi
Does anyone knows if there is any ICQ client on C# under project?
Thanks
|
|
|
|
|
|
I'm doing one, and the ICQ library (I'm calling in NOscar, similar to Java's JOscar) is already working.
I did not upload it to my homepage (German, www.danielgrunwald.de) yet, but if you want to take a look at it, send me an email.
|
|
|
|
|
private void printDocument1_PrintPage(object sender, System.Drawing.Printing.PrintPageEventArgs e)<br />
{<br />
PaintEventArgs myPaintArgs = new PaintEventArgs (e.Graphics, new Rectangle(0,0,datagrid1.Width,datagrid1.Height));<br />
this.InvokePaint(dg, myPaintArgs);<br />
}
this is the coding i used to print out datagrid, the X and Y is set to 0 and 0, the datagrid print out correctly at exactly upper left corner of the paper.
then i modify the coding.
private void printDocument1_PrintPage(object sender, System.Drawing.Printing.PrintPageEventArgs e)<br />
{<br />
PaintEventArgs myPaintArgs = new PaintEventArgs (e.Graphics, new Rectangle(50,50,datagrid1.Width,datagrid1.Height));<br />
this.InvokePaint(dg, myPaintArgs);<br />
}
i change the cordinates to 50,50, but y the datagrid still print at the same position for cordinates 0,0??i do not wan the datagrid to be printed at that position!anyone can help me out with this??Thz!
|
|
|
|
|
You could create a bitmap with the needed dimension, create a Graphics object for it, paint the grid to this bitmap and finally draw the bitmap onto the page:
Bitmap b = new Bitmap(datagrid1.Width,datagrid1.Height);
using (Graphics bg = GraphicsFromImage(b)) {
PaintEventArgs myPaintArgs = new PaintEventArgs (bg , new Rectangle(0,0,datagrid1.Width,datagrid1.Height));
this.InvokePaint(dg, myPaintArgs);
}
e.Graphics.DrawImageUnscaled(b, 50, 50);
|
|
|
|
|
thz man!the coding works for me.. but there is another problem, my datagrid has been loaded with a datatable contains 31 records, under screen resolution of 1024*768, the screen is able to show and print out all the records, but if user change screen resolution to 800*600, the records that can show in one screen is only 21 records, the rest of the records needed to be scroll down to view, then the datagrid printed out only contains 21 records that can be shown on the screen... wat should i do??
|
|
|
|
|
I´m writing a little library, where my main object MainObject contains some properties and a collection of ElementBase (abstract) objects.
I actually have two derived classes from ElementBase , each of which has properties, some common to the base class, others specific to the type.
I would like to save this MainObject to an XML with all of its elements, according to:
- Smallest file size possible. I don´t need uncessesary properties, only the important ones (my properties, not those from base clasess)
- Backward compatibily. I want a new version to read old version successfully and the other way around. Properties not present should be defaulted, and newer properties ignored.
- Support for different types of ElementBase-derivatives, both existing and future.
My idea of the XML file was something like this:
<MainObject property1="x" property2="y">
<Element type="DerivedElement1">
<property1>value</property1>
</element>
<Element type="DerivedElement2">
<OtherProperty>value</OtherProperty>
</element>
<MainObject> So, the first question, what do you think? is this flexible enough?
And the second question, how do I write the XML to the file? I've been checking the System.Xml namespace and there are a lot of things in there. I could use an XmlTextWriter or an XmlDocument . I saw also XmlDataDocument but I believe it is for reading/writing a DataSet to XML, am I right?
I don´t really need code samples (they sure can help) but just an pointer on what's the easiest, yet powerful enough, way of achieving what I want.
{EDIT: and of course, how would I read the file to recreate the objects? )
Thanks in advance,
-- LuisR
Luis Alonso Ramos
Intelectix - Chihuahua, Mexico
Not much here: My CP Blog!
|
|
|
|
|
I'd use the XMLTextWriter, seeing as you're creating the entire document, rather than loading/manipulating one.
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
hi Luis,
I'd second Christian's advice. XmlTextWriter is fastest way how to write XML document. It's quite easy to use as well.
Luis Alonso Ramos wrote:
I saw also XmlDataDocument but I believe it is for reading/writing a DataSet to XML, am I right?
yeah.
Luis Alonso Ramos wrote:
and of course, how would I read the file to recreate the objects?
with XmlTextReader
OTOH, why not to use Serialization[^]? I belive that you can set (with attibutes) what should be serialized into XML and what shouldn't. However I don't know how it would fit into backward compatibility concept. (maybe there isn't problem, I really don't know)
David
Never forget: "Stay kul and happy" (I.A.)
David's thoughts / dnhsoftware.org / MyHTMLTidy
|
|
|
|
|
dnh wrote:
why not to use Serialization[^]? I belive that you can set (with attibutes) what should be serialized into XML and what shouldn't. However I don't know how it would fit into backward compatibility concept.
Yeah, I had thought about adding a Serializable attribute to the classes, but I don't want every property serialized (especially those from base classes which I can't modify.) Also, for example, I have a Font object, and I want only to save font family, size, not all of it.
Thanks,
-- LuisR
Luis Alonso Ramos
Intelectix - Chihuahua, Mexico
Not much here: My CP Blog!
|
|
|
|
|
First I would like to thank you for taking your time to read my questions... I really need some helps here.
Bascially I want to write a program in which users can design their layouts.
So let us say I got a textbox, and I want it be to able to be dragged around the main window or resize it... and i want to have like a rectangle box around it when I click on it..
How am I going to start?
I tried using the events mouseUp, mouseDown to move the objects.. but I cant find out how to draw a rectangle around the textbox or how to resize it..
could you please help me out? Thank you so much.
Elapid For The Win
|
|
|
|
|
Ooops - I thought I was in C++ land for a moment....
Your form has a paint event, override it to do any drawing you might want to do on the screen.
Controls have a Location and a Size property. You need to change those to move or resize the controls.
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
how do i draw a rectangle thinige around the textbox? you know like in Visual Studio, when you click on an object, there are like 6 small squares at the corners of an object which then let you resize that object..
Elapid For The Win
|
|
|
|
|
Like I said, in OnPaint. You need to draw outside the bounds of the control, so the control can't draw it. You need to create hotspots, and store them in an array. Use them to draw the little boxes, and also to check when someone clicks if they are inside one.
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
Thank you Christian.
I will work on it
Elapid For The Win
|
|
|
|
|