Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

I'm trying to learn more about create classes.

 

I might be taking the wrong approach, so please advise.

 

I want to create something that holds my tablestyle info in it. I have a windows form that has several grids on it.. all are the exact same layout but are hittting different datasets. I would like to create something that I could put all my formatting in adn then just make a call to this passing in the grid name..

 

how should I go about doing that

thanks

shannon

JvCoach23

VB.Net newbie

MS Sql Vet

  • Moderators
Posted

You don't need a seperate class for this, you can just create a sub like this...

 

Private sub FormatGrid(byRef dg as Datagrid)

with dg

.Do stuff to format the grid here

end with

end sub

 

Then to use this in your code....

 

FormatGrid(myFirstGrid)

FormatGrid(mySecondGrid)

FormatGrid(myThirdGrid)

Visit...Bassic Software

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...