|
Yeah I have several forms.
And I want to display a form at one time.
And I want to navigate from one form to other form on click event.
|
|
|
|
|
I could understand you very wrong, but you app. looks like a wizard like app. Can't you use a TabControl on a single form??
Anyway, double click the button in design view to generate the click event.
newFormName yourNextForm = new newFormname();
yourNextForm.Show();
this.Hide();
|
|
|
|
|
To show a form, create an instance of it, and call ShowDialog(). This is winforms 101, you should buy a book and work through it.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Hi Christian,
I think you got me wrong.
I have a number of predesigned forms already. That need navigation from one from to another form on click event.
Sangram
|
|
|
|
|
I want to know hoe to erite program to stay in system tray while it is running . Something like virus notification.
-- modified at 7:05 Wednesday 11th July, 2007
|
|
|
|
|
Drag a NotifyIcon control on your form. Select it with a single left mouse click and press the 'F1' key on your keyboard...
|
|
|
|
|
You will need NotifyIcon control
|
|
|
|
|
when ever ToolStripTextBox control got focus, i want to make a AutoCompleteStringCollection so that i can assign this collection to
ToolStripTextBox.AutoCompleteCustomSource property.
but the problem that i m facing while i'm typing in this ToolStripTextBox the Enter event raises again and again
can anyone explain me this behavior?
|
|
|
|
|
Has anyone managed to impliment NUnit testing on an Excel plugin project using Add-In Express ? I can write the tests, but I can't get an instance of Excel to work with.
Sorry if this is not the correct forum.
Johan Lombaard
Only two things are infinite, the universe and human stupidity, and I'm not sure about the former - Albert Einstein
|
|
|
|
|
Hi,
in my application (.NET 1.1, Windows.Forms) I have built a progress bar form, which is started in its own thread. It gets the progress information from the main thread and is thus successfully redrawn during the calculations - when it is kept on the top.
My problem refers to the window instances: I want the progress bar form to be always on top of the main form, but that seems not to be easy. It always shows up on top of the main form, when I define the main form as its owner, but then the progress-bar form is not redrawn during the calculation. At the moment I have it not defined as owned by the main window, but when I now bring another window on top and then want to change back to my, still calculating, application by activating it on the task-bar, the progress-bar window is invisible under the main window.
I hope, you understand my problem... What do I do wrong? Is it not allowed to define a form, which was created in an own thread, as owned by a form created in the main thread?
Thanks in advance,
Alex
|
|
|
|
|
Hello,
Have you tried the "TopMost" property of the Form?
All the best,
Martin
|
|
|
|
|
Thanks for the hint, I tried it and it works as expected, but that would be just a workaround, I think that the user will be annoyed by such a status window (I would). Is there another chance to make this window on top of my program´s windows?
|
|
|
|
|
Hello,
Maybe you like:
BringToFront();
SendToBack();
All the best,
Martin
|
|
|
|
|
Unfortunately this also does not work. With each progress update I execute:
this.BringToFront();
this.MainWindow.SendToBack();
this.Focus();
Console.WriteLine("Forcing to front..." + DateTime.Now.Ticks.ToString());
This is continually executed, but I still can only make the progress window visible by minimizing other windows
|
|
|
|
|
Hmm...
Would it be an option if you use ShowDialog from MainForm to show ProgressBarForm?
All the best,
Martin
|
|
|
|
|
I am already using ShowDialog from a special class I created to implement starting the second thread. But when I use the overload providing the "owner" I get the same result as when defining the owner "manually".
I´ll have to correct me: The problem which I encounter when I define the owner is that however the progress bar is redrawn, but the buttons on the progress form cannot be clicked (do not fire an event) as well as the whole form cannot be moved with the mouse, it sticks on the owner form and does not react.
|
|
|
|
|
Hi,
you dont need a separate thread to show a progress bar.
you could call Application.DoEvents() every time you update the progress, but I do not
recommend that, it is a hack/ugly/not descent/whatever.
You would be better of using another thread to do the lengthy calculation,
and let the main thread (aka GUI thread) show the progress bar; to get it on top,
make it a form owned by your main form.
To communicate from your lengthy calculation thread towards the progress bar, you would
need Control.Invoke if that thread holds the update-progress initiative. I often do it
the other way around: have a Forms.Timer periodically interrogate the calculating thread
about its progress (e.g. use a property of your job object) and update the progress bar.
|
|
|
|
|
|
Hm, this class is Framework 3.0 specific.
|
|
|
|
|
Nope, it was added in .NET 2.0.
|
|
|
|
|
OK, still too new
|
|
|
|
|
My question is based on functionality in Masked Textbox control which is available only in .Net framework 2.0 onwards. I want the kind of functionality provided by MaskedTextbox control but I can't use this control as I'm currently working on framework 1.1.
So I have decided to make one for me on my own. I derived the control from Text box. I was able to implement Mask dialog and validations but stuck up with text property implementation of control.
For the Masked Textbox, if you implement telephone no. mask with format (___)___-____, then text property value initially will be blank. But on the form, Masked TextBox text will show format i.e. "(___)___-____". Also, if I write 333 in property grid for text property then in property Grid I will be able to see value as "333" while in the Control on the form it will display me a text like "(333)___-____". So in a way two different values for the same text property in property grid and control. So this is bit confusing and don't know how to implement this thing in a same way as provided by Masked Text box.
I tried to implement this by overriding the text property and giving different implementation for design time and run time. But its not helping me.
Can anyone help me by providing some ideas on how to do above things. I hope I'm clear with my question. If reading above, you are not clear about the question pls write back to me or check the working of Masked Textbox control for better understanding.
Regards,
KC
|
|
|
|
|
Hello,
I think in that case only a workaround does the trick!
Because Text property of TextBox seems to be special case.
Therefore I would use an additional "newText" property and hide the "Text" property.
private string _newText="";
[DefaultValue("")]
public string NewText
{
get
{
return _newText;
}
set
{
if(value!=_newText)
{
_newText = value;
Text = _newText+" I'm formated";
}
}
}
[Browsable(false)]
public new string Text
{
get
{
return base.Text;
}
set
{
if(value!=base.Text)
{
base.Text = value;
}
}
}
Hope it helps!
All the best,
Martin
|
|
|
|
|
Hi,
I'm starting to read up on serializing my classes using XML, seems really useful but depending on which article I read opinions vary on whether ArrayLists can be serialized. Does anyone know for sure whether they can or can not? It seems as though it changed from 1.1 to 2.0, but I cant tell for sure.
Thanks
|
|
|
|
|
It has changed from .NET 1.1 to .NET 2.0, as far as I know you can serialize List<T> in .NET 2.0
Another method is the mark the list with the [XmlElement] attribute, to make sure it gets serialized correctly.
WM.
What about weapons of mass-construction?
"What? Its an Apple MacBook Pro. They are sexy!" - Paul Watson
My blog
|
|
|
|