|
I know somebody just posted some code, that didn't quite make much sense... but it helped anyways. I saw in your code AutoSize set to true, well for some random reason this inspired me to turn off AutoSize. Once i turned off autosize then it let me change the size freely as I wished.
So to make a StatusStrip taller you just need to turn off AutoSize.
--Peter
|
|
|
|
|
Yes, the AutoSize property tells the Windows Forms layout system to automatically size the control based on it's "preferred size". This is either a hard-coded value or is based on the control's contents, or some combination.
When AutoSize is set to true , the layout system will happily ignore any manually adjusted size information you might provide. By setting it to false you are telling the layout system to display the control specifially in the size you specify.
-----------------------------
In just two days, tomorrow will be yesterday.
|
|
|
|
|
hi 4 all
need help from any one
need to store time (Hour and minutes ) in the data base without store date
iam tried it from date and time picker
thank you 4 all
|
|
|
|
|
I don't know whether you see datetime.
If you store hour and minutes, why don't you make two SmallInt fields to store each you want.
I don't think storing full datetime is useless. You completely choose hour and minutes from datetime as needed.
Hope the help.
It seem to be a solution or an answer.
|
|
|
|
|
From the datetimepicker control you will always get a DateTime object, so you will always have both a date and a time portion. If you only want to store the time, you can retrieve the hour and minute properties and store them either as formatted string or as two integer values.
When you read them back in from the database you will need to reconstruct a DateTime object which will give you a date portion again (set to today's date).
You may be better off storing the full date time in the database and just ignoring the date portion when you are manipulating the value.
-----------------------------
In just two days, tomorrow will be yesterday.
|
|
|
|
|
Hi,
Smart FieldPackEditor.Net will allow you to do exactly that. You can setup a DateTimePicker with the content you want and databind each part individually, in your case just the time. There is a nice video about it at VisualHint. This component is in beta.
|
|
|
|
|
Hi
has anyone have any idea about the following error?
Message = Object is currently in use elsewhere. , StackTrace = at System.Drawing.Image.get_Width() at System.Drawing.Image.get_Size() at System.Windows.Forms.ButtonInternal.ButtonBaseAdapter.CommonLayout() at System.Windows.Forms.ButtonInternal.ButtonFlatAdapter.PaintFlatLayout(PaintEventArgs e, Boolean up, Boolean check, Int32 borderSize) at System.Windows.Forms.ButtonInternal.ButtonFlatAdapter.PaintUp(PaintEventArgs e, CheckState state) at System.Windows.Forms.ButtonInternal.ButtonBaseAdapter.Paint(PaintEventArgs pevent) at System.Windows.Forms.ButtonBase.OnPaint(PaintEventArgs pevent) at EES.ATE.TouchScreenControls.TouchScreenButton.OnPaint(PaintEventArgs pevent) at System.Windows.Forms.Control.PaintWithErrorHandling(PaintEventArgs e, Int16 layer, Boolean disposeEventArgs) at System.Windows.Forms.Control.WmPaint(Message& m) at System.Windows.Forms.Control.WndProc(Message& m) at System.Windows.Forms.ButtonBase.WndProc(Message& m) at System.Windows.Forms.Button.WndProc(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m) at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam
Actually I am updating a GUI's Button image in Backgroundworker class, I didn't use Invokerequired property. I suspect that would be the cause of this error. But this error has been captured Application_ThreadException event.
Any idea when this error will occur?
|
|
|
|
|
A background thread should never interact with the UI directly. Instead it should tell the main thread to do it.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"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 )
|
|
|
|
|
Thats correct. But i read this BackgroundWorker class will not have any cross-threading issues. Is it right? also tell me is this error comes because of Cross-threading invalid operation?
|
|
|
|
|
engsrini wrote: But i read this BackgroundWorker class will not have any cross-threading issues. Is it right?
You still have to synchronise the threads regardless of how the thread is wrapped up.
|
|
|
|
|
The BackgroundWorker will not allow any cross-thread operations and will throw an exception if you try to do so.
You still need to have a basic understanding of how threading works even when using the BackgroundWorker . If you are trying to change the button image as the result of either progress or completion, you need to do so using either the ProgressChanged or RunWorkerCompleted events. (If you use ProgressChanged, make sure to set the WorkerReportsProgress property to true.
See http://msdn2.microsoft.com/en-us/library/system.componentmodel.backgroundworker(vs.80).aspx[^] for more details.
-----------------------------
In just two days, tomorrow will be yesterday.
|
|
|
|
|
Hi there,
I have a DataGridView bound to a BindingSource, and this BindingSource is bound to a BindingList of custom objects.
The list is updated from another thread, and when it tries to update the DataGridView it (understandably) crashes because the control was created in the main thread while the list was updated in a worker thread.
I know you can use Invoke to solve cross threading problems but in this case I have no clue on what event I should use Invoke. I dont even know if I should be looking at the BindingSource or the DataGridView itself.
I've ran out of ideas and Im finding this pretty frustrating, any help would be greatly appreciated.
Thanks in advance!
|
|
|
|
|
Hello,
I have a program which is always running on user's computer.
And I would like to add an item to windows context menu (shell menu), with option to Backup a file (it's not a problem).
After user right clicks some file in explorer and then clicks "Backup this file", is it possible to send somehow file path argument to already running program?
|
|
|
|
|
You can do this if it exposes an interface for doing so, such as COM, .NET Remoting, or a Web Service, etc. It would be rather difficult, if not impossible in some cases, to gain access to the memory space of the application otherwise.
only two letters away from being an asset
|
|
|
|
|
Not something I've done, but try looking into MSMQ messaging. .Net provides support in System.Messaging.MessageQueue. It wasn't totally clear from your post, but assuming that you are writing a shell extension in c#, you could have your shell extension add a message and your running program read the messages from the message queue.
TopCoderJax
|
|
|
|
|
The WM_SENDMESSAGE message is the easiest way to do this. As others have said, if you mean without changing the source code of the program you want to send the argument to, the answer is no. But, if you want to change the program to work with a shell extension, then that's the way I would do it
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"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 )
|
|
|
|
|
Thanks very much for all answers, was very helpful. Did it with messaging, because it was easy and fast
|
|
|
|
|
I'm brand new to C#. I just want to create a simple progam that will write data to a file on the hard drive (some text plus some variables). Does anyone have a "hello world" type program that writes a message to a text file rather than the output window? Thanks!!
Harley
|
|
|
|
|
using(StreamWriter sw = File.AppendText(@"c:\Date.txt"))
{
sw.WriteLine("Hi");
sw.WriteLine("Today's date: "+ DateTime.Now.ToShortDateString());
}
Have a look at the c# beginner's articles[^] in this site.
|
|
|
|
|
I have being written about webserver http1.0 by C#,now begin telnet I connect to webserver,after that I write GET /index.html HTTP/1.0
please,I want to ask you:I have to use which class,which method to test format of this String(GET /index.html HTTP/1.0)
to know it format of httpRequest
thanks
help me
|
|
|
|
|
For serious string parsing check out the Regex class. Example here.[^]
|
|
|
|
|
How do I use grayscale values to determine the color of pixels read from an image
tony-yeyo
|
|
|
|
|
I don't understand your question. When you read a pixel, you get a Color value, what do you want to do with that?
---
single minded; short sighted; long gone;
|
|
|
|
|
well I plan to draw a graph of the pixels against the grayscale so I wanted a way to group the pixels corresponding to the grayscale values. Like 0-255 is black-white respectively on the grayscale.
So how do I determine that this pixel is of a particular color according to the grayscale?
tony-yeyo
|
|
|
|
|
Just take the average of the red, green and blue color components.
---
single minded; short sighted; long gone;
|
|
|
|