|
Rebecca Gao wrote:
I'm using a third-Party Grid Control: GridDataBoundGrid control (from Essential Grid). However,
I believe this has nothing to do with my problems.
I disagree: it seems something specific to this control. I suggest you to contact them about this, or if you need a workaround, you can always derive from this control and override the ProcessCmdKey method, disabling the Del key on the grid while you're editing something.
Yes, even I am blogging now!
|
|
|
|
|
Thanks for your advice!
I found that the grid control inherits "KeyPress" event from control.OnKeyPress, which accepts any Key event smoothly unless "Del" (as far as I know), because "Del" is not in ASCII code. As you adviced, I disabled this key, by set "EnableRemove" property as false so "del" key doesn't work. I have to derive this control to use this button.
|
|
|
|
|
I'm a total newbie in the land of C#, Visual Studio, .NET, and all-things-Microsoft. I'm trying to do a number of things with a C# application that has a builtin web browser (AxSHDocVw.AxWebBrowser). Most of the code I've inherited from someone else who knew a lot more about this stuff than I do, so I'm barely treading water at the moment.
If anyone can help shed some light on the following things, I'd be very grateful.
1) Is there a way to control the browser to not display until DocumentComplete has been called (i.e. READYSTATE_COMPLETE)? I want the page to *not* show anything until it's fully loaded, and can't figure out how to do this.
2) Is there a way to modify the UserAgent sent by the browser? Some of the docs have suggested (at least in C++ land) that in the Navigate() method I can postpend to the header argument to add things, such as the user agent. However, I'm not sure that a) this works, or b) what the appropriate syntax is in calling this from C#. I've tried just throwing in a string argument, but am not 100% sure of the syntax, nor did it seem to affect anything.
I've also seen:
http://support.microsoft.com/kb/q183412/
but don't know how I can do something similar in my project.
3) I've tried, unsuccessfully, to make a call to create a desktop shortcut using IWshRuntimeLibrary. Here's my code:
WshShell shell = new WshShell();
IWshShortcut link = (IWshShortcut)shell.CreateShortcut(title);
link.TargetPath = url;
link.Save();
This always throws an exception, even when the app is being run by an administrator account. It's a System.Runtime.InteropServices.COMException, and the message is just "Exception occurred." I took this code directly from:
http://www.codeproject.com/dotnet/shelllink.asp
Any idea what might be going wrong here?
Thanks much. Sorry if these questions are too broad. Let me know if I can be more specific.
|
|
|
|
|
Hi,
I try to access MSAccess database using OleDb, but denied by an error, the message is [Can not find installable ISAM].
Is there any way to install it using c#?
please help if u can..
Thanks
|
|
|
|
|
You don't. This normally means that there is a problem with either your code or your Access installation, MDAC, VB installation, ... Check out this search result[^] on MSDN.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
The problem is that I am sourcing various numbers from a machine. The numbers are like 1.00006587 and 0.000248. The problem is that I need to round off the last decimal so for example if 1.00006587 is given the result would be 1.00007
Help please!
|
|
|
|
|
Math.Round allows you to specify how many decimals to round to.
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
That's correct.
But Math.Round uses the bankers algorithm for rounding. So 3.45 returns 3.4 instead of 3.5.
Be wary of that. If you need to have normal rounding (I mean the one we learn in school) then you'll need to implement your own custom rounding procedure. Which is fairly easy.
Furthermore it's wise that you choose for the Decimal type instead of Single or Double type because these types are approximations and would give rounding errors quite quickly.
Kind regards
Marcel van den Hof
|
|
|
|
|
how do i add shadows to the toolstrip menu
or a button or anything,is there any examples
any where i can look at , im using C# express
please help i have no clue and cant find anything on the subject.
|
|
|
|
|
Hi,
I'm building a very simple mail program, the only required feature is to send mail in html format. That's what i need:
1) A component like a RichTextBox that allows me to edit html files/code in a WYSIWYG way
2) Is there any component that can send a html email with pictures?
Thank u very much,
Dirso
|
|
|
|
|
|
Both has everything i need
Thank u very much,
Dirso
|
|
|
|
|
How do I set the Position of the caret of a Node in a Treeview that's being edited? There isn't a Select() function available like it is with textboxes
|
|
|
|
|
There is nothing in the .NET BCL that will do this. There is no method to call anywhere in the TreeView or TreeViewNode, it's just not supported. I don't even know if the underlying TreeView control that the TreeView class wraps supports it.
You might be able to "fudge it" by getting the handle to the control that holds the text being edited and using the Win32 API SendMessage function call to send it the appropriate messages to position the caret. Don't ask me for details, I can't give them to you. This is all just a theory...
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
ok, it isn't that necassary.
Thanks anyway.
|
|
|
|
|
Darn. It seems that the Node Text can't be changed even after that text has been edited. At least it doesn't work when I do this in the AfterLabelEdit-Event because the new Node text gets assigned after this even or something like that
|
|
|
|
|
Does WindowsPrincipal or WindowsIdentity behave differently depending on whether the code is running in an Active Directory environment or a non-Active Directory environment? e.g. is a WindowsPrincipal always a WindowsPrincipal in any Windows environment?
Michael Hodnick
www.kindohm.com
|
|
|
|
|
I have a window application. I save the form setting to a xml file. everytime if i changed form setting i need to modify the node and save it back to the xml file. all the examples i seen are add node to xml. but what i needed is to change inner text of that node not add one more node append to the end of xml.
How can i do to get what i want?
Tahnks for any suggestion
|
|
|
|
|
Use SelectSingleNode with an XPath to find the node, then set it's value.
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
Hi
I'm trying to add tabs so that each one has a name like this:
tabPage 1
tabPage 2
etc
but if many tabs are opened and closed I don't want the number to go high.
This is what I've got so far:
int i = 0;
string index = "tabPage" + Convert.ToString(i);
if (mainTabs.TabPages.Contains(mainTabs.TabPages[index]))
{
string index2 = "tabPage" + Convert.ToString(i + 1);
mainTabs.TabPages.Add(index2);
}
Thanks for your help
|
|
|
|
|
So i take it you're adding and removing tabs from the tab control, and you want to reuse numbers that have been removed up until the point of adding a new one? Is this correct? If so, couldn't you do something really simple, like create a collection (I.E. arraylist or something a little less intensive), and add numbers to it as they become available. Then remove them when you reuse them. So, you would just have a removetabpage function that would store the number of the tabpage you're removing, say 55, in an arraylist. When you created a new page, you could simply get the first number in the "discarded number" arraylist, assuming there is one, and remove it from the "discarded number" list. I'm sure someone else will have some answer thats a little more efficient, but I think this would work as a simple solution.
|
|
|
|
|
Hi All,
I need to know how can I make a list contorl like of windows explorer. From windows explorer view I mean when we open My Computer a list view is shown and the headers are shown as follows
Files stored on This computer
-----------------------------
(shared documents) (dotnetdocuments)
Hard Disk drives
------------------------------
(C),(D),..........
how can I bring this (Files stored on This computer) or
(Hard disk drives) like title in my List view
regards
|
|
|
|
|
Hi All,
Question regarding splitting a string:
Let's say I have the following format:
[a-zA-Z]*-[0-9][0-9][0-9]-[A-Z][A-Z][0-9][0-9][A-Z]
or in short form, the split would be:
<s1>-<s2>-<s3><s4><s5>
E.g,
ABC-2-725-XY15A
s1 = ABC-2
s2 = 725
s3 = XY
s4 = 15
s5 = A
Note about s1,
it starts with an alpha character and is followed by any string...
there can be dashes and numbers, but there will never be "-[0-9][0-9][0-9]-" sequence in s1 so you'd know where s2 begins
Does anyone have an idea on how to split in such manner?
Thanks,
-Julian
|
|
|
|
|
|