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: Sithu Kyaw
  Where is Sithu Kyaw?
 Yangon
 Myanmar
 Sithu Kyaw
 Tags
Subject: RE: Replace textbox with label in grid
Thread ID: 364968 Message ID: 365302 # Views: 40 # Ratings: 0
Version: Visual FoxPro 9 Category: Grids
Date: Monday, December 24, 2012 3:39:20 AM         
   


> The column object of VFP grid contains a textbox by default.
> I'm trying to replacing the textbox with a label.
> But, after I removed the text box and added the label, the field value of the underlying table is not displayed in the label.
>
> I think I should assign the value to label.caption.
> But I don't know how and where to do it.
> Any help appreciated!

Sithu,
You are in a wrong path.

1) If you would add a label to a column and make it the default control then just add it and set CurrentControl to its name and be sure to make it "VISIBLE". That is all for it to show up. Do NOT remove the existin textbox. While yo can, it is an unnecessary step.

2) If you make the conrtol a label, you should face the problems of a label and handle yourself. Namely labels do not have "ControlSource" property neither do have a "Refresh" method. Can you see the complexity you need to handle? Also keep in mind that you are now dealing with multiple records' values are bound to to a single Label's caption. Keeping captions correct for each row should be your responsibility.

Now let me try to pull you back on track especially thinking this quesion is related to foxyClasses' Grids classes (locatorGrid maybe?). It doesn't really matter if not you can customize yours:

1) Instead of trying to use a "Label", use the Textbox control itself. A Textbox could easily be made to look like a Label. It would still have ControlSource property as a bonus.
2) If it is Foxyclasses Grids classes, then those classes already use custom textbox classes. Go and modify them.
3) If talking about FoxyClasses, there was a purpose of having insertion point. Think and/or test what you lose making it a "label".



Cetin Basoz

.Net has got better.Think about moving - check my blog:
My Blog
Blog (mirror) - sounds to be down


Support Wikipedia

ENTIRE THREAD

Replace textbox with label in grid Posted by Sithu Kyaw @ 12/20/2012 12:15:36 PM
RE: Replace textbox with label in grid Posted by Borislav Borissov @ 12/20/2012 12:24:31 PM
RE: Replace textbox with label in grid Posted by Sithu Kyaw @ 12/20/2012 12:37:10 PM
RE: Replace textbox with label in grid Posted by Stefan Wuebbe @ 12/20/2012 12:49:02 PM
RE: Replace textbox with label in grid Posted by Borislav Borissov @ 12/20/2012 1:17:27 PM
RE: Replace textbox with label in grid Posted by Jun Tangunan @ 12/20/2012 11:52:07 PM
RE: Replace textbox with label in grid Posted by Sithu Kyaw @ 12/21/2012 5:47:32 AM
RE: Replace textbox with label in grid Posted by Jun Tangunan @ 12/21/2012 6:28:27 AM
RE: Replace textbox with label in grid Posted by Rahul Moudgill @ 12/21/2012 6:02:07 AM
RE: Replace textbox with label in grid Posted by Sithu Kyaw @ 12/21/2012 6:19:44 AM
RE: Replace textbox with label in grid Posted by Rahul Moudgill @ 12/21/2012 5:06:34 PM
RE: Replace textbox with label in grid Posted by David Mustakim @ 12/21/2012 6:05:10 PM
RE: Replace textbox with label in grid Posted by Rahul Moudgill @ 12/21/2012 6:06:45 PM
RE: Replace textbox with label in grid Posted by Stefan Wuebbe @ 12/20/2012 12:41:52 PM
RE: Replace textbox with label in grid Posted by Sithu Kyaw @ 12/21/2012 5:45:08 AM
RE: Replace textbox with label in grid Posted by Stefan Wuebbe @ 12/21/2012 7:43:20 AM
RE: Replace textbox with label in grid Posted by Sithu Kyaw @ 12/21/2012 8:18:28 AM
RE: Replace textbox with label in grid Posted by Stefan Wuebbe @ 12/21/2012 9:26:16 AM
RE: Replace textbox with label in grid Posted by Sithu Kyaw @ 12/21/2012 9:42:20 AM
RE: Replace textbox with label in grid Posted by Sithu Kyaw @ 12/23/2012 1:57:35 PM
RE: Replace textbox with label in grid Posted by Stefan Wuebbe @ 12/24/2012 10:17:05 AM
RE: Replace textbox with label in grid Posted by Sithu Kyaw @ 12/24/2012 10:28:38 AM
RE: Replace textbox with label in grid Posted by David Mustakim @ 12/21/2012 6:09:02 PM
RE: Replace textbox with label in grid Posted by Rahul Moudgill @ 12/21/2012 5:38:08 PM
RE: Replace textbox with label in grid Posted by Sithu Kyaw @ 12/23/2012 2:26:42 PM
RE: Replace textbox with label in grid Posted by Rahul Moudgill @ 12/24/2012 6:39:46 AM
RE: Replace textbox with label in grid Posted by Sithu Kyaw @ 12/24/2012 6:47:36 AM
RE: Replace textbox with label in grid Posted by Rahul Moudgill @ 12/24/2012 6:52:57 AM
RE: Replace textbox with label in grid Posted by Sithu Kyaw @ 12/24/2012 5:50:11 AM
RE: Replace textbox with label in grid Posted by Rahul Moudgill @ 12/24/2012 6:49:12 AM
RE: Replace textbox with label in grid Posted by Sithu Kyaw @ 12/24/2012 6:53:17 AM
RE: Replace textbox with label in grid Posted by Rahul Moudgill @ 12/24/2012 6:58:19 AM
RE: Replace textbox with label in grid Posted by Sithu Kyaw @ 12/24/2012 9:32:18 AM
RE: Replace textbox with label in grid Posted by Rahul Moudgill @ 12/24/2012 11:49:15 AM
RE: Replace textbox with label in grid Posted by Rahul Moudgill @ 12/24/2012 7:00:04 AM
RE: Replace textbox with label in grid Posted by Sithu Kyaw @ 12/24/2012 7:07:41 AM
RE: Replace textbox with label in grid Posted by Rahul Moudgill @ 12/24/2012 7:33:26 AM
RE: Replace textbox with label in grid Posted by Sithu Kyaw @ 12/24/2012 7:43:54 AM
RE: Replace textbox with label in grid Posted by Cetin Basoz @ 12/24/2012 3:39:20 AM
RE: Replace textbox with label in grid Posted by Sithu Kyaw @ 12/24/2012 6:01:35 AM
RE: Replace textbox with label in grid Posted by Cetin Basoz @ 12/24/2012 8:46:35 AM