To make your application run when Windows starts, put it into the Startup folder. I think there are registry keys you can add it to. To make the tray icon, use the NotifyIcon component, and simply show the form with the calendar upon the double click of the aforementioned component. You can actually find a calendar-like component in the .Net Framework - I think it's something like DateTimePicker. Inherit from that, link it to a collection of dates, and you have your calendar. To make the form display on the right hand side of the desktop, set the Dock property of the form to Right
I see. You could theoretically put some code in the Resize event handler to adjust the size and location of the form. Use these equations:
Form.X = Screen.Width - Form.Width
Form.Y = 0
Form.Height = Screen.Height
Form.Width can be anything you want it to be. This will look best if you set the BorderStyle to None
But i want to bound the calender application object added to Windows Desktop Object in such a way that it behave like icons on desktop. so that when all applications in Taskbar are minimized my application still will be visible on desktop
Basic thing i want is access to desktop and put my calender object into that.
Then what you may want is to create a gadget for the Sidebar. This will limit your options to Vista. Alternatively, you could look into shell integration (perhaps a knowledge of COM would help you here) or the ShowInTaskbar property of a form
You can save in one setting entry only one value. From what you are doing, you are trying to save 3 different locations to one setting entry(SavedSetting3) which is wrong. In each loop execution you are overwriting the last set value and hence, the value which is last written (button3 I guess) is the one which is saved. You will need to create 3 different setting's entry to save each of the buttons location.
Your problem lies with the File.Create method. It returns a FileStream instantiation. Until you close the FileStream, you cannot read the file without requesting different access to it. Try something like this
Stream bookStream = new FileStream("books.txt", FileMode.OpenOrCreate);
using(StreamReader booksReader = new StreamReader(bookStream))
//Do what you want with booksReader here, the using block will automatically close the streams to avoid memory leaks
The trick here is creating a new FileStream with FileMode.OpenOrCreate. If the file exists, it is opened; if it doesn't exist, it is created and then opened. If you want to check whether the file is empty (it's pointless reading from an empty file), check whether bookStream.Length is equal to zero. This will also tell you if the file is newly created because the newly created file will be empty
I have written code for client server communication using Tcp and Udp..It works well...I have created a function for the client and called the function from the form1.cs in VS.NET...Now this acts as the client and the server is a separate code..
Now i want both the client and server to communicate...
With a button click i want the message from the client to be sent to the server...So i used a ListBox control in the form...with a button click im able to send message to the server through the socket connection..
Server runs in the console...I am able to send message from the tool i.e client to the console...Once the server the receives the message i require the server to send a message back to the client as an acknowledgement (i.e. the message must be displayed to the listbox control in the form) How do i do this?Please help me out with this.thanks for any help in advance..
You need to add a ListBox control to your form. listBox1 will then refer to that control, and add whatever you call the Add method with as arguments. Be careful though; it will add the items, but displays the ToString representation of them. If it's your own class, override the method to provide your own implementation of ToString
I have a form1.cs which has a listBox control...
I have defined the server class in another file using(File->
New->File option)but in the same project...So im not able to
If i do so it gives me an error