|
In TextBoxBase class.
Best regards, Alexey.
|
|
|
|
|
I have a listview control on a windows form, that is populated with data from the database. How do I ensure that the scrollbars of the listview are always visible, even when the contents are smaller than the control size. If any code could be provided, this would be appreciated.
Thanks in advanced.
listview scrollbar
|
|
|
|
|
I want to use a .vb file in my c# project. Is that allowed? I added one and it does compile, but I don't know how to access the methods in the .vb file.
Can someone tell me if what I'm trying to do is even possible?
Thanks
Joe
|
|
|
|
|
Put the vb files in a seperate project in your solution and compile them as a seperate dll. Add a reference in your c# project to the vb project and you should be able to use all the classes in the vb project.
|
|
|
|
|
Wjousts option is a good one, but another option is to convert the VB file to C#. Google on VB to C# converters and find one you like (we have one also).
David Anton
www.tangiblesoftwaresolutions.com
Instant C#: VB to C# converter
Instant VB: C# to VB converter
Instant C++: C# to C++ converter and VB to C++ converter
Instant J#: VB to J# converter
Clear VB: Cleans up VB.NET code
Clear C#: Cleans up C# code
|
|
|
|
|
Thanks for the input. I went with the option to compile the vb code as a DLL. The reason I chose this option is that the code is used to generate a unique hash and I don't trust a code converter to produce the exact data structures used in the vb code. I'm probably just being paranoid though
|
|
|
|
|
My program reads ID3v1.1 tags from an mp3 file. It works fine except that the 'whitespace' padding between tags is also saved, and I can't figure out an easy way to get rid of them. I was using the .Trim method, but it is not working. I loaded up the mp3 file in a hex editor and found that the whitespace is saved as '00', while a 'space' character (like you get from the spacebar) is saved as '20' and this is probably what the .Trim method is trying to get rid of. Is there an easy way to remove all '00' characters from a string? If I display the string in, for example, a label, they are not shown, however, they are definitely stored there as looking at it in a propertygrid shows.
Thanks for the help.
|
|
|
|
|
Have you tried this?
String delimiters = " \0";
tag = tag.Trim(delimiters.ToCharArray());
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
Just tried it and it works perfectly. Thanks a lot!
|
|
|
|
|
Or simply:
tag = tag.Trim(' ','\0');
---
b { font-weight: normal; }
|
|
|
|
|
Hi everybody,
I'm trying to make the bindingnavigator work but I could not find documentation or examples. I want to bind the bindingnavigator to the rows of my datagridview. If this might not be possible via databinding an example of another way would be more than welcome.
Loads of thanks for your assistance,
Elvia
|
|
|
|
|
Bind the grid and the bindingnavigator to a BindingSource component. The BindingSource orchestrates the binding for all things bound to it. Check out this article[^] to see an example.
Josh
|
|
|
|
|
That was what I needed. I already solved it.
Thanks a lot Josh!
Elvia
|
|
|
|
|
Hello,
If I have a label in the edit mode, and the user makes a text selection, is there a way to capture the selected text only. There is an attribute on the text box that does that.
Thank you
|
|
|
|
|
There are a couple of problems here.
1) As far as I know (and I could be wrong) there is no way to get a reference to the edit window hosted by a node in edit mode. If that is the case, then getting the selected text in a node's label is not possible, at least not via the edit window (aka text box).
2) What event(s) would be used to determine when to grab the selected text? What would trigger the logic to get the selected text in the node's label, when the mouse moves or clicks? when a key is pressed? etc.
BTW - the TextBox class offers the SelectedText, SelectionStart and SelectionLength properties, which can be used to get/set the selected text in the control.
Josh
|
|
|
|
|
I am dealing with the TreeView, and TreeNodes, so TextBox is not an option.
Thank you for your reply
|
|
|
|
|
Oh, I misunderstood your question. Sorry about that!
However, point (1) of my original response still applies. The TreeView does not expose a reference to the edit window used by nodes. Also, it does not expose a property similar to the SelectedText property of the TextBox.
HTH
Josh
-- modified at 13:51 Wednesday 10th May, 2006
Actually, point (2) of my original response still applies as well. I guess I did understand the question. What you could do, if you really need to know the selected text, is have the user edit a node's text in a TextBox control elsewhere on the Form. That would allow you to have fine-grained control over the editing process. The TreeNode class exposes the BeginEdit and EndEdit methods which provide programmatic control over edit sessions.
|
|
|
|
|
|
Hi
I've got an XML file that has a namespace set which is constant throughout the document.
I've used an XmlNamespaceManager to add an alias for the namespace that I can use in the XPath queries. Currently I have to add the namespace to every part of the XPath query (eg. /ns:foo/ns:bar/ns:wibble/@attrib).
Is there a way to set the default namespace (the nsManager.DefaultNamespace currently says '') so that my XPath query would then just be /foo/bar/wibble/@attrib?
|
|
|
|
|
Not as far as I know, I have come across this issue too. You write a little utility function to convert that to the "namespaced" mode (string.Split('/') ).
|
|
|
|
|
Is it possible to do something like the following?
class x
{
public x(string y)
{
if ( y == "" )
else
}
}
I can just throw an exception, but I would like the program to continue running, if possible, without try/catch statements...
|
|
|
|
|
You can throw an exception in the constructor to prevent the object from created. Other than that, no, there is no way to evade instantiation from within a constructor.
Josh
|
|
|
|
|
Damn that was fast!!
I've just finished editing my post and BAM! A reply!
Well... Thank you very much...
Shy.
|
|
|
|
|
One way you could do something like that might be to have a static method in your class and use that to instantiate your class (or not). Something like this:
public static MyClass GetMyClass(string y)
{
if (y != "")
return new MyClass();
else
return null;
}
I *think* that if you have a private constructor and you put the public static method in the same class you'll still be able to instantiate through the static method but won't be able to do it directly which I think give you what you need.
|
|
|
|
|
Wjousts wrote: I *think* that if you have a private constructor and you put the public static method in the same class you'll still be able to instantiate through the static method but won't be able to do it directly
Yes, that is correct.
---
b { font-weight: normal; }
|
|
|
|