|
I didn't say I was a genius. I *did* answer your question.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Hi!
i have to use media player control to play video clips. I have found no control for it. Actually i dont want to code in asp.So can anyone help me in using control and its coding in C#.
waiting for urgent reply.
Thanx
|
|
|
|
|
If you're using ASP.NET, then you need to embedd it using HTML. C# won't help you at all, as the C# code runs on the server, not the client.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Please, help me:
I need to draw an ellipse, which parameters must be stablished in textboxes, and when pressing on a button can draw an ellipse (or another geometric) with the parameters of the textboxes.
Also, if I change some parameter in some textbox, and then by pressing again on the button, the ellipse should change according to the new parameters.
Thank you very much.
Saludos, Giovanni
|
|
|
|
|
You need to add a paint handler, that shuold check your textboxes, using int.TryParse to see if they contain numbers. If they do, use them to draw your ellipse, using the Graphics object passed in on the event args.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
use C#+asp.net+Sql Server2000 all sourcecode opened
good learn tools
www.drpsky.com
your friend
|
|
|
|
|
If you want to advertise your site, contact the sys admin for pricing on advertising.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Hello, recently I have been toying around with the System.Drawing namespace. But it does not seem that it ever updates even if it is in an onPaint event handler.
This is all the code i put in the entire class. I changed nothing else.
public partial class Form1 : Form
{
int Cheese = 1;
public Form1()
{
InitializeComponent();
}
private void Form1_Paint(object sender, PaintEventArgs e)
{
Graphics MyGraphics = e.Graphics;
Brush MyBrush = Brushes.Aqua;
Font MyFont = new Font(FontFamily.GenericSansSerif, 12);
MyGraphics.DrawString(System.Convert.ToString(Cheese), MyFont, MyBrush, 10, 10);
Cheese = Cheese + 1;
}
}
What should i be doing?
(The output is constantly "1")
Thanks.
|
|
|
|
|
Call Invalidate() to force a paint event, in a button handler, and it will work.
Use Cheese.ToString() instead of Convert.ToString. Or " " + Cheese, will also work.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
It's because the window only paints itself once unless there's reason to repaint it again. For example, the number should increase if you hide the window (maybe minimize it), then reshow the window. It will have repainted a number of times.
FYI, you can force a paint in code using the Invalidate() method of the Form class. Invalidate tells the operating system that a repaint is needed, and it will repaint at the next opportunity.
|
|
|
|
|
Hi,
I am developing windows mobile application using vs05 C#.NET..
How to install exe file with icon/logo to Windows Mobile programs collection or main menu?
I want to put my exe file icon in Start/ Programs/ ...Directly can i click the icon in programs? please help me...I am new in the field.
Thanks in advance..
Bye
|
|
|
|
|
Can I please help to know, how to pass a reference from your command class to a windows user ?
Can any body give me a code?
Thanks
Kedie
|
|
|
|
|
What do you mean ? Any reference type ( i.e. a class ) is passed by reference already. What is your 'command class' ? How do you want to 'pass a reference to a windows user' ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
This may not help but if you mean passing arguments by reference then I found I had to put the keyword "ref" in front of the argument - both in the definition and the use. i.e. MyFunc(ref int argument) & MyRef(ref argument).
I hope this is of some help.
Ted Edwards
|
|
|
|
|
Hi,
I am using visual studio team suite 2005 for developing a windows app in C#
I have 2 forms Form1 and Form2
I have a button control on Form1 called Bttn. In the click event of the button i am writing the following code so that i close the current Form i.e. Form1 and want to show Form2.
MY code::
Form1 f = new Form1();
f.Close();
Form2 r = new Form2();
r.Visible = true;
but with this i have 2 problems
1) Form1 is not closed and Form2 is open i.e. both forms are opened (f.close() is not working)
2) After running the app, when i close Form1 Strangely Form2 is also closed.
but however if i close Form2 only that form2 is closed as expected. I am not implementing any mdi forms concept.
Any help is appreciated
thanks red
yojimbo
|
|
|
|
|
red60mans wrote: Form1 f = new Form1();
f.Close();
You've never shown this form, Close will do nothing.
red60mans wrote: Form2 r = new Form2();
r.Visible = true;
This doesn't work, you need to call ShowDialog(), or Show() for a modeless form.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Form1 is shown from from Main as follows
main()
{
Application.Run(new Form1());
}
buttonClick event on form1
{
Form1 f = new Form1();
f.Close();
Form2 r = new Form2();
r.Visible = true;
)
This ia modeless form and also am not using any mdi forms concept
I tried r.show() also
its not working
yojimbo
|
|
|
|
|
How many times are you creating a Form1 instance ?
Luc Pattyn
|
|
|
|
|
red60mans wrote: Application.Run(new Form1());
This is irrelevant
red60mans wrote: Form1 f = new Form1();
f.Close();
If you want to close the current instance of Form1, call this.Close(). Creating a new instance of form1 has no bearing on any other instance that exists.
red60mans wrote: Form2 r = new Form2();
r.Visible = true;
This plain won't work, as I said.
red60mans wrote: This ia modeless form
Your main form cannot be modeless.
red60mans wrote: I tried r.show() also
its not working
Define 'not working' ? If you call Show(), you should make your form a member variable. Only forms for which you call 'showdialog' should be created in the scope of a method.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
I should add, your main form must continue to exist, so you need to hide it, if that's what you want, not close it. That will close your program. Also, you may want to define the two forms as controls, then you can hide/show controls if you want a UI that jumps between two forms.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
i am a newbie so bear with me.
Form1::
public void Bttn_Click(object sender, EventArgs e)
{
Form2 r = new Form2();
r.Show();
this.Hide();
}
This works fine for this form ie Form1
as u have said that it is not necessary to create one more instance of Form1 and rather use this.hide().
but i have one more event in Form2 called Form2Button_click event where i need to hide form2 and show Form1. Now if i create a Form1 instance as shown below i will have two instances of Form1. One which was hidden using previous code and Second instance in the Form2 button click event.
public Form2Button_click(object sender, EventArgs e)
{
Form1 newInstanceForm1 = new Form1();
newInstanceForm1 .Show();
this.Hide();
}
1)How do i access Form1 from Form2 without creating a new instance of Form1??
or how do i get hold of the original Form1 instance from Form2
2)You have also said that it is better to create two Forms as controls......where do i create those controls??
i have only two forms Form1 being the main form. So do i need to create these forms as controls in main()??
i am just confused
Any help is appreciated,
yojimbo
|
|
|
|
|
The easiest way of doing that is to modify your Form2 constructor to take a Form1 reference, that you then keep until you need it.
Form1:
public void Bttn_Click(object sender, EventArgs e)
{
Form2 r = new Form2(this);
r.Show();
this.Hide();
} Form2:
private Form1 myf1;
public Form2(Form1 f1)
{
...
myf1 = f1;
}
public Form2Button_click(object sender, EventArgs e)
{
myf1.Show();
this.Hide();
}
Internet - the worlds biggest dictionary
|
|
|
|
|
red60mans wrote: How do i access Form1 from Form2 without creating a new instance of Form1??
You can't create a new instance, it won't access the old one. The Application object does have a collection of open forms, you could find it there. You could also pass it in, as has been suggested. You could use a delegate to make Form2 tell form1 to wake up. Your best bet IMO is still to create both forms as controls, and embedd them on the one form.
red60mans wrote: where do i create those controls??
You create new user controls, and design them the same as you would a form. Then you put both controls on your form, and write some plumbing code to make sure one or the other is always visible.
red60mans wrote: So do i need to create these forms as controls in main()??
You'd create them as controls in the designer, and then add them to your form
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
I am having trouble writing a C program for the space elevator problem. If any of you know how to solve this problem please write me the codes so I could check them against my codes.
Thanks
|
|
|
|
|
Uhhhh..."The Space Elevator Problem"? To what do you refer?? Also, if you're looking for code for such a specific problem, your best source would be Google.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|