|
I got it to work like this:
private void PlayList_CellClick(object sender, DataGridViewCellMouseEventArgs e)
{
if(e.Button == MouseButtons.Right)
{
Point loc = new Point(e.X, e.Y + PlayList.ColumnHeadersHeight + (PlayList.Rows[0].Height * e.RowIndex));
PlayListMenu.Show(PlayList, loc);
}
}
Is there a better way? Know of the right way?
The best way to accelerate a Macintosh is at 9.8m/sec² - Marcus Dolengo
|
|
|
|
|
You have achieved what you wanted to do for now. The function Control.PointToScreen() and the corresponding counterpart will be helpful at other times.
|
|
|
|
|
I have created my own ribbon in Excel and placed a button inside it. How can i invoke say another tab (home tab) using my button? In C++, we are supposed to get the handle of the application first and then call its methods. I do not know how to do it in C# code. Any help will be appreciated.
|
|
|
|
|
post the message in the c++ board
|
|
|
|
|
|
i want 2 BinaryWriter for a file, is it possible ? i tried with this code, but everytime it gave error that file is being use by other process, here is code :
BinaryWriter bw = new BinaryWriter(new FileStream(textbox1.Text, FileMode.Create,FileAccess.Write,FileShare.Write));
BinaryWriter bw1 = new BinaryWriter(new FileStream(textbox1.Text, FileMode.Open));
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L
%^]*IRXD#@GKCQ`R\^SF_WcHbORY87??6?N8?BcRAV\Z^&SU~%CSWQ@#2
W_AD`EPABIKRDFVS)EVLQK)JKSQXUFYK[M`UKs*$GwU#(QDXBER@CBN%
Rs0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-i?TV.C\y<p?jxsg-b$f4ia>
--------------------------------------------------------
128 bit encrypted signature, crack if you can
|
|
|
|
|
Simple, they both need to have FileShare set:
BinaryWriter bw = new BinaryWriter(new FileStream(textbox1.Text, FileMode.Create,FileAccess.Write,FileShare.Write));
BinaryWriter bw1 = new BinaryWriter(new FileStream(textbox1.Text, FileMode.Open, FileAccess.Write, FileShare.Write));
My current favourite word is: I'm starting to run out of fav. words!
-SK Genius
Game Programming articles start - here[ ^]-
|
|
|
|
|
ohh...i thought just 1 need to share, thanks
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L
%^]*IRXD#@GKCQ`R\^SF_WcHbORY87??6?N8?BcRAV\Z^&SU~%CSWQ@#2
W_AD`EPABIKRDFVS)EVLQK)JKSQXUFYK[M`UKs*$GwU#(QDXBER@CBN%
Rs0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-i?TV.C\y<p?jxsg-b$f4ia>
--------------------------------------------------------
128 bit encrypted signature, crack if you can
|
|
|
|
|
Hi Guys. I have just spent about 5 hours searching the web trying to find a solution to my problem. I am busy with a project where I am writing data to an Excel file. This works fine. I then want to save the Excel file to a pre-selected directory which the user select using the folderBrowserDialog. Now, I need to know how do I then save my file to the directry selected. I am displaying the Selected path in a txtbox. I only want to save the file to this directory.
follderBrowserDialog code:
private void btSelectDirToSave_Click(object sender, EventArgs e)
{
if (folderBrowserDialog1.ShowDialog() == DialogResult.OK)
{
txtboxSelectExcelDir.Text = folderBrowserDialog1.SelectedPath;
}
}
File save code:
string namefile;
namefile = txtboxSelectExcelDir.Text;
objExcel.ActiveWorkbook.SaveAs(namefile + "_Nom022.xls",Excel.XlFileFormat.xlWorkbookNormal,Type.Missing,Type.Missing,Type.Missing,
Type.Missing,Excel.XlSaveAsAccessMode.xlNoChange,Type.Missing,Type.Missing,Type.Missing,Type.Missing);
Any Help would be greatly appreciated as the file is currently not being saved to the selected directory but the Directory name is appended to the filename and saved somewhere else.
Excellence is doing ordinary things extraordinarily well.
|
|
|
|
|
use this method i find it easier
if (folderBrowserDialog1.ShowDialog() == DialogResult.OK) { txtboxSelectExcelDir.Text = folderBrowserDialog1.FileName; }
String info = String.Empty;
using (StreamWriter sw = File.CreateText(folderBrowserDialog1.FileName)
{
sw.Write(
Make sure the info is seperated by tabs, to indicate different cells
for example,
col1, row1\tcol2, row1\r\ncol1, row2\tcol2, row2
|
|
|
|
|
This means that I would have to change my whole code process. I just need to know how to pass the Directory path to the save function. CHanging the coding I have done is not much of an option.
Excellence is doing ordinary things extraordinarily well.
|
|
|
|
|
objExcel.ActiveWorkbook.SaveAs(Path.Combine(txtboxSelectExcelDir.Text, namefile + "_Nom022.xls"),...
|
|
|
|
|
It works 100%. Thanks for that Shree
Excellence is doing ordinary things extraordinarily well.
|
|
|
|
|
I have seen programs which add plugins to other ones, such as internet explorer, as a .dll. How can I code my own .dll plugin for another application (I was thinking of MSN Messenger)?
Thanks in advance.
|
|
|
|
|
|
Programs that are designed to be extended using plugins usually have a published API documentation. You need to find these and code accordingly.
|
|
|
|
|
Hi All,
I wrote some application and i need in some place to catch the keyboard pressed key - so i used windows hook - now i have the scan code of the pressed key but i cant convert it to the real key that the user pressed.
How can i know from the key scan code what is the real key ?
Is there some .Net class that can give me the pressed key when the input is the scan code ?
Thanks for the help
|
|
|
|
|
Hi,
you don't need a hook to catch the keys sent to an application.
Just have your main form's KeyPreview set to true, and use its KeyPress or KeyDown event.
The EventArg contains all you need.
|
|
|
|
|
I just want to know how to find out the key from the scan code.
|
|
|
|
|
The way I do this is to use an xml file, which I created, with the corresponding key explanations.
Click here for the file (it will only be there for a short while!)
Microsoft in its wisdom has removed the codes from the web, or moved the site, as it was there two weeks ago and now...
As far as I know there is no class to convert these codes into 'meaningful' key descriptions for the user.
One thing to be aware of is that depending on which country/keyboard used you may not have all the keys covered.
Regards
Guy
Continuous effort - not strength or intelligence - is the key to unlocking our potential.(Winston Churchill)
|
|
|
|
|
Good Day,
I'm using SharpZipLib Zip library in my application. Basically, after extracting the files, I wish to delete the original zip file.
However, SharpZipLib does not close its handle to the zip file. So when I try to delete, I get an exception.
Is there anyway to delete the file with active handles?
Thanks!
It is said that the most complex structures built by mankind are software systems. This is not generally appreciated because most people cannot see them. Maybe that's a good thing because if we saw them as buildings, we'd deem many of them unsafe.
|
|
|
|
|
Ian Uy wrote: Is there anyway to delete the file with active handles?
not before closing it, there must be something in the library that will terminate the handle, that a pretty big blow to functionality otherwise .
|
|
|
|
|
Hmmm. If I put everything in a class and dispose it, will it close the stream?
The thing is, I only have the DLL file so I can't make changes to the code.
It is said that the most complex structures built by mankind are software systems. This is not generally appreciated because most people cannot see them. Maybe that's a good thing because if we saw them as buildings, we'd deem many of them unsafe.
|
|
|
|
|
Ian Uy wrote: Hmmm. If I put everything in a class and dispose it, will it close the stream?
I've tryed that in the past as well, but its unpredictable, sometimes it works, other times it does not. It really depends on what technologies your working with.
Ian Uy wrote: The thing is, I only have the DLL file so I can't make changes to the code.
If there is something in the class library to open a stream, there will be something in there to close it. If it has documentation, find the method that opens it, and im sure the method that closes it is near-by. If it is still not closing then the problem may be elsewhere.
Cheers,
|
|
|
|
|
The salient facts of the case:
List<IMyInterfaceOne> myList;
IMyInterfaceOne : IEnumerable<IMyInterfaceTwo>
{
}
MyMethod(IEnumerable<IEnumerable<IMyInterfaceTwo>> mySource)
{
}
When I try to pass myList into MyMethod, it won't compile.
|
|
|
|