|
Thank you nelsonpaixao
Yest I need a complex control to provide address searching
A feew combo, textbox etc
Not a simple button
I will continue to investigate how to do it well
|
|
|
|
|
You don't really need a tutorial, just have a go!
1. Create a test winforms app, right click and choose Add|User Control.
2. Handle any events from the controls just like you would in a form.
3. If you need to override any of the built in methods so it reacts externally in a different way then use the override keyword to override any of the base's virtual methods.
4. You can create your own properties, methods and events. If any conflict with the base's ones and they're not overridable, use the new keyword or rename your own to avoid the conflict.
That's about it really. By deriving from UserControl (or Control or Component) MS have already done the hard work for you.
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia)
|
|
|
|
|
I've got a menu form , in witch i have 4 choises to make , each reprezented by another form .
I'm willing to close the menu form when i chose to open another form . And then also to be able to close the selected form and to re-run the menu form ,if i wish .
I want to CLOSE it , not to hide it or anything .. I've been google'ing it , but i've got no clue , nothing i try don't seem to work .
Please help ..
|
|
|
|
|
Why don't you just look into an MDI environment. The switch for a WinForms to go to MDI is fairly simple.
Regards,
Thomas Stockwell
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
Visit my Blog
|
|
|
|
|
You need to put your main() method and overall control logic in a separate controller class. Then ControllerClass creates a MenuForm . When the user clicks the Form1 Button on MenuForm , instead of opening Form1 directly, it notifies ControllerClass . ControllerClass then closes MenuForm and Creates Form1 . Likewise, the OnClosing event for Form1 signals the fact to ControllerClass which then either opens a new MenuForm or terminates the application.
Today's lesson is brought to you by the word "niggardly". Remember kids, don't attribute to racism what can be explained by Scandinavian language roots.
-- Robert Royall
|
|
|
|
|
dan neely , i officially love you ! thanx !!
|
|
|
|
|
|
I see , but my application is not chat-like , and i decided that the other idea is more suitabble . My deisgn might be wrong , i'm still a beginner , so i'll consider this idea for the future , just in case
p.s. i already know how to use delegates , don't offend me man :p
Thank you all !
|
|
|
|
|
listen,
i dont have any degree on computer programming so i don´t really know the learning path, just telling that because i started with the idea of creating many form and droped it. After i started to use that usercontrols method and i needed to learn about delegates.
Besides that try also mdi parent child forms, not just for chats use like said, because parent form ownes child forms you don´t need that "public" stuff or delegates to call the form.
There is a good article here about that, use the keywords i said before, i think is an articles that as pictures of a cartoon; heidi.
Sorry i dont remember the author i think is the best article mdi forms, so search it.
nelsonpaixao@yahoo.com.br
trying to help & get help
modified on Friday, October 3, 2008 7:19 PM
|
|
|
|
|
I am loading a html pages in my first webbrowser control and right after that I am loading another webbrowser control which loads the same pages as the first one already loaded. Everythings seems ok but sometimes all of sudden documents weren't loaded and in 1st webbrowser control and i get the html default error page. so how can i load only the 2nd webbrowser control in the background thread once the first one has been completed loaded.
Thanks
|
|
|
|
|
I have been trying to detect when the power button has been pressed on a system (winXP) however so far i have been unsuccessful. I have tried useing WMI and monitoring the Win32_PowerManagementEvent but i only seem to be able to pick up a battery insertion/removal on a laptop and on a desktop it doesn't pick up anything. Is it actually possible to detect the button press and if so can some one point me in the direction of how to do it?
Thanks for any assistance offered,
P
|
|
|
|
|
Well, no. You could make your application detect an abnormal program exit by setting a value in a data file when the program starts, and then un-setting it when the program exists normally, and performing a specific task depending on the presence/absence of that setting. Consider that the user could just hit the hard reset button as well, so technically, the machine has been turned off and then back on.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
Thanks for your reply, the system is used a vehicle pc, the psu is connected to the power switch so when the engine is switched off the system is shut down to prevent flattening the battery. The reason i want to do this is to finish off the tasks being performed before the system shuts off
if this is not possible what alternatives are available?
thanks,
P
|
|
|
|
|
|
A side note, if you do anything affecting the shutdown sequence make sure to test it thoroughly. If you mess something up in XP (or prior) you can halt the standby/shutdown and drain the battery inadvertently. You also need to do whatever you're doing quickly. To avoid the hot laptop bag problem vista only gives apps a few seconds to wrap things up before going into standby even if an app hasn't OKed doing so.
|
|
|
|
|
You can still do what you want by putting a program in the startup folder that will verify the settings when the system reboots.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
|
when you press power button you will not have the power to detect anything
nelsonpaixao@yahoo.com.br
trying to help & get help
|
|
|
|
|
Thank you for the help, i have been trying out the system events and it seems to fulfil my requirements
p
|
|
|
|
|
Hi,
My name is Sandeep and I am developing an application in C# .NET, which talks to a piece of hardware. This hardware is called Loop Tester and it is connected to series (loop) of fire detector, smoke detector, etc. I am informed by the Line manager that there is no need to study the hardware. What is needed at the initial stage is to develop a program which talks to piece of hardware, connected through RS232, which forms the communication base of the project. After successfully developing it, I can write the remaining application i.e. add functionalities. I am confused as to how i can start writing the program. I have gone through the article by Tapan Dantre and got some idea. Can anybody help me out?
|
|
|
|
|
You can use SerialPort class in net framework for communicating with devices that are connected to serial port.
|
|
|
|
|
Thanks for your quick reply.
I do have a general idea of how to use SerialPort component for communicating with the deveices that are connected to serial port, but my problem is how to initiate the hardware to perform some function and then read the output from the hardware (loop tester).
I have few lines of code written in VB6, which talk to the hardware with which fire detectors are connected in loop. This piece of code initiates the hardware to detect the numbers of devices in loop and then gives them all address (in hexadecimal).
If you have some time from your busy schedule and are willing to view the code, I am ready to send you the code and output screen shots so that you have an idea of what i want to write exactly in C#. Let me know if you are interested and forward me your email address so that i can mail you the code .
Thanks
|
|
|
|
|
I'm not sure what else to say, as RS232 is just a physical communication protocol, which is layer one of the OSI model. The format of the data sent and received is per device, as well as it would be you who needs to implement layer two though seven.
To help with layer two through four use a state machine in your back end wrapped around the .NET serial port class. It is good to be safe because serial communication can be prone to transmission errors that can soft lock your application.
|
|
|
|
|
Thanks for your quick reply.
I do have a general idea of how to use SerialPort component for communicating with the deveices that are connected to serial port, but my problem is how to initiate the hardware to perform some function and then read the output from the hardware (loop tester).
I have few lines of code written in VB6, which talk to the hardware with which fire detectors are connected in loop. This piece of code initiates the hardware to detect the numbers of devices in loop and then gives them all address (in hexadecimal).
If you have some time from your busy schedule and are willing to view the code, I am ready to send you the code and output screen shots so that you have an idea of what i want to write exactly in C#. Let me know if you are interested and forward me your email address so that i can mail you the code .
Thanks
|
|
|
|
|
Using the WMI code creator, which namespace, class and property do I select to get the printer connections in the system?
Thanks
|
|
|
|