Tiled background picture on MDI form

Hi all,

I used in some apps a tiled background picture - usually on an form -
to display a company logo.
That's easy, load the logo into a StdPicture und use PaintPicture in
2 nested loops to paint the logo "tiles" on the form background.

In a new app I have to tile the customers logo on the client area of
a MDI form. And the MDI form has no PaintPicture, ScaleMode,
ScaleX, or ScaleY.
I first thought about StdPicture.Render but it seems for the destination
ScaleMode must be vbPixels.
I came up with two solutions in plain VB6 and used the second:

1) a PictureBox on the MDI form.
    first load the logo into a StdPicture.
    in MDIform_Resize:
       PicBG.Align = vbAlignTop
       PicBG.Align = vbAlignLeft
       'now the PicBG fills the client area of the MDI form
       Call DrawTiledBackgroundPicture(PicBG, LogoPic)

2) no PictureBox, a helper form instead (a child form).
    Private Sub MDIForm_Load()
      Dim pic As StdPicture
      Set pic = LoadPicture("G:\BMPs\theirLogo.bmp", vbLPLarge, vbLPColor)
      myChildForm.Move 0, 0, 160000, 90000   'exceed any possible screen size
      Call DrawTiledBackgroundPicture(myChildForm, pic)
      Me.Show
      Set Me.Picture = myChildForm.Image
      Unload myChildForm
      Me.WindowState = vbNormal
   End Sub

The second solution is independent of the actual size of the MDI form, no code
necessary in the resize event, the huge tiled picture is always there, covering 
the
client area of the MDI form.

