|
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...
|
|
|
|
|
Does your DragEnter event handler get invoked? What kind of cursor do you get when you drag from the OpenFileDialog and what kind when you drag from Windows Explorer?
|
|
|
|
|
no DragEnter event handler is not invoked for openFileDialog Box. I am getting a rectangle cursor with the pointer when dragged from windows explorer and default cursor like circle with a bar in it when dragged from openFileDialog box
Phanindra...
|
|
|
|
|
I think I know what's going on. When I tested my own application I noticed something strange. When I drag from Explorer, the individual controls in my application react to drag-drop events. However, when I drag from an OpenFileDialog the controls do not respond, but the Form they are on does! (I should mention that in my case the Form happens to have AllowDrop set to true.)
What you can do is to add event handlers for DragEnter and DragDrop to your application Form. In these event handlers check which control the mouse cursor is on (e.g. using the position given in the DragEventArgs) and re-route the event to that control.
|
|
|
|
|
Actually the thing is here that i am using windows user control. But still DragEnter and DragDrop events are not invoked in my application. I made AllwDrop of user control to True. But no use.
Phanindra...
|
|
|
|
|
It seems the application Form is the only "control" that is able to receive drag-drop events when an OpenFileDialog is open (with the OpenFileDialog belonging to that application). If you do not "own" this Form, for instance if you are developing a user control for distribution, then I'm afraid you can't do what you intent to do. Sorry .
|
|
|
|
|
Thats OK. Thanks U. Thanks for ur cooperation
Phanindra...
|
|
|
|
|
how to convert a contents of datagrid to excel sheet in c#.
Prya
|
|
|
|
|
So...let me get this straight.
You posted this EXACT same message about 1/2 an hour ago, got a response in something like 7 minutes, but posted again....why? Didn't like the response? Didn't understand the response? Did you READ the response?
|
|
|
|