|
faraz34 wrote: would u please introduce some of those tools?
Did you follow the link I posted in my previous message? Have you looked at MSDN, Google, other coding websites?
Quite frankly, if you need to ask the above question, then I think trying to write a program to do what you want may well be too advanced for you.
|
|
|
|
|
Hello everybody,I use the datagrid control in almost all my applications that require it for displaying information. I think datagrid supports for user customization in deep. My question is, is it possible to scroll up and down only for the items(rows), I mean while the header remains stationary and if the provided space isn't enough to accommodate it fully. I'm just using it in web application. Thank you.
|
|
|
|
|
|
How can i do this. Really need this thing to be even immune to z-order changing. Almost like how a mouse cursor is drawn above everything else.
I need this because i'm working on a class project to in effect create 2 additional cursors on the desktop... windows only allows 1, but if i can fake it somehow?
|
|
|
|
|
How about a way to just draw on top of any desktop program... not actually using a circular window that is always topmost above the most topmost other window?
Wait!!! i remember i had a computer once where if you changed the volume using the keyboard, that some graphics showing the volume were drawn across the screen... i think they were visible even in a directx game...
modified on Monday, October 12, 2009 12:18 AM
|
|
|
|
|
Hi!!!!!!
How can I generate serial numbers automatically before each item in the listview as the items get added in the listview.
Kindly help me.........
|
|
|
|
|
Create your own control derived from a listview, and put the code to generate the serial number in the overided Add event before you hand it to the base class.
No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced.
This message is made of fully recyclable Zeros and Ones
|
|
|
|
|
|
Hi,
I have an idle time monitoring class that works great by installing hooks to keyboard, mouse, ect. The problem is that when the application is minimized windows doesn't seem to send any messages to the application. Anybody has any ideas on how to trap this condition? I would like to application to timeout even when minimized!
Thanks,
Daniel
|
|
|
|
|
|
I am trying to put to gether a BaseTable helper class. This class is expected to be inherited by the TableClass (each table in the database has a class)
I have the feeling I may have the wrong handle on this but here goes:
T is the table class and oTable is the datatable with the rows I want to turn into a List<> of T
RowToObject<T>(oClass1, oTable);
This takes an empty copy of the TableClass and loads the datarow in, works well
My problem is trying to create a new instance of oClass
public List<T> ToList<T>(T oClass, DataTable oTable)
{
try
{
Type t = oClass.GetType();
List<T> ClassList = new List<T>();
foreach (DataRow oRow in oTable.Rows)
{
T oClass1 = new T();
RowToObject<T>(oClass1, oTable);
ClassList.Add(oClass1);
}
return ClassList;
}
catch (Exception)
{ throw; }
}
I get the following compile error that wants a new() constraint on T but this helper class should not know who is using it, indicating I am screwing it up.
Cannot create an instance of the variable type 'T' because it does not have the new() constraint
Enlightenment would be appreciated!
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
What the compiler is telling you is that nowhere in your generic type definition have you decided that type T must have a default constructor. What you need to do is change your class definition such that it has a new constraint[^] on the generic parameter. This will do two things: first, it will allow you to use new T() within your class (because you're specifying that type T must have a parameterless constructor), and second, it will only allow you to instantiate your generic class with types that have said default constructor. Without the new constraint, you would potentially be able to use a generic type that doesn't have a parameterless constructor, which would make new T() invalid.
Adam Maras | Software Developer
Microsoft Certified Professional Developer
|
|
|
|
|
Yup, got that from MSDN, so I trundled off to add a paramaterless constructor to the class (clsApp) that calls this one, made no difference to THIS class (TableBase) what I did to the calling class.
At which point I concluded I was screwing it up. TableBase , the class containing this method has no knowledge of the calling class clsApp and therfore how can it know there is a new() constraint on it.
So how should I put together a generic helper method that takes a table populates a List<> and can be inherited by all my table classes, I am considering passing the class instance into this method but it feels wrong.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
I think you got it wrong: you have to add the new constraint to you generic TableBase class.
Something like this:
public class TableBase<T> where T : new()
{
}
That tells TableBase<T> that T must have a parameterless constructor.
|
|
|
|
|
Your TableBase class will need to have the new constraint applied:
public class TableBase<T> where T : new()
{
}
Edit] note to self: refresh page to check if anyone else has responded before posting [/Edit]
|
|
|
|
|
Dave and Mirko (ignore the refresh, redundancy is appreciated)
Hah, cool, completely changed the way I was utilising the base class.
Thanks guys, have a 5 for the solution (as opposed to the identification of the problem)
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Adam
Thanks for the reply but why do I feel this is an MS/MSDN type response, technically correct and absolutely right but does not solve the problem. The responses from Davey and Mirko solved the problem rather than defined the problem, while they may not have been able to supply the solution without your input, your input did not go the 1 small step further to actually be useful.
I wonder if this is not the biggest issue developers have with MSDN and are so disparaging of MS support.
Please note someone else gave you the 5 as I did not consider this a solution to the problem.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
I realized that I had slightly misread the question after I saw Davey and Mirko's solution and reread your post.
No hard feelings.
Adam Maras | Software Developer
Microsoft Certified Professional Developer
|
|
|
|
|
Adam Maras wrote: No hard feelings
Certainly not, I appreciate the effort, your answer took more work than I am usually willing to invest. But then I answer a lovwer level of question
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
I want to make an application that when I'm with the mouse on it ... it sets the opacity to 100 ... and when the mouse is .. outside the form.. it sets the opacity to 50
THE PROBLEM IS that the code...is working when the mouse is over the content of the form... it does not include the border of the form or the form controlbox(min,max,close) ... don't know why
I've managed to make something like that with a timer set to 100 and with this piece of code:
If Cursor.Position.X >= Me.Left And Cursor.Position.X <= Me.Right Then
If Cursor.Position.Y >= Me.Top And Cursor.Position.Y <= Me.Bottom Then
mouseover = True
Else
mouseover = False
End If
Else
mouseover = False
End If
Please help with an idea .. Thanks
|
|
|
|
|
...and do NOT spam multiple forums with the same question. You posted VB.NET code, so stick with the VB.NET forum. In fact, posting VB.NET code in a C# forum is pretty close to a cardnial sin. Be prepared to get flamed.
|
|
|
|
|
VbCodeDetectedException, thread aborting
Luc Pattyn
I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages
Local announcement (Antwerp region): Lange Wapper? Neen!
|
|
|
|
|
I am migrating a C++ application to .NET.
In C++ ,I have an template class which uses some ATL library classes
for eg.
template< class T >
class MyBaseClass:
public IConnectionPointContainerImpl<t>,
public IPersistStorageImpl<t>,
public IPersistPropertyBagImpl<t>,
{
}
Now i need to use this call in my new C# .net project where my new .NET call will get derive from above MyBaseClass .
Please let me know how can i archive this ???
Is this possible to use a template class which uses some ATL libraray classes directly in C# ?
`chiman
|
|
|
|
|
You can't.
You'd have to write a C++/CLI wrapper aroudn your class and use that in your C# app.
|
|
|
|
|
Hi,
I need to control my progressbar inside a thread by invoking it on GUI thread, otherwise the GUI may lock for a short time which is really disturbing. How can I change the Value property of a progressbar with invoking it.
Thanks in advance.
|
|
|
|