|
From within a C# application (Visual Studio 2005), I want to programatically iterate the list of GAC Assemblies used by the program, and view the Assembly versions. Can anyone provide me with information, and/or a link, that will help me perform this task?
Thank you...
|
|
|
|
|
Hi,
I am clueless about how to perform a virus scan using my symantec antivirus, i.e. i am developing an email client, I need to scan virus first and then send.
Thank you!
M. Nauman Yousuf
"Mess with the Best, Die like the rest"
|
|
|
|
|
Is there a way to make the Save File Dialog have an uneditable (so they have to stay in that directory) directory path or do I have to create a dialog from scratch to do this?
|
|
|
|
|
AFAIK, you have to create your own dialog to do this.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Hi,
I have an issue with the context menu, i.e. when i try opening a single file it works fine, but when i try selecting multiple files and then select my menu options it opens up a window for each of the selected items
If any 1 has any clue about it, please let me know
Thank you!
M. Nauman
"Mess with the Best, Die like the rest"
|
|
|
|
|
What do you mean by "it opens up a window for each of the selected items"?? You didn't give any information as to how you're using this context menu or in what application...
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Hi Dave,
I registered an entry in the registry for .txt files so each time when right-click is pressed in the menu my menu entry is also present.
My appliction is just a test that windows is passing me the file paths of the selected text files.
Application opens up a console window and displays the path passed by windows as argument.
Now when I select multiple files, it opens up multiple console windows displaying path of each file in each console window.
Thank you!
M. Nauman Yousuf
"Mess with the Best, Die like the rest"
|
|
|
|
|
M. Nauman Yousuf wrote: Now when I select multiple files, it opens up multiple console windows displaying path of each file in each console window.
Of course it does! That's how Explorer works when multiple items are selected. Explorer will launch the command line you gave it in the Registry with each and every file you selected, seperatly. Like this:
myapp.exe filename1.txt
myapp.exe filename2.txt
myapp.exe filename3.txt
myapp.exe filename4.txt
It will NOT do this:
myapp.exe filename1.txt filename2.txt filename3.txt filename4.txt
It's up to you to write your application to look for previous instances and pass any data back to the initial instance. Google for "C# Single Instance app" for examples. There's even a few articles about it right here on CodeProject.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Hi,
I'm trying to prevent a combo box from displaying the dropdown when the user clicks on it. MFC's ShowDropDown(false) was doing this. Is there a way to accomplish the same result in C#?
thanx
|
|
|
|
|
Hello,
You just have to set the Boolean property "DroppedDown" to "true".
All the best,
Martin
|
|
|
|
|
Martin,
I tried that, but the dropdown flickers. It comes up and it dissapears right away. Is there a way to prevent it from appearing?
thanx
|
|
|
|
|
Hello,
On which eventhandler are you linked to when you set the property?
|
|
|
|
|
I'm doing it on DropDown event:
this.comboBox1.DropDown += new System.EventHandler(this.comboBox1_DropDown_1);
...........
private void comboBox1_DropDown_1(object sender, System.EventArgs e)
{
this.comboBox1.DroppedDown = true;
}
It's pretty weird. The first click won't show it, but the second click will.
|
|
|
|
|
Hmmm,
I don't understand why you are doing that!
You said that you whant it to show when the user clicks the control.
So I would rather use the click or mousedown event of the combobox.
Hope it helps!
All the best,
Martin
|
|
|
|
|
No Martin,
I want to prevent the combo from showing the dropdown (the reason is that i'm doing something else instead of showing the list).
I think I'll just fake it with an edit & a button.
|
|
|
|
|
Ohh,
Than I missunderstod what you actually wanted to do.
I made a little test project for you, which is doing:
The dropdown box should be shown if the left mouse button is clicked, but not if the right mouse button is clicked.
I'm using the mousedown event for that.
private System.Windows.Forms.ContextMenu emptymenu = new ContextMenu();
private System.Windows.Forms.ContextMenu oldmenu;
private void button1_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e)
{
if(e.Button == MouseButtons.Right)
{
if(button1.ContextMenu!=emptymenu)
oldmenu = button1.ContextMenu;
button1.ContextMenu = emptymenu;
}
else if(e.Button == MouseButtons.Left)
{
if(oldmenu!=null)
{
button1.ContextMenu = oldmenu;
}
button1.ContextMenu.Show(button1, new Point(e.X,e.Y));
}
}
Hope it helps!
All the best,
Martin
|
|
|
|
|
On my web form I have a text box, that when the form loads it get a string of text from a MySQL database and set the text box property as the string.
So then you can edit the text.
Then I have a button next to it that when you press it should put the text in the text box in to the database.
But it never changes the information in the database.
I think the problem might be to do with when I press the button it refreshes the page, therefor resetting the information in the text box and putting the original text back in to the database.
Any help will be very much appreciated
Thanks.
|
|
|
|
|
I am guessing that your onLoad event is always populating the text box. I think you may want to use the IsPostBack to see if you are doing a page load from your button click. So you only set the data from the text box if !IsPostBack or Not IsPostBack in VB.
Hope that helps.
Ben
|
|
|
|
|
Is there a way to control which monitor a winform will be opened on?
Thanks.
|
|
|
|
|
Hello,
It's just a question of where you set the Forms Location and which resolution you are using on the monitors.
All the best,
Martin
|
|
|
|
|
Use class System.Windows.Forms.Screen.
Geniality is in simplicity.
|
|
|
|
|
Thanks Martin and Jakub, I got it.
|
|
|
|
|
hi ...
i need a good ebook for starting mobile programming in C#
thank you ...
|
|
|
|
|
When i click with the right mouse button shows the contextmenu.
How to do this with the left mouse click.
C#
|
|
|
|
|
Hello,
Here I made a code example for the mouse down event on a button.
private void button1_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e)
{
if(e.Button == MouseButtons.Left)
{
if(button1.ContextMenu!=null)
{
button1.ContextMenu.Show(button1, button1.Location);
}
}
}
Hope it helps!
All the best,
Martin
|
|
|
|