Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
P

Pradeep C

@Pradeep C
About
Posts
13
Topics
0
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Custom Button Background
    P Pradeep C

    I think you should be able to do this without much problem by creating a csutom control which derives from Button class. You can override the OnPaint method and call base.OnPaint() so that it would do all the normal painting required for creating a Button and the you could draw whatever you want, like gradient or ...

    --- "Drawing on my superior command of language I said nothing."

    C# graphics

  • Getting returns from a messagebox
    P Pradeep C

    The way I think about it is like this: We create normal classes (with constructor) because we might want to have multiple instances of that class at the same time. There is no need to create multiple instances of the MessageBox class because the only thing you use a MessageBox is to show it to the user and wait for a input. The MessageBox is a modal dialog and hence the application will have to sit and wait till user clicks a button. Once the user clicks the button the only information you will need is which button the user clicked (if there is more than one button). So the entire purpose for which MessageBox class exists is finished when we call the Show method and check its return value. Hence the natural way is to make it a static class so that its very easy for use (means write less code). User never needs to create an instance.

    --- "Drawing on my superior command of language I said nothing."

    C# question

  • Getting returns from a messagebox
    P Pradeep C

    You can do something like this. if (MessageBox.Show("Press Ok or Cancel", "Test", MessageBoxButtons.OKCancel) == DialogResult.OK) { MessageBox.Show("You pressed Ok"); } else { MessageBox.Show("You pressed Cancel"); } You cannot use new on MessageBox because its a static class (all functions are static and the constructor is private). Also since the MessageBox.Show function does not return unless the user press a button, there is no confusion for the compiler.

    --- "Drawing on my superior command of language I said nothing."

    C# question

  • Repeat Value
    P Pradeep C

    You could do something like this : void Main(string[] args) { ArrayList ar = new ArrayList(); ar.Add(5); ar.Add(2); ar.Add(6); ar.Add(5); ar.Add(8); ar.Add(9); ar.Add(1); ar.Add(1); ar.Add(9); ar.Add(5); RemoveDuplicates(ar); } void RemoveDuplicates(ArrayList ar) { ar.Sort(); for (int i = ar.Count - 1; i > 0; i--) { if (ar[i].Equals(ar[i - 1])) { ar.RemoveAt(i); } } }

    --- "Drawing on my superior command of language I said nothing."

    C# question

  • Windows Forms Problem Closing From One To Another
    P Pradeep C

    I cant reproduce your problem. Please check if the MainForm goes behind any other windows that might be open (like Visual Studio).

    --- "Drawing on my superior command of language I said nothing."

    C# winforms debugging help question

  • Don't Doubt:Help Me And Get Money
    P Pradeep C

    Try ur luck at http://www.rentacoder.com/RentACoder/default.asp I would have loved to do it but I have my hands full :) ------------------------------ "There is no reason anyone would want a computer in their home" Ken Olson, chairman & founder of Digital equipment, 1977

    C# database csharp asp-net sql-server com

  • creating a Form Having Return Value
    P Pradeep C

    You can use a Shared Variable in the form class that will hold the value to be returned. "I think there is a world market for maybe 5 computers" Thomas Watson, chairman of IBM, 1943 "There is no reason anyone would want a computer in their home" Ken Olson, chairman & founder of Digital equipment, 1977 "This 'telephone' has too many shortcomings to be seriously considered as a means of communication. The device is ingerently of no value to us." Western Union internal memo, 1876 "640 K ought to be enough for anybody." Bill Gates, 1981 "Computers in the future may

    Visual Basic question

  • Exceptions or Return Values
    P Pradeep C

    I think that it would be better to use Exceptions as the .NET framework itself uses it. "I think there is a world market for maybe 5 computers" Thomas Watson, chairman of IBM, 1943 "There is no reason anyone would want a computer in their home" Ken Olson, chairman & founder of Digital equipment, 1977 "This 'telephone' has too many shortcomings to be seriously considered as a means of communication. The device is ingerently of no value to us." Western Union internal memo, 1876 "640 K ought to be enough for anybody." Bill Gates, 1981 "Computers in the future may

    Visual Basic help csharp database business

  • How do you insert a row at a time?
    P Pradeep C

    You can use a command object to update the rows in Dataset to the second Table in database. 'assume connString = Your connection string Dim cn as new OledbConnection(connString) Dim cmd as new OledbCommand cmd.Connection = cn cn.Open dim i as integer For i=0 to DataSet1.Tables(0).Rows.Count-1 cmd.CommandText = "INSERT INTO Table2 (Col1,Col2,Col3,..) VALUES (DataSet1.Tables(0).Rows(i).Item(1),DataSet1.Tables(0).Rows(i).Item(2),DataSet1.Tables(0).Rows(i).Item(3)....) cmd.ExecuteNonQuery Next cn.Close cmd.Dispose cn.Dispose "I think there is a world market for maybe 5 computers" Thomas Watson, chairman of IBM, 1943 "There is no reason anyone would want a computer in their home" Ken Olson, chairman & founder of Digital equipment, 1977 "This 'telephone' has too many shortcomings to be seriously considered as a means of communication. The device is ingerently of no value to us." Western Union internal memo, 1876 "640 K ought to be enough for anybody." Bill Gates, 1981 "Computers in the future may

    Visual Basic tutorial question

  • nedd help with this code from converting vb6.0 to .net
    P Pradeep C

    I would suggest you to start from scratch and use ADO.NET. It seems there isn't much work to be done even if u start all over again. "I think there is a world market for maybe 5 computers" Thomas Watson, chairman of IBM, 1943 "There is no reason anyone would want a computer in their home" Ken Olson, chairman & founder of Digital equipment, 1977 "This 'telephone' has too many shortcomings to be seriously considered as a means of communication. The device is ingerently of no value to us." Western Union internal memo, 1876 "640 K ought to be enough for anybody." Bill Gates, 1981 "Computers in the future may

    Visual Basic csharp help

  • Data Grids
    P Pradeep C

    Can you show us your code piece ? ----------------------------------------------------------- "I think there is a world market for maybe 5 computers" Thomas Watson, chairman of IBM, 1943 "There is no reason anyone would want a computer in their home" Ken Olson, chairman & founder of Digital equipment, 1977 "This 'telephone' has too many shortcomings to be seriously considered as a means of communication. The device is ingerently of no value to us." Western Union internal memo, 1876 "640 K ought to be enough for anybody." Bill Gates, 1981 "Computers in the future may

    Visual Basic database help announcement

  • How to pull a field from a Dataset???
    P Pradeep C

    I assume that your Dataset (lets call it ds) has a single table. So the nth field of mth row will be : ds.Tables(0).Rows(m).Item(n) "I think there is a world market for maybe 5 computers" Thomas Watson, chairman of IBM, 1943 "There is no reason anyone would want a computer in their home" Ken Olson, chairman & founder of Digital equipment, 1977 "This 'telephone' has too many shortcomings to be seriously considered as a means of communication. The device is ingerently of no value to us." Western Union internal memo, 1876 "640 K ought to be enough for anybody." Bill Gates, 1981 "Computers in the future may

    Visual Basic csharp help tutorial question

  • Using a column in a selected row - DataGrid
    P Pradeep C

    You could use this logic also to select a row, which has been clicked ( I am not sure which has better performance or whether this logic has a drawback) : If DataGrid1.CurrentRowIndex > -1 then DataGrid1.Select(DataGrid1.CurrentRowIndex) End if I think to get column value of selected row, you should get it from the underlying DataSet (or DataTable) using the CurrentRowIndex of the DataGrid For Eg, if your DataSet ds has a table which is shown in the DataGrid, and you want to get value of column with index 3 of currently selected row, col3Value = ds.Tables(0).Rows(DataGrid1.CurrentRowIndex).Item(3) But this logic will fail if you have used the RowFilter to filter rows from the DataSet's default view. This is because the row index of DataGrid and that in the DataSet wont be same. To overcome that you could use this logic to get the DataRow in the DataSet corresponding to the row selected in the DataGrid: Private Function GetDataRow() As DataRow Dim dr() As DataRow = ds.Tables(0).Select(ds.Tables(0).DefaultView.RowFilter) Return dr(DataGrid1.CurrentRowIndex) End Function From the returned DataRow, you can take the required value : col3Value = dr.Item(3) Hope it helped. ---------------------------------------------------------------------------- "I think there is a world market for maybe 5 computers" Thomas Watson, chairman of IBM, 1943 "There is no reason anyone would want a computer in their home" Ken Olson, chairman & founder of Digital equipment, 1977 "This 'telephone' has too many shortcomings to be seriously considered as a means of communication. The device is ingerently of no value to us." Western Union internal memo, 1876 "640 K ought to be enough for anybody." Bill Gates, 1981 "Computers in the future may

    Visual Basic question help
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups