|
In Visual C# 2005 IDE, can I customize the "using" directives that are automatically added when a new file or new class is added to the project?
Also in Express?
|
|
|
|
|
Not that I know of...
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
http://weblogs.asp.net/scottgu/archive/2005/09/09/424780.aspx[^]
Heh, I didn't know that before you asked, I was going to google how to manualy add/modify item templates, and look, there is IDE option to do that. And right in File menu.
"Throughout human history, we have been dependent on machines to survive. Fate, it seems, is not without a sense of irony. " - Morpheus
"Real men use mspaint for writing code and notepad for designing graphics." - Anna-Jayne Metcalfe
|
|
|
|
|
Ah - using templates!
Per-Project would be nicer, but I think that does the job.
|
|
|
|
|
confused::(salut,je suis une ètudiante dèbutante,je suis entrain de faire un petit programme en C# et je veux bien savoir la solution pour fair l'exection d'un logiciel(exp:netstumbler)a partir de mon application.Merci!!!
|
|
|
|
|
Babelfish says:
hello, I am a ètudiante dèbutante, I am spirit to make a small program out of C # and I want to know the solution well to fair l'exection d'un logiciel(exp:netstumbler)a to start from my application.Merci!!!
Download the VS2005 Express Edition and choose File:New. Then, buy a book.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Hey guys
I have a datagridview populated with entries from a database. I have set the selection mode of the grid to fullrowselect so that a click on any cell will cause selection of that row. In this selection event I open a new form showing the data contained in that row. This works fine, however when you click on a column header it still tries to select that row. Is there any way of stopping this?
Thanks in advance
|
|
|
|
|
What event are you using?
I used the doubleClick event somewhere in an old app, and it just refers to the SelectedItem in the datagrid. Then if you doubleclick the header, it just opens the record that was selected last.
Visual Studio can't evaluate this, can you?
public object moo<br />
{<br />
__get { return moo; }<br />
__set { moo = value; }<br />
}
|
|
|
|
|
I was using the selectionChanged event of the datagrid, is there anyway of knowing which row the selection was made on? ie if row is header row type then do nothing?
|
|
|
|
|
you could use an event like CellClick or RowEnter, they have DataGridViewCellEventArgs where you can access the ColumnIndex and the RowIndex of the selection.
private void dataGridView1_RowEnter(object sender, DataGridViewCellEventArgs e)
{
}
Visual Studio can't evaluate this, can you?
public object moo<br />
{<br />
__get { return moo; }<br />
__set { moo = value; }<br />
}
|
|
|
|
|
Cheers that does the trick
|
|
|
|
|
I like to minimize all open programs when my WinForm-application starts. How to do that?
_____________________________
...and justice for all
APe
|
|
|
|
|
Why does your app need all others to be minimized?
|
|
|
|
|
When I start my application it comes behind all others.
Know it's not the best solution to make all others minimize but I have not found any other solution.
I found this:
[System.Runtime.InteropServices.DllImport("user32.dll")]<br />
public static extern void keybd_event(byte bVk, byte bScan, Int32 dwFlags, Int32 dwExtraInfo);<br />
<br />
public void MinimizeAll()<br />
{<br />
keybd_event(91, 0, 0, 0);<br />
keybd_event(77, 0, 0, 0);<br />
keybd_event(91, 0, 2, 0);<br />
}
_____________________________
...and justice for all
APe
|
|
|
|
|
Why does your application start behind the others? Are the others set to always on top or do you click on them while waiting for your application to start up?
It'd be much better to solve the cause than fudge a fix on the effect
|
|
|
|
|
No, I'm using a splash that probably causes the problem.
_____________________________
...and justice for all
APe
|
|
|
|
|
Quite possibly, when the splash screen closes try calling the Focus method on your form ... that should give it the focus.
|
|
|
|
|
Why I cannot do with this code and exception is thrown with "the requested address is not valid in its context"
try
{
IPAddress inputDNS_IP = Dns.Resolve(inputDNS_IP).AddressList[0];
// start the data port and listen for connection from input host
this.dataListener = new TcpListener(inputDNS_IP, dataPort);
this.dataListener.Start();
}
catch (Exception ex)
{
MessageBox.Show(ex.ToString());
}
inputDNS_IP is an intranet IP here.
|
|
|
|
|
Hi, I have some eventhandling written in VB.NET that I have trouble translating to C#. Anyone out there that can help me with this?
** UIController class **********************************************************
-- event --
Public Event ExitApplication()
-- function --
Public Sub ExitApp(ByVal sender As System.Object, ByVal e As System.EventArgs)
RaiseEvent ExitApplication()
End Sub
**************************************************************************
** WinForm class ************************************************************
-- field --
Private controller As UIController
-- in Form load --
Me.controller = New UIController(Me)
AddHandler controller.ExitTheApp, AddressOf Me.FormMainExit
-- function --
Private Sub FormMainExit()
Me.Close()
End Sub
**************************************************************************
|
|
|
|
|
Found a site that could help me.
|
|
|
|
|
Hopefully the site you found is good.
Otherwise, here's the conversion produced by Instant C# (I added class headers, etc. to get it into somewhat compilable VB format first):
internal class UIController
{
public delegate void ExitApplicationEventHandler();
public event ExitApplicationEventHandler ExitApplication;
public void ExitApp(object sender, System.EventArgs e)
{
if (ExitApplication != null)
ExitApplication();
}
}
internal class WinForm
{
private UIController controller;
private void FormLoad()
{
this.controller = new UIController(this);
controller.ExitTheApp += new System.EventHandler(this.FormMainExit);
}
private void FormMainExit()
{
this.Close();
}
}
David Anton
www.tangiblesoftwaresolutions.com
Instant C#: VB to C# converter
Instant VB: C# to VB converter
Instant C++: C# to C++ converter, VB to C++ converter
Instant Python: C# to Python converter, VB to Python converter
|
|
|
|
|
Thnx alot Mr.Roel
I found ur help on click once is useful, but here i have a doubt about my current Error: INVALIDDEPLOYMENTEXEPTION, saying "Application in not installed"
Here i have taken a button[Update] and when user clicks the buttion the functionality should checks the updated version and if available it should download the latest version for that my code is,,
in Buttion
private void button1_Click(object sender, EventArgs e)
{
if (ApplicationDeployment.IsNetworkDeployed)
{
ApplicationDeployment appDeploy = ApplicationDeployment.CurrentDeployment;
bool update = appDeploy.CheckForUpdate();
if (update)
{
UpdateCheckInfo updateInfo = appDeploy.CheckForDetailedUpdate();
string version = updateInfo.AvailableVersion.ToString();
bool updateRequired = updateInfo.IsUpdateRequired;
string minVersion = "";
if (updateInfo.MinimumRequiredVersion!=null)
minVersion = updateInfo.MinimumRequiredVersion.ToString();
bool updateAvail = updateInfo.UpdateAvailable;
long footprint = updateInfo.UpdateSizeBytes;
StringBuilder sb = new StringBuilder();
sb.AppendFormat("Update Version: {0}\r\n", version);
sb.AppendFormat("Minimum Version: {0}\r\n", minVersion);
sb.AppendFormat("Update Required: {0}\r\n", updateRequired);
sb.AppendFormat("Update Available: {0}\r\n", updateAvail);
sb.AppendFormat("Update Footprint: {0} bytes\r\n", footprint);
MessageBox.Show(sb.ToString());
if (updateAvail)
{
bool updated = appDeploy.Update();
if (updated)
Application.Restart();
}
}
else
MessageBox.Show("No updates are available.");
}
else
{
MessageBox.Show("This application was not launched using ClickOnce. Cannot perform update.");
}
}
in PageLoad
private void Form1_Load(object sender, EventArgs e)
{
if (ApplicationDeployment.IsNetworkDeployed)
{
ApplicationDeployment appDeploy = ApplicationDeployment.CurrentDeployment;
this.label1.Text = appDeploy.CurrentVersion.ToString();
appDeploy.CheckForUpdateProgressChanged += new DeploymentProgressChangedEventHandler(appDeploy_CheckForUpdateProgressChanged);
appDeploy.CheckForUpdateCompleted += new CheckForUpdateCompletedEventHandler(appDeploy_CheckForUpdateCompleted);
appDeploy.UpdateProgressChanged += new DeploymentProgressChangedEventHandler(appDeploy_UpdateProgressChanged);
appDeploy.UpdateCompleted += new AsyncCompletedEventHandler(appDeploy_UpdateCompleted);
}
}
}
Hope You got me,
please help me thnx in advance
prashanth,
s/w Engineer,
Syfnosys.
|
|
|
|
|
Dear All,
i have developed a desktop based application using C#.NET, which require access to some USB based devices.
I have to use this application on target PCs in which the USB port is disabled by the system administrator.
From the application, i wants to enable & disable the USB drives programatically, so that no other application can use the USB ports, as per configured by the system administrator.
ie, enable the USB port before the application require access to the USB port it & disable it after the use.
I need to achieve the same when the application is running in a login, who doesn't have administrative rights.
Is it possible to achieve the same using .NET framework?
Do any one knows how to implement the same. If so, please inform me.
Best Regards,
Abhilash Chandran
|
|
|
|
|
|
Thank you for ur reply.
But, my requirement is slightly different.
My application has to run on a system in which the USB ports are disabled by the system administrator.
From my application i have to enable the USB drive, so that only a particular USB device must be able to use the USB drive. My application uses this USB device & finally when the application finishes using the USB device, i have to disable the USB drive again from the application.
All the above actions i have to perform in a non adminisrator login.
If you have any information regarding the same, plz let me know
Best Regards,
Abhilash
|
|
|
|