|
Hello,
I use my own listview control. After a drag&drog, I lose scroll position. I backup scroll value, but after drag&drop, I call the SetScrollPos function, the scroll move, but not list items, how to go to the right items position ? May be use ScrollEventType.SmallDecrement until to go to the old position ?
thanks
|
|
|
|
|
I need to show images and text pages in a document viewer.
In windows applications we can view the images in picture box, without caching, ie when we view the doc in any browser we cannot copy it.
So I need a control like windows picturebox in asp.net.
pls help me in this regard.
Rambabu apollo
|
|
|
|
|
I need to show images and text pages in a document viewer.
In windows applications we can view the images in picture box, without caching, ie when we view the doc in any browser we cannot copy it.
So I need a control like windows picturebox in asp.net.
pls help me in this regard.
|
|
|
|
|
Hello
I have an aspx page with a number of controls, including a few ascx usercontrols. Ive come to realize that the page_load event for this page fires several times every time a postback occurs. The number of times it fires is different depending on what triggered the postback, for one button it may be four times, for another 6 times. Also, IsPostBack is set to False for almost everytime, and then suddenly for page_load nr 4 out of 6 its set to true, for an example. I cant seem to figure out what makes it fire so many times, or why IsPostBack is set to False, or why all of a sudden its set to True and then back to False.
Does anyone have an idea what the cause of this might be?
/Regards Magnus
-- modified at 6:07 Thursday 16th March, 2006
|
|
|
|
|
Please post this message in the ASP.NET section.
Q:What does the derived class in C# tell to it's parent?
A:All your base are belong to us!
|
|
|
|
|
Hello
Is it possible to analyze a complete class hierarchy using reflection ? I found some samples on MSDN which worked well, but they all looked at one class only, I need to read properties and custom attributes from the parent classes too. I know it works in Java, so there might be a way to do so in .NET too…
I’m creating a generic persistency component for academic purposes.
Strength in the Face of Adversity
|
|
|
|
|
Simple enough; once you have the type of a class, use the BaseType property to get the parent's type. For instance, try
Form f = new Form();
Type t = f.GetType();
Console.WriteLine(t.BaseType.ToString());
HTH.
Cheers,
Vikram.
I don't know and you don't either.
Militant Agnostic
|
|
|
|
|
hey howzit?
its easy to import contacts from outlook in code...but what i wanna do is beable to drag an outlook contact straight from the the Outlook Application itself into my running C# application...can anyone help?
|
|
|
|
|
|
Hey J4amieC,
Thanks very much for that tutorial...I tested it and and works...the problem I have now is I need not only to see the files URL I need to see the contents of the file...in particular i need all the information from the .vcf file so when I drag from outlook i can see all the data.
Thanks,
David
|
|
|
|
|
Hi,
1)How can I get the names of the databases in sql server 2005?
2)How can I get the names of the sql server machines?
Thanks
|
|
|
|
|
|
I have a datagridview which allows users to enter new values for each column. But what I would really like is to prevent the user to add value to other columns if column MSISDN is still empty. which means, user must FIRST add MSISDN value before filling up the rest.
Is there anyway where I can prevent the cursor or prevent setting focus to cell before anything else.
THANKs!!!!
|
|
|
|
|
simply use "CellValidating" event for other columns.
in this event check whether if your MSISDN column is empty then set cancel to true.
|
|
|
|
|
|
Hey howzit?
I would like to import outlook contacts in my C# application. I have found a handy application on the code project: http://www.codeproject.com/com/outlookcontacts.asp?df=100&forumid=14626&select=1409933&msg=1409933 but it uses C++ and I do not want to use this code...I heard there is code in .NET for doing this...can anyone please help me?
Regards,
|
|
|
|
|
Hi,
I have a problem in C#, which in C++ i would solve within seconds using pointers/references
But how to solve this in C#
I will try to explain my problem with an example:
I have two classes Data & Formatter
public class Data
{
public string strText;
Formatter formatProtocol;
public Data()
{
formatProtocol = new Formatter();
}
}
public class Formatter
{
public Formatter() {}
void FormatNow()
{
}
}
How do I let the Formatter change the strText member ???
How should i solve this if it wasn't a string but a ValueType ?
codito ergo sum
-- modified at 4:02 Thursday 16th March, 2006
|
|
|
|
|
Please post into the C++ forum. This is the C# forum.
No hurries, no worries.
|
|
|
|
|
I know,
I need to know how to solve this problem in C#
codito ergo sum
|
|
|
|
|
OK, my apologies,
you can create a getter/setter method (more Java based) or a property (C# based)
This is exactly the concept of incapsulation.
so to get to a private member of your class you can do this:
C# based:
public string AStringName{<br />
get{<br />
return theprivatemember;<br />
}<br />
set{<br />
theprivatemember = value;<br />
}<br />
}
This allows you to check if value has correct value (according to your needs) before actually setting them.
eg.:
classinstance.AStringName = "Hello CodeProject!";
will result in the theprivatemember = "Hello CodeProject!"
You can do the same for int, arrays and even objects.
good luck!
No hurries, no worries.
|
|
|
|
|
No apologie needed (no offense taken )
this solves the private/protected issue of my problem but i still need to pass and
store a reference to the Parent object.
See my reply[^] on the solution J4amieC of to understand what i mean.
I have used this simple example to state what I need, I know that the suggested solution works perfect in this case, but the real object model is more complex then this.
codito ergo sum
|
|
|
|
|
If you used to solve it in seconds using references using C++, why cant you solve it in seconds using references in C# AM I missing something?
public class Data
{
public string strText;
Formatter formatProtocol;
public Data()
{
formatProtocol = new Formatter(this);
}
}
public class Formatter
{
private Data toFormat
public Formatter(Data theData)
{
this.toFormat = theData
}
void FormatNow()
{
this.toFormat.strData = "Hello reference";
}
}
|
|
|
|
|
Thanks for the response.
I see few problems with this approach.
1. The Formatter has to know the structure of the Data object this will lead to difficulties when I need to support multiple non-inherented classes Data1, Data2;
2. This alsoo breaks security when the modifier of the member is protected or private, here it needs to be public. Or can I make the two class friend of each other.
3. I'm not sure about this one, but isn't there a Garbage collection issue. I mean both objects point to each other. But I can only 'delete' one (Set the Data object = null)
In c++ i'm used to pass only the data that the other class needs to know/change.
If it only was a function I could pass the string with the ref or out token.
But i need to store it for later processing.
I'm really stuck here
codito ergo sum
|
|
|
|
|
BadKarma wrote: The Formatter has to know the structure of the Data object
Isnt this true of anything termed a "formatter"? If I am to format a word document, I have to have the word document right? I cant format it it i cant see it!
BadKarma wrote: This alsoo breaks security when the modifier of the member is protected or private, here it needs to be public. Or can I make the two class friend of each other.
Make them internal if you like, or a better solution is for all data structures to implement an interface and take that interface in the ctor of the formatter.
BadKarma wrote: I'm not sure about this one, but isn't there a Garbage collection issue. I mean both objects point to each other. But I can only 'delete' one (Set the Data object = null)
No issue, it will all be taken care of for you by the runtime.
|
|
|
|
|
I know your pain, I was experience C/C++ withdrwals too. Here's my take: you don't need any pointers in managed safe code. In system code (i.e. unmanaged you can still use them). Now with that said most applications are more easily maintained and written if they leverage the C# managed classes.
You still have Ref and plus a new Qualifier call Out. But instead of operating on addresses, all C# logic is based on arrays and indices. So I could have an 100 item array of int called myList. If I call a funtion called AddTheValues it might look like this:
<br />
public long AddTheValues( int[] numbers )<br />
{<br />
long total = 0;<br />
<br />
for ( int i=0; i < numbers.Length; ++i )<br />
total += numbers[i];<br />
<br />
return total;<br />
}<br />
Out is sort of like a built in malloc or new that a function returns thru the parameter list instead of as a return value. Good fpr special allocator type code.
<br />
public void NextValueList( out int[] num, int size )<br />
{<br />
num = new int[size];<br />
}<br />
Ref is used when like in C++ we are concerned about operating the SAME structure. In C# you normally don'd have to clean up (i.e. free) new'd elements. This is true for the general case. BUT if you have hairy I/O classes then there is a destructor equiavlent called IDisposable. Basically you derive your C# class from this Interface and it provides the Dispose() method you can customize to clean up.
Good Luck
Mike Luster
CTI/IVR/Telephony SME
|
|
|
|