|
|
Dim service() As System.ServiceProcess.ServiceController
Dim i As Integer
service = System.ServiceProcess.ServiceController.GetServices()
For i = 0 To service.Length - 1
If service(i).ServiceName = "wampapache" Then
If service(i).Status = ServiceControllerStatus.Running Then
' Kill the Service
service(i).Stop()
Application.Exit()
Else
Dim startInfo As System.Diagnostics.ProcessStartInfo
Dim pStart As New System.Diagnostics.Process
startInfo = New System.Diagnostics.ProcessStartInfo("E:\Biswabhusan_Collection\COREPRACTICE\TestService\wamp5_1.6.1.exe")
pStart.StartInfo = startInfo
pStart.Start()
pStart.WaitForExit() 'Your code will halt until the exe file has executed.
End If
End If
Next
solveed - Biswabhusan
|
|
|
|
|
List<int> lst_int=new List<int>();
lst_int.Add(3);
lst_int.Add(5);
lst_int.Add(2);
lst_int.Sort();
MessageBox.Show(lst_int[0].ToString());
struct mystruct
{
int x;
int y;
}
How do I implement "sort" for lists of type mystruct?
List<mystruct>
List<mystruct> lst_mystruct=new List<struct>();
mystruct mys;
mys.x=10;
mys.y=12;
lst_mystruct.Add(mys);
how do I sort now?
|
|
|
|
|
Implement the IComparable and/or IComparable<mystruct> interface(s) in your struct.
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook www.troschuetz.de
|
|
|
|
|
Hi all,
I want to develop a textbox(more like richtextbox control) where users can enter some text, but the bitmaps are displayed instead of characters. The user should be able to edit the text and the corresponding values should be preserved(between the text entered and the corresponding bitmaps). How do i go about doing this. Is there a way to override the paint event of the textbox so that the bitmap is drawn instead of charcters.
Please help.
Thanks for reading.
|
|
|
|
|
The textbox is not written for overriding, as it paints itself outside of any paint event, getting it to custom draw is always nasty. I'd say it's almost better to start from scratch.
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 )
|
|
|
|
|
SO, u are suggesting that I start from a class that inherits usercontrol class. So, how do i display the cursor(carat) on the control. How do i go about editing and deleting and positioning the cursor?
Any suggestions...
|
|
|
|
|
Looking for info on how to populate listview from folderbrowserdialog once the user selects a file followed by the ok button.
I'm relatively new to programming with C# so the more detail the better.
Thank you
Mike
|
|
|
|
|
Hi,
First, after the user selects a folder, you know its path. You can GetDirectories from that Directory object. Then iterate through the collection, filling each folder name in the list box. I think that there will be a better way of doing this, but i dont know about it. This solution will surely work in your case. But this is not a good practice, I guess.
"A good programmer is someone who looks both ways before crossing a one-way street." -- Doug Linder
coolestCoder
|
|
|
|
|
Use Directory.GetFolders and Directory.GetFiles, merge those arrays together and make them the datasource on your listview.
How new is 'new' ? Have you taken the time to learn C# before learning Winforms ? Have you worked through any books ?
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 )
|
|
|
|
|
New is about 6 months experience and still learning through CDI college.
Thank you for the reply.
|
|
|
|
|
hi,
In my application I am using a DataGridView with 4 columns.
now I want to validate the data entry from user.
like in First column user should enter only Numbers, and in second column I want a default cell fromat like xx.xx.xx.xx
How to do this.
Pls help me
With Regards
prasad
|
|
|
|
|
Did you try with DataGridView.ColumnDividerWidthChanged Event.
Regards,
Satips.
|
|
|
|
|
hi,
wht i have to do with this event
i am not getting can u hekp me pls..
dataGridView1_ColumnDividerWidthChanged()
with regards
prasad
|
|
|
|
|
Hi,
From your question, it seems that your are providing the Edit facility in the grid itself. If this is the case, you can place all the validators in the EditTemplate of the column. These will automatically fired when user clciks 'Update'.
I hope you got my point.
"A good programmer is someone who looks both ways before crossing a one-way street." -- Doug Linder
coolestCoder
|
|
|
|
|
hi,
actually iam not getting u canu brief pls.
|
|
|
|
|
I wanted to say that, you can place validators in the EditItemTemplate of a GridView. For this you will have to convert that column in template comlumn.
"A good programmer is someone who looks both ways before crossing a one-way street." -- Doug Linder
coolestCoder
|
|
|
|
|
|
hi,
wht u have given is customized datagrid.
But i want it in the C# DataGridView .
can u help me pls
with Regards
prasad
|
|
|
|
|
In VS 2005, C# setup project contains information of exe. But I can't find app's [ProductCode] in setup project to make an uninstall file.
If you help me show how to find [ProductCode], I am appreciated with you and unintallation of app is easier.
Thanks in advance
It seem to be a solution or an answer.
|
|
|
|
|
An app doesn't automagically have a product code, you need to provide one.
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 )
|
|
|
|
|
How should I provide [ProductCode] so that Window can identify this [Productcode] as a key to remove ????
It seem to be a solution or an answer.
|
|
|
|
|
My understanding is that the point is entirely that you provide whatever you like, and windows will use it when you run your uninstaller.
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 )
|
|
|
|
|
Hi everyone,
I've got a problem with my application and i need some help.
I use a DataGridView to display the data.Data is being read from a db.I want to get the Sum of each cell under a column.For example:
|Bills |Salary |PriceOfAPen
-----------------------------------------------------
|500,00$ |300,00$ |50,00$
|400,00$ |300,00$ |50,00$
-----------------------------------------------------
Total: 900,00$ 600,00$ 100,00$
But my output looks like this:
|Bills |Salary |PriceOfAPen
-----------------------------------------------------
|500,00$ |300,00$ |50,00$
|400,00$ |300,00$ |50,00$
-----------------------------------------------------
Total: 1600,00$
Users can change or add tables so i have to do it when the data is called.Can someone please help me?
Thanks already.
Sorry for my English by the way as it is not my native language
|
|
|
|
|
Hi,
You can use the RowCreated event to keep all the columns values in separate variables, and go on adding new values. then set these to the Footer labels. So simple.
"A good programmer is someone who looks both ways before crossing a one-way street." -- Doug Linder
coolestCoder
|
|
|
|