|
Just make break point in the C# class. Run the Vb application and the application will
halt on the break point.
you can debug it as regular .net code.
Rahul Kulkarni
|
|
|
|
|
Attach the debugger to the program being run, and then you can set a breakpoint, etc.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
i attached the debugger as well but it is giving me the out put directly it is not stopping at the break point..
bharath.s
|
|
|
|
|
I want to get and set the location of dockable window, when it is not docked to any side (when dock = none). I am not getting x, y coordinates of dockable windows when it is not docked to any side, coordinates are coming as 0,0
Any Ideas?
Thanks
kumar
|
|
|
|
|
I have embedded an XML in my application.I am able to read the XML but when i try to write on the embedded XML. It gives an error message which says: "Stream isnot writable".
Any idea on how to write in an embedded XML.
Also code on VB.Net appreciated.
Thank You!
X
|
|
|
|
|
You can put the XML in your properties for the app, then you can save them back out. If you embedd a resource, you can't write to it, that would mean an exe would have to write on itself.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
If that makes any sense...
I have a textbox to the left of a richtextbox. The textbox displays line numbers of the richtextbox. As you type into the richtextbox, line numbers appear in the textbox. If you type beyond the limits of the form, the numbers continue to roll with the flow, so to speak. However, if you scroll back up in the richtextbox, the textbox doesn't follow. How can I lock the two together so they move with each other up or down?
|
|
|
|
|
What have you already done ? It seems to me that there's no 'lock' property, you need to write the code to do it, so you need to post the code you've written so we can see what's wrong with it
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
I haven't written any code for "locking" the two together. I have searched for relevant code snippets and ideas to do this, but haven't found any. I'm not asking anyone to write it for me -- I can't learn this stuff if every time I need help someone just does it for me. I just need some pointers.
Thanks...
|
|
|
|
|
"If you type beyond the limits of the form, the numbers continue to roll with the flow, so to speak."
How is this working then ? Or did I misunderstand and this is a description of what you want, not what you have ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Ah, ok...I misunderstood what you were asking. See the code below that creates the line numbers in textbox1:
Here's the code that does the work:
private void updateNumberList()
{
Point pos = new Point(0, 0);
int firstIndex = richTextBox1.GetCharIndexFromPosition(pos);
int firstLine = richTextBox1.GetLineFromCharIndex(firstIndex);
pos.X = ClientRectangle.Width;
pos.Y = ClientRectangle.Height;
int lastIndex = richTextBox1.GetCharIndexFromPosition(pos);
int lastLine = richTextBox1.GetLineFromCharIndex(lastIndex);
pos = textBox1.GetPositionFromCharIndex(lastIndex);
textBox1.Text = "";
for (int i = firstLine; i <= lastLine; i++)
{
textBox1.Text += i + 1 + " \r\n";
}
}
Here's the code that calls it:
private void richTextBox1_TextChanged(object sender, EventArgs e)
{
updateNumberList();
}
|
|
|
|
|
OK - the problem is probably to do with GetCharIndexFromPosition. I don't see why you're doing that. You should be able to get the index from the cursor position, which is retrieved from the selection start property. If you step through the code when you step back, you should see which line is not giving the value you'd hope, but I do think that's the way to get the correct index, all the time.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Instead of scrolling the textbox, find the number of the first visible line in the richtextbox.Say if it is 15 and the text box can show only 'n' numbers,
textBox1.text="";
for i=15 to 15+n
textBox1.Text+=i+"\n";
Regards,
Arun Kumar.A
|
|
|
|
|
Hi!
I'm not sure if I understand correctly what you try to achieve, but there a quite useful article about line numbers for the RichTextBox[^] here on CP.
Regards,
mav
--
Black holes are the places where God divided by 0...
|
|
|
|
|
Hi,
I'm trying to write an app which will backup the contents of a USB
stick.
I want the setting screen to give the user the option to select
the types of files to backup.
Is there a way to say select only files of type text
without hardcoding the various extexsions like .txt .doc etc
Am i clear ?
Thanks
|
|
|
|
|
You can use File.GetFileExtension to get the extension of a filename that was selected. You can take any string you want and iterate over the files in a folder, looking for that extension.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Hi thanks for the reply.
That's what i'm doing now.
I'm using this:
<br />
DirectoryInfo dir = new DirectoryInfo(drive_letter);<br />
fi = dir.GetFiles();<br />
foreach (FileInfo f in fi)<br />
{<br />
if (f.Extension == ".txt") <br />
f.CopyTo(sBackupLocation + "\\" + f.Name); <br />
}<br />
But the way i see it is; if i want to add another type of 'textproccessing' file
such as .doc then i'd have to add an extra condition in the IF statement to include
this extension.
I was thinking of giving the user the option between broad catagories of file like:
'picture files' - encapsulating .jpeg, .bmp, .tif, .gif and so on.
i just thought there would be a more simple way that having to include all the various extensions.
Thanks again
|
|
|
|
|
Don't forget to do ToLower on f.Extension, so it's not .TXT. And, the change to make, is to have a collection of extensions and then do extensions.Contains(f.Extension). You can then dynamically add all you want to.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Hi,
you can try to recognize text files like this:
- read the first few hundred bytes;
- first assume it might be 16-bit characters as in Unicode; UTF8 and UTF16 encoded
files start with particular byte values.
- if not, assume it might be 8-bit characters and check the first bytes for
non-printable chars (mainly zero).
You may want to exclude some files you consider text but not source, typically
because they are output files from a program you could run again
(e.g. a cross-compiler listing, maybe a big log file, ...).
Such exclusion could be extension based.
|
|
|
|
|
*grin* I think you misunderstood the question.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
No I dont think so, in backup applications it is important to copy all source files;
buying/downloading a new app that uses new extensions is fine, as long as you dont
forget to add the new extensions to the backup utility, unless it recognizes
texts all by itself...
Of course for non-text files, it does not help. From a later post the OP wanted to recognize all kinds of images without using the extension; for this I have no solution whatsoever. Do you ?
|
|
|
|
|
No, I don't see any way he can automatically find them without *ever* specifying the extensions.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Hey All,
Thanks for the suggestions (especially the ToLower one, i would have def. forgotten that one).
I guess it looks like i'm gonna be coding them in myself then. I was thinking along the lines of the windows file search dialog in which you can select the broard reanges of file types. Oh well.
Thanks again.
|
|
|
|
|
i am using picturebox to create visual buttons, but i want the picturebox has tabstop property, how can i do?
|
|
|
|
|
Use a button and set it's image to be the image you want to show.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|