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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

EditBox not higlighting...

Status
Not open for further replies.

dennis22

Programmer
Oct 8, 2002
32
I am currently creating a grid class where I replace the textbox with a editbox if the field is a memo.

using this code below;

Code:
this.RecordSource = (this.gridalias)
this.RecordSourcetype = 1 

for iColIndex = 1 to this.ColumnCount 
    this.Columns[iColIndex].Header1.FontBold = .t.
    this.Columns[iColIndex].Header1.FontName = "Arial"
    this.Columns[iColIndex].Header1.Alignment = 2
    this.Columns[iColIndex].Header1.Caption = upper(this.Columns[iColIndex].Header1.Caption)
    
    if type(this.Columns[iColIndex].Text1.Controlsource) == "M"
        this.Columns[iColIndex].AddObject("Edit1","editbox")
        this.Columns[iColIndex].CurrentControl = "Edit1"
        this.Columns[iColIndex].text1.Visible = .F.
        
        this.Columns[iColIndex].Edit1.IntegralHeight = .T.
        this.Columns[iColIndex].Edit1.BorderStyle = 0
        this.Columns[iColIndex].Edit1.Visible = .T.
        this.Columns[iColIndex].Edit1.Scrollbars = 0
        
        this.Columns[iColIndex].Sparse = .f.
        this.Columns[iColIndex].ReadOnly = .F.
    endif 
next

this.Highlight = .t.
this.HighlightRow = .t.
this.HighlightStyle = 2 
this.HighlightRowLineWidth = 0

The reason why I needed an editbox is that I needed to show the memo field values in the grid completely and the capability to edit the memo field without introducing another window. (I think you know what I mean...)

My problem is even if I set the HighlightRow and HighlightStyle, the memo field Column is not Highlighted, only the text1 objects are.

Is there any fix to this problem, or maybe another alternative? I am using VFP8.

Thanks!
 
Thanks for the quick reply.

I tried that but still the editbox did not highlight. I also removed the text1 instead of just setting it to visible = .f., but still no luck.
 
Hello Mike!

I made a mistake, you are right BackStyle does the job.

Thank you very much!

Regards!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top