I would like to tile the picture on the MDI forms client area without using a
PictureBox or helper form.
I've little experience with the graphic APIs and it seems the MDI form is 
somewhat
different from the normal VB form.
So will code exaples I find on the internet work for MDI forms too?
I didn't find code for MDI forms but probably I didn't ask the right questions.
(English isn't my first language).
Please advice. If you think I should better stay with one of the solutions I 
have,
please say so.

Kind regards,

Helmut.

0
Helmut
2/17/2010 7:39:39 PM
vb.general.discussion 1016 articles. 0 followers. Follow

4 Replies
2645 Views

Similar Articles

[PageSpeed] 55

Helmut Meukel wrote:
> I would like to tile the picture on the MDI forms client area without using a
> PictureBox or helper form.

You might, or might not <g>, like what I rigged up here:

  http://vb.mvps.org/samples/MdiBack

It's pretty much a "set it and forget it" helper class that does the 
dirty work for you.

-- 
..NET: It's About Trust!
http://vfred.mvps.org


0
Karl
2/17/2010 8:35:30 PM
"Karl E. Peterson" <karl@exmvps.org> schrieb im Newsbeitrag 
news:eZiNBDBsKHA.3408@TK2MSFTNGP06.phx.gbl...
> Helmut Meukel wrote:
>> I would like to tile the picture on the MDI forms client area without using a
>> PictureBox or helper form.
>
> You might, or might not <g>, like what I rigged up here:
>
>  http://vb.mvps.org/samples/MdiBack
>
> It's pretty much a "set it and forget it" helper class that does the dirty 
> work for you.
>
> -- 
> .NET: It's About Trust!
> http://vfred.mvps.org
>

Karl, thank you.

Helmut.

0
Helmut
2/17/2010 9:02:15 PM
"Helmut Meukel" <NoSpam@NoProvider.de> schrieb im Newsbeitrag 
news:eHgC$RBsKHA.3800@TK2MSFTNGP06.phx.gbl...
> "Karl E. Peterson" <karl@exmvps.org> schrieb im Newsbeitrag 
> news:eZiNBDBsKHA.3408@TK2MSFTNGP06.phx.gbl...
>> Helmut Meukel wrote:
>>> I would like to tile the picture on the MDI forms client area without using 
>>> a
>>> PictureBox or helper form.
>>
>> You might, or might not <g>, like what I rigged up here:
>>
>>  http://vb.mvps.org/samples/MdiBack
>>
>> It's pretty much a "set it and forget it" helper class that does the dirty 
>> work for you.
>>
>> -- 
>> .NET: It's About Trust!
>> http://vfred.mvps.org
>>
>
> Karl, thank you.
>
> Helmut.
>

Karl,

I've tested your solution and I like it.
It's more than I asked for (tiled, centered, stretched and colored).
So I put it into my toolbox too, for future use. <g>

Thanks again.

Helmut. 

0
Helmut
2/19/2010 12:07:01 PM
Helmut Meukel wrote:
> "Helmut Meukel" <NoSpam@NoProvider.de> schrieb...
>> "Karl E. Peterson" <karl@exmvps.org> schrieb...
>>> Helmut Meukel wrote:
>>>> I would like to tile the picture on the MDI forms client area without 
>>>> using a
>>>> PictureBox or helper form.
>>>
>>> You might, or might not <g>, like what I rigged up here:
>>>
>>>  http://vb.mvps.org/samples/MdiBack
>>>
>>> It's pretty much a "set it and forget it" helper class that does the dirty 
>>> work for you.
>>
>> Karl, thank you.
>
> I've tested your solution and I like it.
> It's more than I asked for (tiled, centered, stretched and colored).

I frequently have "issues" with overkill, yeah. <g>

> So I put it into my toolbox too, for future use. <g>
>
> Thanks again.

Glad that worked out for you!  Thanks...

-- 
..NET: It's About Trust!
http://vfred.mvps.org


0
Karl
2/19/2010 7:20:26 PM
Reply:

Similar Artilces:

Web Page Background
Good Morning, I use Excel to publish a variety of websites. Normally I use a white background. If I hilite all the cells and use a different color as the fill color, when I publish that page the page is still white around the border. How do I resolve this? Thank you. Benito Torres ...

auto adjust picture to fill complete pictureframe ?
Hi, I�m trying to get a picture to fit a frame. I put a picturefame in the document. Then i replace the frame by a picture and the frame is adjusted for the picture size.... So, all i get untill now is a frame that is adjusted instead of a picture that is adjusted to fill the entire frame. Can anyone help me please ? Thanks, Pierre Try an empty shape instead. Or simply insert the picture and manually adjust. When you create an empty picture frame and then insert a picture into the frame, the frame will adjust the picture proportionally. If you use an Autoshape, Fill, Fill effects, Pic...

Form Setup
Hello All, I am attempting to design an Access database that will track route scheduling. Basically what i am trying to do is allow a user choose a day of the week from a combo box and then autopopulate a subform with that day's route numbers and other information. Basically the each day of the week has numerous route numbers and other information such as route driver, vehicle number, route type that i am trying to display in a subform below a date and day heading. I want the user to be able to assign a route driver and a vehilce number to each route for the day. All the other...

how to repeat print single tile of multiple tile poster?
in publisher one tile of multiple tile poster failed to print (ran out of ink). how do I print only the tile that missing? Other than complete (20 sheet) print run. There is no easy way of doing this. Take a look at print preview to determine what tile you need to print. Create rectangles around the areas you don't want to print, fill with white, no line. Keep checking print preview to be sure you are covering the correct tiles. You will end up printing 20 pages, but only one will use ink. -- Mary Sauer http://msauer.mvps.org/ "billyb." <billyb.@discus...

error 2950 trying to get value of cbo box to fill in value on form
Ok, I have a cboBaseData box that the user can use to select a base for a pitch. BaseID is also a field in the form. I used a macro to set the value of the BaseID field to the 1st column in the cboBaseData on update. I'm getting error 2950 when I try to use the cbobox now. Should I be doing this some other way? ...

Can I make my own picture into a symbol for use in word/excel?
I created some graphics that I want to insert as symbols (half circle, quarter circle, full circle - pie charts). How can I turn into symbols that can be added to the autocorrect feature on word? Insert the picture into a document. Right-click the picture and make sure to specify the Text Wrapping that you want. Select the picture and then display the AutoCorrect dialog box (in Word 2007, click Office button | Word Options | Proofing | AutoCorrect Options). In the "Replace" box, type whatever key combinations should trigger the AutoCorrection. At "With," be ...

Minimized MDI Children
Hi, all I remember in 3.0 when an MDI child is minimized it becomes an icon instead of a shrinked/shortened titlebar as it is now. Is there an option to turn a minimized MDI child window into an Icon instead? If yes, how to do it in MFC? I'm using VS6+sp5. Thanks, Vincent ...

Report Selector Form Disappears
In my program (.mde) I have a form "Report Selector" which allows users to use two drop down lists to select first the type report (Daily Accounting, Monthly Accounting, Lookups, etc) and then the specific report from a list of reports in that type. It has been working for about 9 years; suddenly 2 users report that when they click on the Report Selector button, nothing happens. One supplied me with a "Snag-it" that showed that the first drop-down list appeared but none of the RS form. That tells me it at least got into the On Open routine. I have supplied...

Can I tile worksheets within a workbook, like one tiles workbooks.
It would often be very convenient to have two or more sheets from the same workbook displayed at the same time (tiled). One can do this with workbooks, but I cant seem to find a way to do it with worksheets within a workbook. Window>New window. Tile these and one set up with one sheet and one another. Two views of the same file. To close, close one window with the 'close' button, maximise the remaining one and save -- HTH Nick Hodge Microsoft MVP - Excel Southampton, England nick_hodgeTAKETHISOUT@zen.co.uk.ANDTHIS "Tovarish_Dad" <Tovarish_Dad@discussions.mi...

Why can't I format background for web page?
when I try to format a background for a web page it isn't working. Help! 1) How are you trying to format a background? 2) Define "isn't working". 3) Version of FrontPage. Not enough info. -- Tom [Pepper] Willett Microsoft MVP - FrontPage Since 1997 --------------------------- "village rose" <village rose@discussions.microsoft.com> wrote in message news:020E1997-4A88-4012-9960-C79CCED3B16F@microsoft.com... : when I try to format a background for a web page it isn't working. Help! ...

Coloured backgrounds using IF
Hi I am looking to format teh colour of cells using their values ie equal to or less than 5 Green 6 to 14 yellow 15 and greater red any help greatly appreciated. You would use Conditional Formatting to do this - available on the Format menu. Just follow the Wizard through and choose the Patterns tab for background colour. Hope this helps. Pete On Dec 8, 1:52=A0pm, Simon <Si...@discussions.microsoft.com> wrote: > Hi I am looking to format teh colour of cells using their values > > ie > equal to or less than 5 Green > 6 to 14 yellow > 15 an...

Picture in header
How do I get a picture in the header? This was added in xl2002. File|Page setup|header/footer tab|custom header There's an icon that looks like a picture near the far right. Steve wrote: > > How do I get a picture in the header? -- Dave Peterson If you are using a version of Excel before 2002 then check out: http://www.nwarwick.co.uk/Excel2000GraphicalHeaders.htm for a workaround. HTH Neil www.nwarwick.co.uk "Dave Peterson" wrote: > This was added in xl2002. > > File|Page setup|header/footer tab|custom header > There's an icon that looks lik...

Resize Forms in Access 2007
I thought I read somewhere that Access 2007 had a new function, or something, enabling you to have forms automatically resize to fit the screen resolution of the user. Is this correct, or am I wrong? If I am correct, how do you use this feature? Thanks, BobV On Aug 9, 8:41 am, "BobV" <rk...@earthlink.net> wrote: > I thought I read somewhere that Access 2007 had a new function, or > something, enabling you to have forms automatically resize to fit the screen > resolution of the user. Is this correct, or am I wrong? If I am correct, how > do you use this feature?...

how do you get rid of the default background of "page 1" in excel
It doesn't give you the option of delete background to clear the default. I tried to add a blank background and that didn't work either; the "page 1" stays on the excel sheet. It blocks view of numbers on the sheet and is very frustrating!! Go back to Normal view: View|Normal It's a feature of View|Page break preview Querty wrote: > > It doesn't give you the option of delete background to clear the default. > I tried to add a blank background and that didn't work either; the "page 1" > stays on the excel sheet. It blocks view of num...

Is it possible to leave Outlook Express running in background?
Hi Is it possible to leave outlook express running in the background without it appearing in the task bar? (Rather more like in the Notifcations area like MSN Messenger when you hit the (X) to "close" it). It really would be nicer if Outlook Express would not close but also not take up the Taskbar space. thanks StupidCranium wrote: > Hi > > Is it possible to leave outlook express running in the background > without it appearing in the task bar? (Rather more like in the > Notifcations area like MSN Messenger when you hit the (X) to "close" > it). >...

Form Dropdown Combo Box
My dropdown combo box currently displays one column. What I would lik to do is have the box dispay column A and B but only extract the I from B. How would I be able to do this -- Message posted from http://www.ExcelForum.com I'm not sure if I understand the problem correctly, but have you trie using a CONCATENATE function to join the values in Columns A & B? Say you have first names in Column A and surnames in Column B. Us something like =CONCATENATE(A1," ",B1) in Column C for the dropdow list. You could also use =A1&" "&B1. The apostrophe marks are just...

tile window
Version: 2008 Operating System: Mac OS X 10.6 (Snow Leopard) does anyone know how to tile microsoft word windows vertically on an osx The closest you will come is Word>Window>Arrange All. Then fiddle them manually. Otherwise, you need an AppleScript: http://www.macosxhints.com/comment.php?mode=view&cid=96187 Or a utility: http://www.apple.com/downloads/macosx/system_disk_utilities/windowtiles.html Cheers On 23/05/10 10:15 AM, in article 59bb8dd9.-1@webcrossing.JaKIaxP2ac0, "aprilgsims@officeformac.com" <aprilgsims@officeformac.com> wrote: &...

how do i change excel into picture format
i am trying to change an excel documnt into a jpeg or other picture format can anyone help me? i dont even know if its possible Take a screenshot. "deckieg" wrote: > i am trying to change an excel documnt into a jpeg or other picture format > can anyone help me? i dont even know if its possible Or just copy the cells you want to include in your jpeg and paste into Paint. "deckieg" wrote: > i am trying to change an excel documnt into a jpeg or other picture format > can anyone help me? i dont even know if its possible Select the cell to be shown in pict...

?WordArt, When Printing, First Character Has Dark Background?
Using Word or Publisher 2003, using WordArt, sometimes the document, including the WordArt, looks fine in Print Preview, but when I actually print (B&W is all I've tried), the first character of the WordArt has a dark background. If I have two WordArt objects in a document, one or the other will have the first character with a dark background. Explanation? Fix? -- (||) Nehmo (||) ...

slight image rotations to animate a picture
How do i animate an uploaded picture slightly to the left or right on an axis point, say 10 - 30 degrees in PowerPoint 2008 for the MAC? PM I suppose that same as in PC, you have a rotation effect (emphasis) "pm@cs" <pm@cs@discussions.microsoft.com> a �crit dans le message de news: 9EC9C5B5-AFF2-4182-BBAB-7ECB1080FBCB@microsoft.com... > How do i animate an uploaded picture slightly to the left or right on an > axis > point, say 10 - 30 degrees in PowerPoint 2008 for the MAC? > > PM ...

How do I turn a jpg image I have into a visio background?
I have a jpg image I downloaded for the net. I want to turn it into a background for a diagram I am creating. I also would like to make it transparent. I have looked on the help and can't find my answer. Please help. the simplist way is to drop it on a background page and then attach the background to your foreground images. al "doming07" <doming07@discussions.microsoft.com> wrote in message news:E476FD31-FFC3-45C5-8987-EBE2FB98C714@microsoft.com... >I have a jpg image I downloaded for the net. I want to turn it into a > background for a diagram I am creating. I...

Assign document for newly Created MDI ChildWIndow
My application is an MDI. It has an MDI window (main window). Now, I want to create a nother MDI window CMDIFrameWnd *main = new CMDIFrameWnd(); main->LoadFrame(IDR_ANALYSE, WS_OVERLAPPEDWINDOW | 32768, NULL, NULL); main->ShowWindow(SW_SHOW); Now, i create several child window in new MDI window main->CreateNewChild(RUNTIME_CLASS(ChildFrame)); main->CreateNewChild(RUNTIME_CLASS(ChildFrame)); class ChildFrame:CChildFrameWnd { } Now how to assign the View object (by RUNTIME_CLASS) to child frame and how to attach an EXISTING CDocument object to these view ? Thanks for your help ...

How to blend a button icon with its background?
Hi, I have a owner draw button. I cannot make its bitmap icon blend with the background. When editing its associated bitmap, I first unselect the "draw opaque" option in the image menu. Then make any background to white. What other should I do? Or is there a particular color instead of white for MFC to recogazine it's background? Please help. Thanks. Tony Tony, You might want to use TransparentBlt, check http://msdn.microsoft.com/library/default.asp?url=/library/en-us/gdi/bitmaps_2y9g.asp http://support.microsoft.com/default.aspx?scid=kb%3Ben-us%3B79212 and ht...

Modifying existing record from form
My goal is to try to create a form that allow users to search for a record in the table and pre-populate the information in that record, and then, allow users to input data into fields that has not yet been filled or to overwrite/change the existing record information for that particular record, without adding a new record (to avoid duplicates) but simply change the information to that record only. I have only gotten the form to add new records (using bound form) which I don't want, but I am not sure how to go about just modifying the existing record. Does anyone know? Many Thanks! ...

Tiling inPublisher
I have a document and when I try to print it the page setup is 'tiled' and it prints on 4 different pages, how do I remove the tile page setup so that the document just prints out on one sheet? It is possible that you have created your document on a paper size that is not supported by your printer. Try changing your paper size to 8 1/2 by 11 and see if the print options are more to your liking. "Courtney" <Courtney@discussions.microsoft.com> wrote in message news:BF0281F6-C495-49FE-84C5-8F2C93445D02@microsoft.com... >I have a document and when I t...