Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

1. Sending An Email Via SMTP -- 2. Changing a grid's textbox to combobox

Status
Not open for further replies.

TGrahmann

Programmer
Feb 19, 2015
43
US
1. Hi, Just wondering if anyone has heard of a function where you can send an email via SMTP in FoxPro.

2. As I have figured out, the cells in a grid are actually a textbox, I wonder if we can change to a combobox?
Thanks!
 
Both of these have been frequently asked for the last 20 years. Have you tried anything on your own yet?

For #1 see
(or Google it for MANY other options)

For #2, select the column IN THE PROPERTY SHEET, choose a combobox from the controls toolbar, and click on the column. Then set CurrentControl on the property sheet.

This forum works best if you say what you've tried and what didn't work. We're good, but we're no substitute for a quick Google search.
 
I've tried changing the baseclass property in the second scenario. I've done multiple searches for the first and couldn't find much. Regarding #2, What do you mean by property sheet?
 
I need to do it during the code run. It isn't a static grid, the columns are created based on a table.
 
The baseclass property does not come into play so I'm not sure why you're trying to change it. But you apparently have requirements not already spelled out.

The issue here is understanding the basic containership model, but there appear to be other factors in play. Why don't you tell us what all of them are instead of making us guess?

For the first part:
 
If you want your notepad window to become Office Word, do you simply write "Word" on the canvas and it changes?

You can't change an existing control by changing it's baseclass property, this is not possible at all, not only because the baseclass property is readonly. Even if it would be writable, what is loaded into memory is a textbox, and changing it's baseclass from textbox to combobox would not change the object. This is almost as changing the label of something and expecting it changed. I dare to suggest you simply write a needed amount of money on your wallet or notes (why is it called notes anyway?). You see: Nothing works this way, not in reality or in a programming language.

If you want something else you use RemoveObject() to remove the unwanted control and AddObject() to add the wanted control. Before adding columns by adjusting columncount you can also specify a memberclass/memberclasslibrary to tell vfp what to use instead of the standard column with the standard textbox.

In short, deep dive into OOP, VFP9 is not FoxproDos. Forms are not screens.

Bye, Olaf.
 
To add an object to a column, you can use the column's Addobject() method.
Then set the Column's CurrentControl property to the newly created object's name.
And don't forget to set Visible = .T.
(Check the VFP help for Addobject, CurrentControl, RemoveObject.)

But a combobox in a grid is not a simple thing.
Better follow danfreeman's advice and give more details.

Respectfully,
Vilhelm-Ion Praisach
Resita, Romania
 
Mr. Grahmann, welcome to the forum. I see you have already had a good answer to your earlier question about masking passwords, and you are getting some useful help with your grid question.

However, in order to get the best from the forum, you should avoid asking two separate unrelated questions in the same thread. In the current thread, you have asked about sending email and about using combo boxes in grids. There is no connection between these two topics. Posting these as separate questions would have made it easier for people browsing the forum to know what the thread is about; it would avoid cluttering the thread; and it would help other people who might have the same problem and are searching for a solution.

I definitely don't want to discourage you from posting your questions, but it would help you and help us if you observe this simple bit of advice.

Also, if you haven't already done so, you might want to take a look at faq184-2483.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top