Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Cetin Basoz
  Where is Cetin Basoz?
 Izmir
 Turkey
 Cetin Basoz
 To: Oliver Cortazar
  Where is Oliver Cortazar?
 San Luis Potosi
 Mexico
 Oliver Cortazar
 Tags
Subject: RE: VFPToolkitNET browse form
Thread ID: 228707 Message ID: 228835 # Views: 3 # Ratings: 1
Version: Not Applicable Category: .NET
Date: Thursday, May 21, 2009 10:59:56 PM         
   


> >
> > I didn't understand the question and not replying to it. I wanted to warn you about VFPToolkitNET, I checked it years ago but I think it is the same. If so then beware that some function implementations (I checked some string and file IO then) are not the same as how they work in VFP but similar. Don't take my words wrong, it is a usefull resource just be carefull and do your own tests as you learn.
> >
> > Also check www.learnvisualstudio.net and developer home pages for tutorials (such as http://msdn.microsoft.com/en-us/vcsharp/default.aspx).
> >
> > You say that you have plenty of time, then I suppose you wouldn't finish your project before 2010, you may think to download VS 2010 beta (released yesterday - you can find the link on vc# developer center which I gave the link above). VS 2010 has new cool features which one is the 'dynamic' support. Seeing 2010 you may not want to use .Net 1.x approaches at all:)
> >
> > PS: 'dynamic' is not the feature of VS (it is IDE) but C# 4.0 and .Net 4.0.
> >
> > PS: You may want to download and register Xceed datagrid for WPF for free (24 days left for free registration) http://xceed.com/freegrid
> >
> > Also devforce framework has express version for free (www.ideablade.com).
> >
> > (anything 'Express' in .Net world is free and somewhat limited version).
> >
> > Cetin Basoz
> >
> > .Net has got better.Think about moving - check my blog:
> > Blog (main)
> > Blog (mirror)
>
>
> Thanks for all the resources. I really liked the xceed datagrid. I'll give it a try. I just wanted the browse window because is one of the VFP features I use the most, but I think I'll just programm it myself.

Oh you meant how to mimic a browse? It is very simple then:

myDataGridView.DataSource = yoursource

myDataGridView is a DataGridView object. yoursource is anything that can be enumerated (not only a table/cursor in VFP) and has properties (properties are columns). Here is a sample code:

using System;
using System.Data;
using System.Data.OleDb;
using System.Windows.Forms;
using System.Collections;
using System.Linq;
using System.IO;

class sample
{
 static void Main()
 {
   DataTable tbl = new DataTable();
   OleDbConnection cn = new OleDbConnection(
     "Provider=VFPOLEDB;Data Source="+
  @"C:\Program Files\Microsoft Visual FoxPro 9\Samples\Data\testdata.dbc");
   cn.Open();
   OleDbDataReader rdr = new OleDbCommand("select * from customer", cn).ExecuteReader();
   tbl.Load(rdr);
   cn.Close();
   
   // table
   Form f = new ShowDataForm(tbl);
   f.ShowDialog();

   System.Diagnostics.Process[] runningProcesses = 
         System.Diagnostics.Process.GetProcesses();

   // running system processes
   f = new ShowDataForm(runningProcesses);
   f.ShowDialog();

   // files
   DirectoryInfo di = new DirectoryInfo(@"c:\Program Files\Microsoft Visual FoxPro 9");
   string[] extensions = { ".scx", ".prg" };

   var files = from myFile in di.GetFiles("g*.*",SearchOption.AllDirectories)
               where extensions.Contains(myFile.Extension.ToLower())
               select myFile;

   f = new ShowDataForm( files.ToArray() );
   f.ShowDialog();

 }
}

public class ShowDataForm : Form
{
  public ShowDataForm(object o)  
  {
     this.ClientSize = new System.Drawing.Size(1024, 768);
     this.dgv = new System.Windows.Forms.DataGridView();
     this.dgv.DataSource = o;
     this.dgv.Dock = DockStyle.Fill;
     this.Controls.Add(this.dgv);
  }
  private DataGridView dgv;
}


-Go to command window (assuming you located csc.exe - default location is something like:
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\csc.exe)

-Paste the code in notepad and saveas myTest.cs
-Compile with
csc myTest.cs

-Run
myTest

Or alteranatively download the cool LinqPAD from www.linqpad.net and use it for testing (but it may be a little hard to see how LinqPad may help you at first - it is like an interactive IDE)
You can also check my blog (follow signature) but I am afraid I didn't have time to update recently.

Cetin Basoz

.Net has got better.Think about moving - check my blog:
Blog (main)
Blog (mirror)

ENTIRE THREAD

VFPToolkitNET browse form Posted by Oliver Cortazar @ 5/21/2009 12:36:05 AM
RE: VFPToolkitNET browse form Posted by Cetin Basoz @ 5/21/2009 1:45:36 PM
RE: VFPToolkitNET browse form Posted by Oliver Cortazar @ 5/21/2009 8:09:47 PM
RE: VFPToolkitNET browse form Posted by Cetin Basoz @ 5/21/2009 10:59:56 PM
RE: VFPToolkitNET browse form Posted by Oliver Cortazar @ 5/22/2009 12:58:26 AM
RE: VFPToolkitNET browse form Posted by Cetin Basoz @ 5/22/2009 2:32:45 PM
RE: VFPToolkitNET browse form Posted by Oliver Cortazar @ 5/22/2009 6:56:08 PM
RE: VFPToolkitNET browse form Posted by Oliver Cortazar @ 5/22/2009 9:33:50 PM
RE: VFPToolkitNET browse form Posted by Cetin Basoz @ 5/23/2009 12:29:46 PM
RE: VFPToolkitNET browse form Posted by Christian Tabligan @ 5/21/2009 1:58:58 PM
RE: VFPToolkitNET browse form Posted by Oliver Cortazar @ 5/21/2009 8:13:55 PM
RE: VFPToolkitNET browse form Posted by Tom Saddul @ 5/23/2009 5:23:39 AM
RE: VFPToolkitNET browse form Posted by Boudewijn Lutgerink @ 5/25/2009 8:46:22 AM