|
i'v read about connection between Image List & Context Menu
one of the steps is to drag MenuImage to my form
but the problem i can't find it??
i tried to look in the Tools -> add Tools Box Item and
nothing was found there
i atteched link of the article maybe i didn't understood well the things.
http://www.codeproject.com/cs/menu/menuimage.asp[^]
|
|
|
|
|
|
My datagrid is bound to a database table. One of the table has the web addresses like , www.amazon.com etc etc. I want the users to display the hyperlink in the datagrid and not the value, so that the users can click on the hyperlink and go to the web address.
Thanks for the help.
|
|
|
|
|
Is this for the System.Web.UI.WebControls.DataGrid or System.Windows.Forms.DataGrid ? If it's the former, 1) there already is a column type for that (HyperLinkColumn ), and 2) your question belongs in the ASP.NET forum.
If it's the latter than you'll need to implement your own DataGridColumnStyle derivative class and add that to a DataGridTableStyle for your DataGrid . Read the documentation[^] for the DataGridTableStyle class to see how it's used with the DataGrid.TableStyles property. This explicitly defines a style (i.e., columns, their header text, width, etc.) which lets you add columns of a specific type.
See the documentation[^] for the DataGridColumnStyle for information - and an example using a DateTimePicker control - about implementing the class. There's also a few articles here on Code Project if you search for "DataGridColumnStyle", but, IMO, you'll find a better example in the .NET Framework SDK.
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles] [My Blog]
|
|
|
|
|
hey, i need help. i'm writing the game go!fish in c laguage and if someone can help me with the algorithms i'll be thankful and if someone wrote a game in c laguage please contact me via my e-mail.
shalom
|
|
|
|
|
SMTK wrote:
i'm writing the game go!fish in c laguage and if someone can help me with the algorithms
1. Don't assume people know everything. I've never heard of go!fish. Describe the rules of the game.
2. Post this in the correct forum. This is the C# forum. I suggest you try the Visual C++ forum.
SMTK wrote:
please contact me via my e-mail
If you cannot be bothered to return to this forum to check for answers then maybe we cannot be bothered answering you. Also, people who provide advice here do so for free. Our "reward", if you like, is that we get to share the answers with the whole community, not just one individual.
Also, Code Project have a feature where by they will notify you by email of any responses to messages you've posted in the forum, use that to know you have an answer.
Do you want to know more?
WDevs.com - Open Source Code Hosting, Blogs, FTP, Mail and Forums Upcoming talk:
SELECT UserName, Password FROM Users
-- Getting unauthorised access to a SQL Server, and how to prevent it.
|
|
|
|
|
Hello, was wondering does the ArrayList has a way to determine the validity of the item (at compile time) to be placed into the container like C++ template? I know the type that the ArrayList could accept is object (which is everyone) but what if I need to be just integer instead?
Anyway?
thanks
Sonork 100.41263:Anthony_Yio
|
|
|
|
|
|
thanks, can't wait to get my hands on the C# 2.0.
Sonork 100.41263:Anthony_Yio
|
|
|
|
|
What Corinna was saying about .NET 2.0 would be the List<> class. You can use that like so:
List<int> ints = new List<int>();
ints.Add(1);
ints.Add(2);
ints.Add("blah"); Besides using a generating you can currently extend CollectionBase , which uses an ArrayList internally. You define your methods to be typed according to the Type you want to accept.
Using this is a good way to produce more portable code. If you extend CollectionBase now, you can easily extend List<> later and just remove your CollectionBase overrides:
public class IntList : CollectionBase
{
public int Add(int value)
{
return List.Add(value);
}
public void DoSomething()
{
}
}
public class IntList : List<int>
{
public void DoSomething()
{
}
} See how easy that can be? Without changing your code that uses IntList you can change the base type and avoid boxing (since casting or treating a value type like int as a reference type object requires boxing).
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles] [My Blog]
|
|
|
|
|
thanks
Sonork 100.41263:Anthony_Yio
|
|
|
|
|
Hello, I have just acquainted myself with C# and .NET and I have a question. I see there are some C# classes that represent Crystal report files and report interfaces (*.rpt and *.xsd) and I want to find out how do these classes work.
Thank you.
|
|
|
|
|
.xsd is an XML schema file, first of all. You can use these to define fields for a report that you can later bind to a DataSet (disconnected recordset) using ReportDocument.SetDataSource .
Using Crystal Reports for Visual Studio .NET is documented in the product documentation. Read Crystal Reports[^] in MSDN online for more information.
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles] [My Blog]
|
|
|
|
|
Hi! All,
please help me to create Dynamic Cursor files at run time.
|
|
|
|
|
This request is well beyond the scope of this forum about writing in and using C#. If you want to create cursor files at runtime you need to understand the structure of a cursor blob (data), which is documented in the Platform SDK.
Read about Resources[^] in MSDN Online for information about the cursor data structures.
If you need help declaring such structures in C# and serializing them to a file stream, first read Marshaling Data with Platform Invoke[^] in the .NET Framework SDK. If you have further questions about how to do this in C# - if indeed you're trying to do this in C# - you can ask here.
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles] [My Blog]
|
|
|
|
|
I want to get the selected text in an opened browser window programmatically from another winodw application that I created. I've to use SenKeys.SendWait("^C") function But it didn't solve my problem.
Or
I've created a object for a toolbar with some button.
That toolbar is added to InternetExplorer I want to select some text
from any page opened in the browser then click on that button to pass the
selected text from the page to the clipboard. So, I though to access
CTRL+C programmatically and I did using SenKeys.SendWait("^C") . But it didn't copy the selected text, I thought it loose focus from the area of
the page. so I tried to get refence to that area from the browser like
using
this.FindForm()
this.Parent
this.TopLevelControl
this referes to my button or the toolbar control that contains that
button.
I want o use:
bowserWindow.Focus()
SenKeys.SendWait("^C")
but all the trials to get reference to browser window returns null. I
tried to get refrence to the IEXPLOR process and succeeded and from it
got the handler of the window but couldn't cast it to a window.
Summary: I want to copy the selected text from body of the broswer page
programmatically from the toolbar button action or from another application
egyseiko
|
|
|
|
|
The best, most practical way of doing this is just accessing the DOM (document object model) for the body. Reference the Microsoft.mshtml.dll assembly in your project and add using mshtml; to the top of your source to import the namespace.
Cast the AxWebBrowser.Document property to IHTMLDocument2 , which defines the body property. From that you can get either the innerHTML or innerText . If this seems familiar in terms of web development with DHTML, it's because you're walking the same DOM that script uses that is exposed by MSHTML, the HTML parser and renderer for the WebBrowser control (which is actually IE, not just iexplore.exe):
IHTMLDocument2 doc = (IHTMLDocument2)axWebBrowser21.Document;
if (doc != null)
{
IHTMLElement body = doc.body;
if (body != null)
bodyText = body.innerText;
} Hosting the WebBrowser control or MSHTML itself and accessing the DOM is what most clients do, and it allows you to access the full HTML DOM that script can.
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles] [My Blog]
|
|
|
|
|
Actually, I can't get access to the instance of the current opened browser window. I'm not using WebBrowser control. So, how can I got that refrence you refered to as
AxWebBrowser.Document
egyseiko
|
|
|
|
|
I am writing a program that requires array types and dimensions be decided at runtime. I can use System.Array.CreateInstance() to do this. What is the most efficient way to access the data in this array? I know I can use the getValue and setValue methods. I can also use the enumerable interface when allowed by the situation. Both of these are however inconvenient when compared to indexing the values using [].
Does anyone have any suggestions. Efficiency of the code is a major consideration.
Thanks,
Karl
|
|
|
|
|
If you expect the modify the array while enumerating you cannot use IEnumerable . It will throw an exception if the underlying enumerable changes.
Why not just use an ArrayList ? It has the same read performance as an array because it uses an array internally. It's only when you add elements past the current capacity that there is overhead since a new array is created (doubling in size) and previous elements are copied.
Dynamic code is often an inconvenience, but there's not much you can do short of wrapping such behavior (which, once again, ArrayList already does for you - just examine the IL for yourself or use a decompiler like .NET Reflector). Ever written native code to access automation (IDispatch implementations) servers? It's a pain compared to automation clients like VB6 and script, but that's the price to pay for late-binding code.
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles] [My Blog]
|
|
|
|
|
Thanks for your response.
As I understand the ArrayList and all other collections provide lists of objects. My arrays will contain standard types such as byte, int, float...
As a result if I use a collection there will be a large performance hit (boxing,unboxing,longer value retreval times).
Thanks
Karl Baum
|
|
|
|
|
An array is an IList implementation, which inherits from ICollection which inherits from IEnumerable . As I said - and as you can see in the IL module where ArrayList is defined - the ArrayList (and, hence, any collections that use an internal ArrayList ) - do use arrays that are doubled in capacity before that capacity is exceeded.
There will only be a performance hit if you collect value types (like primatives, not "standard" types). Boxing and unboxing only describes the process that the CLR performs when treating a value type as an object and back again, respectively.
In .NET 2.0, of course, you could simply use List<> to declare a generic list for whatever type, reference or value types.
If performance is a problem now and you can't or don't want to use .NET 2.0 (granted, it's still in beta 1 but beta 2 is due out shortly) than you'll need to use what you're doing now to create arrays. Again, though, I urge that you wrap such functionality in a class. Later you can derive that class from List<> and remove your implementation. Now you won't have to change your calling code. Just make sure to use the same signatures as List<> , which you can find at http://msdn2.microsoft.com/library/6sh2ey19.aspx[^] (the new namespace extension to MSDN2 doesn't appear to be functioning just yet for generics, so I can't give you the simple change-tolerant link).
Basically, you'd just implement your own ArrayList -like class. It's really not hard. If you know IL, use ildasm.exe that ships with the SDK (that's installed by default with VS.NET) or use a decompiler like .NET Reflector to see how ArrayList operates if you can't figure it out based on the documentation. You're already part way there with what you're doing.
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles] [My Blog]
|
|
|
|
|
Thank you for your response,
I understand how all of this works, and was just wondering if c# contained anything I wasn't aware of. It appears I will have to continue doing it as I have been.
ArrayLists and the other collections are simply not appropriate for what I am trying to do. The functionality they provide come with too much of a performance hit. The implementation of ArrayList is significantly different from what I am trying to do. ArrayList's power and weakness come from it being a list of references, and hence you can stick anything in there, at the expense of following the references. What I am looking for is a standard array (one continuous chunk of memory, with only one reference to the array itself).
Thanks for your help and suggestions. Particularly your suggestion for easier transition over to the new capabilities that will be provided by 2.0.
Karl Baum
|
|
|
|
|
Hi All
I am not using the toolbox to place a textbox
Instead i want to generate code for placing the text box on page_load
i used the following code:
Label lblMessage=new Label();
lblMessage.Text="ID";
lblMessage.Controls.Add(System.Web.UI.Control Label);
is there ne other way coz this does not work.
Sukanya
|
|
|
|
|
First of all you have to use TextBox class insted of Label Class and you should set a location for that control in addetion to its dimenssions
Mhmoud Rawas
------------
Software Eng.
|
|
|
|