|
No, not index.
code and Description can be
167 - Employee
256 - Administrator
234 - Customer
So what I am displaying on the leaf node in above information. But when any of above node is selected, I want to get 167 or 256 or 234 as the value. LIke in combobox, we set Display member and valuemember.
Rigth now I am tokenizing the leaf node upon selection as -
dealNo = dealNo.Substring(0, dealNo.IndexOf("-", 0));
to get the reqired piece of information.
|
|
|
|
|
The MenuItem isn't a data-binding control like the ComboBox . What you see is what you get - there is nothing "behind the scenes" that track information like this. That doesn't mean you can't add it, though. Extend the MenuItem class with your own and add a property to hold this information. In the MenuItem.Click handler elsewhere in your code, you cast the sender (the first parameter) to your MenuItem derivative class and get the value of that property.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Thanks for prompt response. You are a genius.
Ruchi
|
|
|
|
|
Just wondering if its possible to create a web page snapshot with C#. Check this example:
http://www.pcworlddownload.com/internet/browser-utilities/IESnap.htm
This tool adds a button to IE toolbar and when clicked it saves the web page as png file.
I'm working on a similar project but can't solve this part.
Any help is appreciated.
Thanks.
|
|
|
|
|
One way is to use IExtractImage , a shell interface in Windows XP and higher. There is an article that describes it at http://www.vbaccelerator.com/home/NET/Code/Libraries/Shell_Projects/Thumbnail_Extraction/article.asp[^] using VB.NET, but most everything is calls on the FCL and your own interfaces anyway, so it shouldn't be hard to translate. I wrote some code that works in a similar fashion a while back, but my computer isn't currently generating previews for HTML (hasn't for a while) so I can't gaurantee it works correctly).
Another way would be to supply an HDC for an image that IE would use to print to instead of a printer HDC . Off the top of my head, though, I'm not sure how you'd do this.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
The following article (by me ) may be helpful to you.
http://www.codeproject.com/miscctrl/viewobjsnap.asp?target=viewobjsnap#xx731389xx[^]
You'd have to do COM interop from C# to use this method.
I'm not aware of a more IE-specific solution to this problem. In addition, in the intervening 4 years since the article was written, the IE COM interface may actually have started exposing the functionality you want. I'm not sure, though...
Russ
--
Russell Morris
"So, broccoli, mother says you're good for me... but I'm afraid I'm no good for you!" - Stewy
|
|
|
|
|
He asked this question some time back, too. Several of us suggested taking a screen shot (easy enough with code) but he didn't want that. Isn't that pretty much what you're doing in yours (since Draw wouldn't/shouldn't paint hidden regions)? You probably weren't aware that he asked before and that screen shots wasn't what he wanted, but I'm just trying to clarify what I gathered from your article.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
IIRC you can tell Draw how much to draw (ie in what bounds). However, it's still just a screenshot with a few bells-n-whistles, as you point out. Since HTML is inherantly non-paginated, I'm not sure how much better you could do than that. I wonder if the 'Preview' functionality of explorer could be harnessed somehow for this?
--
Russell Morris
"So, broccoli, mother says you're good for me... but I'm afraid I'm no good for you!" - Stewy
|
|
|
|
|
To print a document to an image is what I was getting at in my reply above. Windows Explorer also uses an IExtractImage implementation that it gets from the shell object (like an HTML document) that it displays in the preview screen at the left in XP. So, yes, it does have this functionality. Getting it to work in .NET is tricky since you have to re-declare a bunch of interfaces and their dependent structs and enums.
There's also a way to create a "printer" that provides an HDC attached to the right information and have it print to an image (Office 2003 comes with one). This tool he mentions may do something similar (I'm not about to download it). There's other ways that you can have IE paint to an HDC you provide, but I can only find this for IHTMLPainter implementations that are implemented by binary behaviors (so they are in-place elements).
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
i'm trying to connect using HttpWebRequest class, but i'm getting a 401. i read in the documentation that i need to check the WWW-Authenticate header to see how to perform authentication. the info in the header is "Negotiate,NTLM". do i pass this string into the second param of CrendentialCache.Add()?
|
|
|
|
|
See the documentation for the Credentials Property[^] in the .NET Framework SDK for more information and an example. You don't need to handle the authentication headers yourself, merely pass an ICredentials implementation like the NetworkCredential class. This can already handle basic, digest, HTLM, and kerberos authentication.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
My problem is that the key message must be caught in the DataGridTextBoxe`s TextBox which is read only and can not be assigned to which means the Key Events can not be caught due to protection level.
I tried doing it by adding an inner TextBox control to the TextBox but I am having problems with this solution and there must be a more elegant one.
|
|
|
|
|
Instead of trying to change the Enter key to the Tab key, just make then do the same thing. Handle the Enter key and perhaps use the Select Method[^] on the DataGrid or something similar.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Hi , Still Not Working
The Enter Key does not raise the KeyPress,KeyDown or
KeyUp events so it is not working.
Thanks for the attention.
|
|
|
|
|
Then try something different, like overriding ProcessDialogKey . Worst case scenario is that you'll have to extend DataGridTextBoxColumn and override the WndProc for the actual TextBox that's used (assuming its protected and the property is virtual, otherwise you'll have to make your own) and handle the key strokes accordingly.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Thanks Heath I will try that.
|
|
|
|
|
I have four mdi child forms on a mdi parent. I cannot find a way to disable the moving of these child forms. I can move them clicking the left mouse button and dragging the form to a different location. It seems like I am dragging and dropping the child forms but I do not get any drag or drop events. Can anyone tell me how to disable the movement of child forms, and how I can catch the movement if I allow it?
Thanks in advance
|
|
|
|
|
Moving a window is not a drag and drop action, as in dragging files and other objects. It's simply a windowing action that updates the coordinates, invalidates the necessary regions, and re-paints the form and the old background region. No DND events would be fired.
If you don't want your MDI child windows to be moved, then you probably shouldn't be using MDI. The whole purpose of MDI is to have child windows within a parent window that act like any other windows. The only way to disable movement is to handle the mouse events and while the mouse is down, retain the coordinates in the MouseMove event, which isn't easy. You can also override WndProc and handle the windows notification messages, canceling them if possible (and it isn't always possible). For this, you need to read about the Windows Management APIs in the Platform SDK at http://msdn.microsoft.com/library/en-us/winui/winui/windowsuserinterface/windowing.asp[^].
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
I've written a fairly complex MDI app and I cannot think of any instance where movement of the children bothered the app. However I definitely did not want my menu selector, etc. being played with. To handle those forms within the MDI parent I used docking controls......but then they do not become MDI children and an exception would be thrown if they were set to be children.
If you were using an MDI parent for specific placement of forms for multiple displays....for example the upper left window shows all processes running on a selected server while the upper right window shows processor availability and below these two are all possible servers to select from....then an MDI parent was not a good design choice.
In the prior example you can get a better UI by dumping the MDI parent, placing panels on the parent form where you want specific windows, build out each 'window' as user controls, and then at startup populating the panels with the controls.
Now you have the advantage of MDI children (each control manages itself) and you cannot move the 'windows' around anymore.
Not sure if this helps -- if not provide more details on what you are doing and I'll see if I can help.
_____________________________________________
Of all the senses I could possibly lose, It is most often the one called 'common' that gets lost.
|
|
|
|
|
does anyone know of a dll that would convert mp3 to cda, or something else that would help me with that.....Thank You
Da Intern
|
|
|
|
|
Not entirely sure, but you may want to try directX - there is plenty of functionality to use filters to compress/decompress different multimedia types.
Peter
|
|
|
|
|
When i make a reference to excel it works fine, but when i try to make one to outlook or office i get the following error:
"A reference to "'officePath'.Outlook.exe" could not be added. This is not a valid assembly or Com Component. Only components with extensions 'dll' and Com Components can be added. Please make sure the file is accesisble and that it is a valid assembly or com component"
I am using Office 2003 professional.
Does anyone know how to fix this??
|
|
|
|
|
When you want to connect to Outlook, using the add reference in Visual Studio, and point to Microsoft Outlook 11 (which isnt the outlook.exe).
If I was at home, I could give you the full details, but I am pretty sure you cannot directly connect to the Outlook executable.
|
|
|
|
|
You should install the Visual Studio Tools for the Microsoft Office System, which comes with O2K3 Pro I believe. You can download the Office XP PIAs (primary interop assemblies) which you should use as opposed to making your own. These are verified assemblies that are associated with the COM components and typelibs typically produced by the company that wrote the application that you're interop'ing.
The Office XP PIAs can be downloaded from http://www.microsoft.com/downloads/details.aspx?FamilyId=C41BD61E-3060-4F71-A6B4-01FEBA508E52&displaylang=en[^] and should work in a pinch (since properly-written COM is mostly backward compatible). The Office 2K3 PIAs cannot be downloaded (except through MSDN Subscriptions), but should be on the O2K3 Pro CD.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
refer to the link below
http://support.microsoft.com/default.aspx?kbid=327823#1
using System;
using System.Windows.Forms;
public class MyTextBox :System.Windows.Forms.TextBox
{
// Override IsInputKey method to identify the Special keys
protected override bool IsInputKey( System.Windows.Forms.Keys keyData )
{
switch ( keyData)
{
// Add the list of special keys that you want to handle
case Keys.Tab:
return true;
default:
return base.IsInputKey(keyData);
}
}
}
Based on the sample above, I've managed to modify and fire KeyDown Event for textbox, combobox, checkbox, datetimepicker, etc...
except NUMERICUPDOWN.
how to make it work??
|
|
|
|