|
Hello,
Im trying to make a little application to have a console application open and say 1 for addition 2 for multiplication, etc.
i do not know how to make a menu for a console where if i type 1 i need the console to read it and show the layout for the addition.
please help!
-Steven
krtek16@hotmail.com
p.s. i wrote it like this (addition example)
{
console.writeline("please enter first number to add");
string sNumber1Add;
sNumber1Add = console.readline();
double dNumber1;
dNumber1 = Convert.ToDouble(sNumber1Add);
console.writeline("please enter second number to add");
string sNumber2Add;
sNumber2Add = console.readline();
double dNumber2;
dNumber2 = Convert.ToDouble(sNumber2Add);
//add together
double dAnswerAdd;
dAnswerAdd = dNumber1Add + dNumber2Add;
console.writeline("The answer is + "
dAnswerAdd);
console.writeline("press enter to terminate");
console.read();
}
|
|
|
|
|
i didn´t practiced doing that but i bet it´s easy
did you tryied using routines???
...void mymenu()
{
console.writeline("*********************");
console.writeline("*****my program******");
console.writeline("*********************");
console.writeline("1 - item");
console.writeline("2 - item");
console.writeline("3 - item");
console.writeline("4 - exit");
console.writeline("select(1-4)");
...validations whatever!!!
}
good luck
nelsonpaixao@yahoo.com.br
trying to help & get help
|
|
|
|
|
Hello,
i am using VS 2003 and/or VS 2005
In C# i want to the accomplish following task:
i want to have a user control that supports multiple checkboxes in it.
the number of checkboxes and the text of these boxes should be dynamically changed.
Depending on the layout of the user control these checkboxes should be aligned horizontally or vertically.
i.e. I say control shall have 8 checkboxes and each checkbox shall have its on descriptive Text.
then these checkboxes should layout themselves left to right or top to bottom depending on ratio height to width of the user control.
I managed to build that user control, but i dont really know where to add / delete the checkboxes
in design time.
At the moment, i create the array that holds the checkboxes in the constructor (both runtime and design time).
Depending on the number of desired checkboxes, which is set via a property i dynamically grow or shrink this array.
I dont know where i should add these checkboxes to the usercontrol. When i add them in the Paint method, i have to delete them before i add them new.
Maybe someone can help me with an easy example.
Greetings Wolfgang
|
|
|
|
|
I have not tried it, but you could use
Controls.Add(...) Alex
|
|
|
|
|
Hi Alex,
I know how to add a control.
It works as it should, but I think its no good to add controls in the paint method....
Greetings
Wolfgang
|
|
|
|
|
I still don't really understand what you want.
Why do you add the checkboxes in the Paint method?
Why don't you just add them in the property where you set
the number of checkboxes?
When you grow or shrink the array, you can also
create the new checkboxes and add these to your control
via Controls.Add(...) .
When a String in your property "Description Text" is
changed, then the Text property of your checkbox
should be changed.
If this was not what you wanted to do, then please give
us a code section...
Alex
|
|
|
|
|
Are you looking for FlowLayoutPanel ?
"If you had to identify, in one word, the reason why the human race has not achieved, and never will achieve, its full potential, that word would be 'meetings'." - Dave Barry
|
|
|
|
|
No!
I want to know how to handle the task of adding and removing a Control from a user control
when the developper changes the number of controls to display.
i.e.
in design mode the user control should reflect the correct number of checkboxes when the developper changes the property
"number of checkboxes". The descriptions of the checkboxes come from another property "Description Text".
the property editor correctly changes the number of strings in property "Description Text", but
i need to know where in my code of my usercontrol i add the code to add / remove these checkboxes.
|
|
|
|
|
Hi everybody.
I have been developing mdi-applications during a long period. And during this period I have a little unpleasant thing. The thing is in following : for instance we have MDI Parent and Child form and both of them have Context Menu. When we call child form, its Context Menu moves to Context Menu of the Parent Form.
My question is : is it possible to divide Child's Menu from the Parent's Menu?
Thanks.
|
|
|
|
|
Hello Sir,
How can we mute & Unmute only Audio while Recording video. Please send me a code example.
Regards,
Balaji.V
|
|
|
|
|
Created usercontrol by taking group box and few controls like textbox, buttons etc. inside the group box. And when I check preview of the usercontrol , it is working correctly.
But when I am trying to use it in the application, few controls from group box are flowing out or say the location of few controls in that group box is changed.
Please help me if any one knows about this.
Thanks in advance
|
|
|
|
|
Have you set the Anchor property for that controls?
|
|
|
|
|
ya I have set anchor property for few controls as left,top.
One more observation is like if i am using menustrip in my application only then the control's alignment in usercontrol is changing.
If I am using it in application without any menustrip then the alignment is correct.
I have checked the control's size even , there is a space to expand if i am using it in the application where i am using menustrip.
Details:
I am calling tabcontrol programmatically in a form containing menustrip. At the same time i am calling usercontrol on the tab page.
I have used usercontrol for testing purpose in different applications, in few applications it is working and in few its not.
Please tell me if I need to set any property or ny details u want me to check.
thank u
modified on Monday, September 8, 2008 3:16 AM
|
|
|
|
|
Hey got it.
Due to the name of tab control page, alignment of controls in user control was changing.
Because, I have selected the font as "verdana" & that too "bold" due to that the alignment was changing.
Now it got solved after changing it to normal.
It took 2 days to get this point. ahh but solved.
bye
|
|
|
|
|
I've got a usercontrol that uses quite a few other usercontrols putting it together. I only want the "complete" usercontrol to be visible in the toolbar and not the pieces that make it up. How do I hide the parts I want to hide and still be able to use them to build my control? I make the final control by dragging the other items from the toolbar. After I am finished all of my controls are visible in the toolbar and I don't want that. Help?!
I am using Visual Studio 2008 Express - C#
|
|
|
|
|
I think you can give those controls you want to hide an attribute
[System.ComponentModel.ToolboxItem(false)]
|
|
|
|
|
I designed a user control to be a container for a layout. The control itself uses three other usercontrols for tabs and title and such. My control shows up in the toolbar and I can drag it to the form in the designer and set all of it's options but this usercontrol was designed to hold one or more usercontrols of any kind. I can add any item programmatically but if I drag a control over it in the designer it will not add the control I'm dragging to my usercontrol after I drop it on it. Any ideas how this functionality can be added for the designer?
I am using Visual Studio 2008 Express - C#
modified on Thursday, September 4, 2008 11:46 PM
|
|
|
|
|
I had that problem myself and I'm not sure what best to do. Maybe there is a trick we both don't know.
If you don't have a user control, but a control derived from Panel, you can drop controls onto it at design time and they will be added. Also I think if you have a Panel on your user control, you can drop controls onto the Panel. So maybe you can just fill your user control with a Panel and go from there.
|
|
|
|
|
|
Hello everyone,
I'm currently involved in developping a WinForm application. I use VB.NET as a language and use the 2.0 .NET framework
One of my forms only contains a WebBrowser component. That form is launched by another form which passes him an URL for the WebBrowser to naviguate towards.
The webpage aimed by the URL has an applet (or so I think it is) allowing to see a digitalised document (such as a hand written letter or a printed form).
When the form is closed, the exectution of the instruction line :
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
...
MyBase.Dispose(disposing)
...
End Sub
lasts for several minutes. Within that period of time, the entire software is frozen and will only be available to the user when the instruction is passed.
I asked to my peers how to hanlde that behavior and they adviced me to come up with a solution based on asynchronous execution (I am no expert in that domain of IT programming).
So my question is: assuming that it is the correct way, which part of my code am I supposed to wrap with a thread ? Is it the form containing the WebBrowser with the heavy finalysing ? Or maybe just the finalisation itself (I must say that I already tried that and it changed nothing)
Thanks in advance for you help and accept my apologizes for my writting but english isn't my native language.
|
|
|
|
|
Hi,
I was wondering if its possible to make a File Dialog (Open/Save as) become the child window of a parent form and be fully "contained and bounded" in it. I can`t find any straight-forward way to do this, like Controls.Add or anything since they inherit from Component class.
I also tried calling the Win32 SetParent function but it has no effect.
Any suggestions please ?
Thanks in advance.
|
|
|
|
|
hi
yes is possible but: are you expert in API calls, i. e. WndProc, Farprocs, Hookprocs, HookFunctions ans so on. if not, is better you call the standard file dialog in the .net framework.
regards
|
|
|
|
|
Hi Joe,
Yes i`m familiar with Win32 API .Can u tell me how using HookProcs and WndProcs will help ?
|
|
|
|
|
hooks are not easy to use. look in the msdn help, set the filter to platform SDK an search for OPENFILENAME.
good luck 
|
|
|
|
|
Dear Sir,
I am developping one windows Application, In that i am working on Adio Mute & TrackBar Controls
I am using Check bOx for MUte functionality, TrackBar for Increase or Decrease the volume. For this Iam using Mixer Object. I Added the WaveLib.AudioMixer; Library to my project.
My Reqirement:
1. when i Check the Mute Checck Box then Audio should not be recorded while recording,
2. when i Uncheck the check box then Default volume will set. ( tracker bar volume).
right now i am using this Code but it is not working.
Mixers mix = new Mixers();
if (Settings.Default.Mute == true)// here i have setting page by default the mute is set to False.
{
//Mixer mix = new Mixer(MixerType.Recording);
mix.Recording.Lines.GetMixerFirstLineByComponentType(MIXERLINE_COMPONENTTYPE.SRC_MICROPHONE).Mute = true;
}
else
{
if (mix.Recording.Lines.GetMixerFirstLineByComponentType(MIXERLINE_COMPONENTTYPE.SRC_MICROPHONE).Mute)
{
mix.Recording.Lines.GetMixerFirstLineByComponentType(MIXERLINE_COMPONENTTYPE.SRC_MICROPHONE).Mute = false;
}
mix.Recording.Lines.GetMixerFirstLineByComponentType(MIXERLINE_COMPONENTTYPE.SRC_MICROPHONE).Volume
=CurrentUser.Mute);
//Encoder.set_RecordingMute(0, true);
}
please currect my code.
|
|
|
|