|
thats great advice. I'll try that and let you know how it turned out
|
|
|
|
|
hi,
i have a property grid control... can u plz guide me how to display a set of values in a drop down form in the property grid control. i am using c# windows application.
-- modified at 12:04 Monday 3rd July, 2006
|
|
|
|
|
TypeConverter.GetSupportedProperties()
|
|
|
|
|
I need to be able to grab files from an Windows print queue before they print so I can parse them and perform some data extraction (for a client). I was thinking of writing a small piece of code that constantly checks the print queue folder in windows for new files, however from my understanding the files in there are temporary and slowly go down to zero bytes as windows streams the data to the printer for printing. . Is there anyway i can pause the print queue or make the files stay persistant in there for a timeperiod long enough for me to be able to copy them regularly ?
My other option i suppose would be to make a printer driver that captures the files and parses them, but thats gonna be much more complicated and not something i really know how to do.
Thanks for the input
|
|
|
|
|
I hope that all your doing is parsing a straight text file. If not, you'll find this to be very nearly impossible to do.
Your other problem is parsing the files in the print queue. Since various print drivers and setups can generate different language for those files, you'll have to write parsers for them to get the data you want. You'll have to identify whats in the file first, then call an appropriate parser, that you have to write.
For example...A dot-matrix printer can handle wither straight ASCII text to print a page, or it can handle the page sent as an image. This would be thousands upon thousand of pieces of data describing the image. You'll have to use some kind of OCR algorithm on the page to get the data you want.
Now, laser printers can complicate the thing even more using various print processors and dataformats, like RAW, Postscript, PCL, EMF, ... Are you going to write parsers for each of these formats??? I doubt it...
Basically, what you want to do just isn't practical. There has to be an exasier way to get the data you want without jumping into this monstrosity...
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
I have written an app that takes user input from a richtextbox and stores it in a database. So far, everything is working great, with one exception. i can copy and paste an image into the box, but once it is saved, the image is gone. Now, i have looked at the rtf markup that is generated, and it seems to have the opening and closing tags for the image, but it does not appear to switch the image over to base 64 encoding, which is how they appear to be saved when using Wordpad.
is there a setting for the richtextbox control to capture an image as part of the document?
______________________
Mr Griffin, eleventy billion is not a number...
|
|
|
|
|
Now i am doing projects in VS 2005.(Windows application).
I have datagridview in my application,that contain one checkbox column and some data coloumns.
Now i check few rows in check box coloumn.Then when i click any other coloumn header,all rows are automatically sorted,and all rows in check box coloumn are unchecked.But i want to retain the selected values after sorting is done.
for example,
In datagrid I have two column.
Column name Type
Select -- checkbox column
Store ID-- integer valus
Now i select few rows in checkbox.then I click StoreID column header.
now the rows are sorted based on store Id and all rows are unchecked.but i want to maintain the checked status of stores to true, which is selected by me before it is sorted.
can u give any solution for my problem.
|
|
|
|
|
i am working on c# & asp.net platform
As we see in sites when we open aspecific site automatically someother advertisement page popsup.
The same functionality i want to use in the following scenarios:
1.when a user clicks on a button (which is used to display a calender),so the calender should pop-up within that page.
2.similarly i must be able to popup any other page
Also helpin this scenario:
suppose there is page called index.aspx,which has 3 links.
when a user clicks in each of the three links three windowspopsup,but once the user closes the index.aspx page all the popupwindows must automatically get closed.
pl kindly helpme
arun
-- modified at 11:09 Monday 3rd July, 2006
|
|
|
|
|
If you wan the popup windows to close along side the parent page it sounds as though you may want DHTML windows. Here is a great tutorial of various types of DHTML windows: http://www.brainjar.com/dhtml/drag/
In order to invoke the windows you can make the links .NET linkbutton controls. linkbuttons have a property named OnClientClick that accepts a string of client side code that runs when the user clicks on the linkbutton.
e.g. <asp:linkbutton onclientclick="window.Open();" ;="" runat="server">. I hope this helps.
|
|
|
|
|
I am working on a project
i have created 3 tiers:
presentation layer
datalinklayer
business logiclayer
i have a dropdownlist named Category_List resides in my login screen.I want to dynamically add the items to it .so i created a table called type which has a single field called Category.
now i want to bind my backend sql server with my application.
i am able to do it staight away in my asp.net application but what i want is that the connection string should be in a class file ,while the page loads the method that contains the connection string should be called and the items must get filled in my Dropdownlist.
iam unable to do it inthe class file,pl help me in doing so with helpof an example.
thank u
arun
|
|
|
|
|
Hi, I am currently making a application that converts different audio files. I am having trouble converting MP3 to WAV though. Can anyone please help me? Thanks.
Hengy
I like Pie
|
|
|
|
|
|
How can i encript my database (Access)???
thanks
|
|
|
|
|
You're going to have to be more specific than that. How does this question relate to your code? Are you looking to encrypt certain fields?? Entire tables?? The whole database? Right now, all anyone can do is refere you to the Tools menu in Access, Security -> Encrypt/Decrypt database.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
i want to encript whole database, and im looking forward for another method except that method which access DB recommended.
thanks
|
|
|
|
|
hello everyone!
i'm trying to write very simple application for composing music in c# using directsound. it's based on the following example: http://www.codeproject.com/dotnet/A_Simple_Beep.asp
currently i have rewritten the code for generating sine wave of specified pitch and length and outputting it to the directsound output (instead of calling the win32 api beep function). the GUI has remained the same.
what i want to do now is create very simple 'piano roll' control where user could draw/modify/delete notes (instead of using the unhandy listview control). any ideas how to do that? i think the first is should do is draw grid of certain size onto some container control (like panel), then draw squares of specified size (they represent the notes) and make them fit to grid. the most difficult part would be to let the user draw/modify these notes.
i do not think that someone has ever written piano roll control in c#. however it might be the case that someone has written some other type of control which involves drawing grid and drawing squares onto it.
|
|
|
|
|
Drawing a grid should be pretty simple. If you haven't written drawing code in .NET before, search for articles on GDI+ and that should get you started. If I were you, I'd create a class which represents a "strip" on the piano roll. That class would contain the note(s) to be played during that time slice. Once you have that created, put the rendering logic for a "strip" within that class (or a class that is responsible for rendering a strip). Then create another class which manages the strips and tells them to render next to each other. That way, you are not drawing a master grid and then overlaying the notes onto it, but, rather, creating a grid that is a composite of individual smart pieces.
Just my 2 cents.
:josh:
My WPF Blog[^]
|
|
|
|
|
It is always the simple things that get ya'. Is it me or does MS INSIST on making the easy things hard to do? All I need to do is increase the fontsize of a control. Seems I should be able to just add to the current fontsize, but of course I am not allowed to do that. Oh by the way I can't use the Font Dialog.
Here is what I've come up with. Anyone have any better ideas?
private void button3_Click(object sender, System.EventArgs e)
{
System.Drawing.Font currentFont= listBox1.Font;
FontStyle fs= currentFont.Style;
switch (currentFont.Size.ToString())
{
case "8":
listBox1.Font = new Font(currentFont.FontFamily, 10, fs);
break;
case "10":
listBox1.Font = new Font(currentFont.FontFamily, 12, fs);
break;
case "12":
listBox1.Font = new Font(currentFont.FontFamily, 15, fs);
break;
case "15":
listBox1.Font = new Font(currentFont.FontFamily, 8, fs);
break;
}
}
Thanks in advance.
WhiteWizard(aka Gandalf)
|
|
|
|
|
If you want to increase fontsize, then see this:
float fontsize = this.listBox1.Font.Size;
fontsize++;
this.listBox1.Font = new System.Drawing.Font("Microsoft Sans Serif",
fontsize,
System.Drawing.FontStyle.Regular,
System.Drawing.GraphicsUnit.Point,
((System.Byte)(0)));
|
|
|
|
|
Thanks!
I combined your code with mine and got just what I needed. Here's what I ended up with:
private void button3_Click(object sender, System.EventArgs e)
{
System.Drawing.Font currentFont= listBox1.Font;
FontStyle fs= currentFont.Style;
float fontsize = this.listBox1.Font.Size;
fontsize++;
if (fontsize > 20)
{
fontsize = 8;
}
listBox1.Font = new Font(currentFont.FontFamily, fontsize, fs);
}
Gandalf
|
|
|
|
|
Hi,
I am trying to drag files from windows explorer and openFileDialog box to the datagridview in c# 2005. I am able to drag files from windows explorer but i am not able to drag files from the openFileDialog box which invoked by my application through a button.Why it is happening like this and how can i fix this ?
Thanks in Advance
Phanindra...
|
|
|
|
|
The OpenFileDialog is most probably a modal dialog. Your application will not react to mouse or keyboard input or, in this case, to darg-and-drop events.
Is there a reason why you won't let the user select files in the OpenFileDialog and wait till he/she presses OK?
-- modified at 8:26 Monday 3rd July, 2006
On second thought, what I wrote above is complete nonsense . I just remembered I did something similar in one of my applications. You can drag files out of your OpenFileDialog just the same as out of, say, Explorer. You can use one and the same DragDrop event handler.
Maybe you should post the code of your DragDrop event handler so we can take a look.
|
|
|
|
|
Hai,
Thanks for ur reply.
Here is the code for the drag drop event handler for the datagridview.
private void dataGridView1_DragEnter(object sender, DragEventArgs e)
{
e.Effect = DragDropEffects.Move;
}
private void dataGridView1_DragDrop(object sender, DragEventArgs e)
{
string[] files = (string[])e.Data.GetData(DataFormats.FileDrop);
addFiles(files);//this method adds files to the datagridview
}
and i set datagridview property AllowDrop to true
what else i should do.
Phanindra...
|
|
|
|
|
I can see nothing wrong with this code. And you say that this code DOES work when you drag from Windows Explorer and NOT from the OpenFileDialog?
Have you placed a breakpoint in the method dataGridView1_DragDrop to see whether this method gets called at all. I just want to be certain the problem does not occur further on, for instance in "addFiles".
|
|
|
|
|
Yeah, i placed a breakpoint in the dataGridView1_DragDrop method and tested it. But the method is not invoking when files are dragged and dropped from the openFileDialog box.
Phanindra...
|
|
|
|