|
try to search some articles on this.
as an example
http://www.codeproject.com/useritems/Drag_Drop_from_GridView.asp
|
|
|
|
|
Hi
I wrote a windows application. One of my client is sometimes getting the error below. I tested many times, but I never can reproduce the error. Does anyone know about this error?
Thanks
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.InvalidOperationException: Loading of the ImageList did not succeed. at System.Windows.Forms.ImageListStreamer..ctor(SerializationInfo info, StreamingContext context) --- End of inner exception stack trace --- at System.RuntimeMethodHandle._SerializationInvoke(Object target, SignatureStruct& declaringTypeSig, SerializationInfo info, StreamingContext context) at System.RuntimeMethodHandle.SerializationInvoke(Object target, SignatureStruct declaringTypeSig, SerializationInfo info, StreamingContext context) at System.Reflection.RuntimeConstructorInfo.SerializationInvoke(Object target, SerializationInfo info, StreamingContext context) at System.Runtime.Serialization.ObjectManager.CompleteISerializableObject(Object obj, SerializationInfo info, StreamingContext context) at System.Runtime.Serialization.ObjectManager.FixupSpecialObject(ObjectHolder holder) at System.Runtime.Serialization.ObjectManager.DoFixups() at System.Runtime.Serialization.Formatters.Binary.ObjectReader.Deserialize(HeaderHandler handler, __BinaryParser serParser, Boolean fCheck, Boolean isCrossAppDomain, IMethodCallMessage methodCallMessage) at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(Stream serializationStream, HeaderHandler handler, Boolean fCheck, Boolean isCrossAppDomain, IMethodCallMessage methodCallMessage) at System.Resources.ResourceReader.DeserializeObject(Int32 typeIndex) at System.Resources.ResourceReader.LoadObjectV2(Int32 pos, ResourceTypeCode& typeCode) at System.Resources.ResourceReader.LoadObject(Int32 pos, ResourceTypeCode& typeCode) at System.Resources.RuntimeResourceSet.GetObject(String key, Boolean ignoreCase, Boolean isString) at System.Resources.RuntimeResourceSet.GetObject(String key, Boolean ignoreCase) at System.Resources.ResourceManager.GetObject(String name, CultureInfo culture, Boolean wrapUnmanagedMemStream) at System.Resources.ResourceManager.GetObject(String name) at SupportAliveOperator.CustomPanels.PanelVisitorInfo.InitializeComponent()
ozgur.nevres
|
|
|
|
|
|
Yes i read this.
I thought i didn't make a twice call. But after debugging step-by-step on my code, i saw that i made absolutely this mistake. Guess why: To fix another bug.
I have to always keep in my mind: "When you fix a bug, you may introduce a new bug".
Thanks for your response
ozgur.nevres
|
|
|
|
|
this error is because you dropped the images you imported to the imageList or maybe because you deleted them or changed their directory or because you deleted the resources file
|
|
|
|
|
DataGridTableStyle DGTS = new DataGridTableStyle();
DGTS.HeaderBackColor = Color.Red;
dataGrid1.TableStyles.Add(DGTS);
What am I missing to apply this style ;
Smile: A curve that can set a lot of things straight!
(\ /)
(O.o)
(><)
|
|
|
|
|
Hi Muammar,
Your code work well here. Please use your code after the this.Controls.Add(dataGrid1) .
EX:
this.Controls.Add(dataGrid1);
DataGridTableStyle DGTS = new DataGridTableStyle(); DGTS.HeaderBackColor = Color.Red;
dataGrid1.TableStyles.Add(DGTS);
Thanks,
Gopal.S
|
|
|
|
|
Funny but I cant find it in the designer class.
Thanks anyways!
Smile: A curve that can set a lot of things straight!
(\ /)
(O.o)
(><)
|
|
|
|
|
Hi,
I'm developing a user control that is composed by other controls.
I'd like to know if it's possible to acces this inner controls at desing time when I use them in my application. I mean, if my control has a Button, Can I access that button once I've put the control in my application Form?
I Know I can access by code but I want to access in the designer. For example I wanto to change the location of the button.
I think it isn't possible, I'm right?
Thanks.
|
|
|
|
|
You can position your controls in the designer! however the positioning property should be set accordingly!
Gautham
|
|
|
|
|
You can position the controls of a user control in the designer for the user control. If you then put the user control on a form you can only positition the whole user control as one, and not any idividual buttons that happen to be on it.
|
|
|
|
|
Changing the modifiers of the inner controls from a default 'private' to 'public' may serve ur purpose.
Regards,
KKrista
|
|
|
|
|
That would be unwise. It would break encapsualation. The better approach would be to have a set of methods that control access to just the things you want something outside to be able to manipulate.
|
|
|
|
|
it's not possible u can do that through coding.. but it's not possible at design (atleast according to my knowledge)
|
|
|
|
|
Strange subject; this has nothing to do with inheritance. You don't inherit a class when you create an instance of it.
It might be possible to build something that might enable you to redesign elements in the control in the designer, by exposing the location of the control as a property, and write code to handle the changes at design time. If it's even possible, it's probably far more work that it's worth.
I would suggest that you create a property in the user control that decides the location of the button. Like a ButtonLocation property that takes an enum value that represents the location.
---
single minded; short sighted; long gone;
|
|
|
|
|
I want to have a textbox in which the user can enter only nos. In vb.net we can match the pattern by using the like operator followe by the preferences (e.keyChar Like "[0-9.]"). But how can i do it in C#
Plz give me a hint.
Best Regards,
M. J. Jaya Chitra
|
|
|
|
|
You can use a maskedtextbox, or use regex, or use char.IsDigit, etc, in a key pressed event handler.
e.KeyCar LIKE "[0-9.]" is doing a regex pattern match, which is wasteful compared to char.IsDigit, but with different syntax, it works fine in C#.
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 )
|
|
|
|
|
How about using RegularExpressionValidator control of C#?
-- modified at 4:25 Tuesday 5th June, 2007
Regards,
Murali
|
|
|
|
|
That does something entirely different, a regular expression validator tells you if your input was formatted correctly. He wants the control to not allow invalid input.
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 )
|
|
|
|
|
I have to allow only the nos so I tried by checking the keyvalue so it is checking fine but it should not be allowed to be in the textbox know but whenever i am setting e.keyvalue=0, it is giving that it is a read only property, so plz give me a hint how to disable the invalid characters and to allow only nos and .(dot).
Best Regards,
M. J. Jaya Chitra
|
|
|
|
|
if (!char.IsDigit(e.KeyChar) && e.KeyChar != '.')
{
e.Handled = true;
}
Something like that. setting handled to true stops the base class from handling the key press ( so it is then ignored )
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 )
|
|
|
|
|
Thank you so much it is working well and good.
Once again Thank you
Best Regards,
M. J. Jaya Chitra
|
|
|
|
|
When we implement the dispose pattern, in protected virtual void Dispose(bool disposing), we need to say if disposing is true, then dispose managed resources as below:
protected virtual void Dispose(bool disposing)
{
if (!this.disposed)
{
if (disposing)
{
}
}
disposed = true;
}
When we make a call explicitly to this method with disposing = true, in public void Dispose() as below:
public void Dispose()
{
Dispose(true);
GC.SuppressFinalize(this);
}
the managed resources will be explicitly disposed. But why do we need to dispose managed resources explicitly in protected virtual void Dispose(bool disposing). Won't they be disposed automatically by the GC finally after the object reach the end of its life?
Secondly, since those are managed resources, how can we get our own hands on to release them? For example, if we allocate some chuncks of memory on heap (i.e, instantiate classes), is there a way for us to release them explicitly? (Setting the references to nothing doesn't mean that, it just tells .Net that we don't need them any more, they can be recollected from this point of time. And this is actually unnecessary. Right?)
Thanx a lot.
-- modified at 20:00 Tuesday 5th June, 2007
|
|
|
|
|
Because you have no idea when the GC will be called, and the Dispose pattern is used to free unmanaged resources like bitmaps or database connections, so you can count on them becoming available right away.
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 )
|
|
|
|
|
cateyes_99 wrote: Setting the references to nothing doesn't mean that, it just tells .Net that we don't need them any more, they can be recollected from this point of time.
But what about other managed objects that wrap unmanaged resources. Things like File, Pen etc.? For example :-
class TheDisposable : IDisposable
{
IntPtr handle;
FileStream stream;
public void Dispose
{
Dispose(true);
GC.SuppressFinalize(this);
}
protected virtual void Dispose(bool disposing)
{
if (disposing)
{
stream.Dispose();
}
CloseHandle(handle);
}
~TheDisposable() { Dispose(false); }
}
If you don't explicitly dispose the stream here, you'd have to wait for the finalizer for that particular FileStream object to run (assuming it has a finalizer).
Like you said, there is no need (usually) to set references to null in Dispose, as the GC is intelligent enough to figure out that an object has no live references.
|
|
|
|