|
Just use the first suggestion: Put a label next to your TextBox, set its Text to something containing "&d" (A&ddress) and assign the tab order to all controls on your form in a way that the label is immediately in front of the textbox.
No additional programming required - works every time.
Oh, and by the way (although I didn't actually try your code) - why are your creating a new Keyboard object? Have you taken a look at the KeyPressEventArgs ? They contain everything you need...
Regards,
mav
--
Black holes are the places where God divided by 0...
|
|
|
|
|
Hi,
Someone asked me to help him with the following piece of software, and I don't know even where to start looking. Will this be a big project?
We’re busy with a project developing a website, the background is the tricky part. We’re supplying a scanner that will scan to a FTP site. That part is the easy one, it can scan in pdf and jpg format. The delivery notes they’re scanning will have barcodes on, we need software to read the barcodes and rename the file names according to the codes.
Regards
ma se
|
|
|
|
|
Hi!
Did you try an article search for "barcode" here on CP? I remember there were quite a few articles dealing with the topic...
Regards,
mav
--
Black holes are the places where God divided by 0...
|
|
|
|
|
Hi
I am trying to get an image from a resource file into a picturebox.
using the following code:
using System;<br />
using System.Collections.Generic;<br />
using System.ComponentModel;<br />
using System.Data;<br />
using System.Drawing;<br />
using System.Text;<br />
using System.Windows.Forms;<br />
using System.Reflection;<br />
using System.Resources;<br />
<br />
namespace WindowsApplication16<br />
{<br />
public partial class Form1 : Form<br />
{<br />
public Form1()<br />
{<br />
InitializeComponent();<br />
}<br />
<br />
private void button1_Click(object sender, EventArgs e)<br />
{<br />
Assembly Massem;<br />
Image Mimage;<br />
Massem = this.GetType().Assembly;<br />
ResourceManager RM = new ResourceManager("WindowsApplication16.PH1", Massem);<br />
Mimage = (Image)RM.GetObject("MIS_1.png");<br />
pictureBox1.Image = Mimage;<br />
<br />
}<br />
}<br />
}
the form has 1 button & 1 picture box.
Resource name is : PH1.resx - inside there is the image file .
the problem :
When the code finsh i get a NULL image.
Please advise.
i used the explanation on the following MSDN:
http://msdn2.microsoft.com/En-US/library/aa984408(VS.71).aspx
Have a nice Day
|
|
|
|
|
Hi!
You have to take care to use the correct name for the resource. Usually you have to prefix the object's filename with the namespace of your application (e.g. "WindowsApplication16.MIS_1.png" or whatever your namespace is).
Regards,
mav
--
Black holes are the places where God divided by 0...
|
|
|
|
|
Hi,
I cant remember all the details, so this is what I do:
- add the image file to the project, set it to "embedded resource"
(you probably did that already)
- use Designer to add some control (say picturebox) that consumes an image,
and set it up to use your image
- now look at the code Designer has generated for you, and copy/paste what you need
- throw away what you no longer need
Works the first time every time.
|
|
|
|
|
Hi,
I have created a class. In that I have written the following code:
I have added the Header file "using Vishal.TextFileUtils"
Vishal.TextFileUtils is the Supporting header file. You can see it( "http://vishalseth.com/blog/2007/02/20/vishaltextfileutils-library-for-working-with-delimited-text-file-formats).
namespace ConsoleApplication12
{
class Program
{
static void Main(string[] args)
{
DelimitedFile df = new DelimitedFile(new FileFormat(PredefinedFormats.CSV), @"C:\GCProject\Input Example.csv");
foreach (LineEntry le in df)
{
Console.WriteLine(le.FieldValues["MyColumnName"]);
for (int i = 0; bool.Parse(df.Count.ToString()); i++)
{
le.FieldValues["MyColumnName"] = "MyColumnData";
}
}
df.Save(@"C:\output.xls");
}
}
}
When Run the application, I found the error like KeyNotFoundError(I have bold where I am getting the error). Which I not able to find what is happening.
So, the general flow for this application is:
1. CSV Input File is created by user or external application
2. My Application reads data in from CSV file
3. My Application converts records from the CSV file to a new format (xls format)
4. My Application outputs to text file.
Please let me know if you require additional information.
Thanks & Regards,
Liyakhat.
Liyakhat Alikhan, Chennai
-- modified at 10:06 Tuesday 10th July, 2007
|
|
|
|
|
So you are asking someone to write this for you?
only two letters away from being an asset
|
|
|
|
|
I am not mean to say like that....
In other site, I have posted the same question. So, He told me to discribe more.
Thanks & Regards,
Liyakhat.
|
|
|
|
|
It is better you try something and post what is your difficulty and there are many people to help you. It is doubt someone can do everything for you.
Also avoid writing mail Id to avoid spam mail.
All the best for your project!!
Best Regards,
Suman
|
|
|
|
|
liyakhat_shahid wrote: 1. CSV Input File is created by user or external application
2. My Application reads data in from CSV file
3. My Application converts records from the CSV file to a new format (xls format)
4. My Application outputs to text file.
Erm... I can do that without writing 1 line of code. Excel will happily open a CSV text file.
Or is this Homework and you just can't be bothered?
|
|
|
|
|
Hi,
I know how to id manuly, but we have to do it programatically.
thank,
Liyakhat
|
|
|
|
|
J4amieC wrote: Or is this Homework and you just can't be bothered?
liyakhat_shahid wrote: we have to do it programatically.
So the answere is, Yes I think!
All the best,
Martin
|
|
|
|
|
Hi J4amieC,
Can you please tell me how to do it programatically. Atleast send related link. I search google but I didn't find any.
Waiting for u r reply
Thanks & Regards,
Liyakhat.
|
|
|
|
|
liyakhat_shahid wrote: KeyNotFoundError
That's your problem, there is no field called "MyColumnName" in FieldValues. Make sure that you type in the correct string here.
|
|
|
|
|
hi all,
i want to make a search dialog in c#, i want to show it with ctrl+F , now i don't know how can i do it .
i mean when i press ctrl+F the dialog should appear .
please tell mehow can i do it.
Praveen Sharma
|
|
|
|
|
Hi,
in your form:
- set KeyPreview true
- install a KeyPress handler, have it check for letter 'f', if so check
CTRL key is down (use Control.ModifierKeys), if so create a new dialog form and
show it with ShowDialog; you may choose an OpenFileDialog or something you
design yourself.
That should do it.
|
|
|
|
|
thanm u very much Luc , may i know , where u from Luc????
Praveen Sharma
|
|
|
|
|
Belgium, Europe, Earth, Milky Way, Universe
|
|
|
|
|
Belgium, (that's to the west of Germany, as you well know).
|
|
|
|
|
Hi!
In addition to what Luc said, it usually is a good idea to not just offer a single way to access a certain functionality, so you could add a menu to your form, add an Edit/Find command and give it a shortcut of Ctrl+F.
That way, the user can either use the menu or the shortcut and you don't even have to care about keyboard preview on your form yourself...
Regards,
mav
--
Black holes are the places where God divided by 0...
|
|
|
|
|
Hi guys!
For showing context-sensitive help in one of my applications, I've created an HTML page with bookmarks for several topics.
In order to show the page, I'm simply using something like
Process.Start(pathToHtmlFile);
Unfortunately, I can't give a bookmark to jump to, because if I do, the path looks something like C:\Program Files\MyApp\AppHelp.htm#icons and therefor windows doesn't recognize the htm extension anymore
Also using file:///C:/Program Files/MyApp/AppHelp.htm#icons instead of the plain path doesn't work.
Any other ideas?
Thanks in advance.
Regards,
mav
--
Black holes are the places where God divided by 0...
|
|
|
|
|
Hi mav,
you could integrate a WebBrowser in your app, and order it to Navigate() wherever
you want.
|
|
|
|
|
I could, but I'd rather use the user's default browser...
In fact (and I'm a little ashamed about it) I had implemented a workaround some time ago, but while testing this app under Vista, the whole thing blew right into my face.
The idea then was to create a temporary html file containing a tiny javascript call to actually navigate to the real URL including the bookmark. This temporary file was called with Process.Start() .
After a 1 second wait I deleted the temp file. (that's the part I'm ashamed about now. The 1 second was hard-coded and isn't enough for Vista to start the browser. I even thought about posting it under WTF).
I _could_ increase the time, but it still feels like a hack.
That's why I was asking for a different way to do it, a cleaner way.
Regards,
mav
--
Black holes are the places where God divided by 0...
|
|
|
|
|
Hi,
if you are willing to spend the effort, here is an idea:
- find out what is the default browser; I think you could do this by using
Process.Start on any html file, then wait for idle, and look at StartInfo.
Or search the registry...
- now for each of your help items, do a Process.Start of the right browser app,
and pass the URL as the first argument. (I am hoping whatever the browser,
it always looks at its command line).
Of course, you could silently combine both methods: first time launch your
help file without bookmark (and note down the app info), later on use the above.
BTW: the WaitForIdle() is also an improvement on your earlier fixed 1 sec delay,
but I did not like your temp file much in the first place...
|
|
|
|