Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    Visual Basic




Change Chart Scale With Vba


I'm trying to change the value scale of a chart using VBA but I get the error "unable to set MinimumScale property of axis class". This is my first time manipulating a chart in VBA and I'm a little confused about the object classes. My charts are embedded in a worksheet and the code should scroll through each chart and change it's maximum value to the value of a cell on the worksheet. Everything works great until I get to actually assigning the values. Any advice? My code is below.

Thanks,

Dave


Code:
Private Sub ReScaleCharts()
Dim c As Object
Dim wksYTD As Worksheet
Dim sngMaxScale As Single
Dim sngMinScale As Single

'assign worksheet to variable
Set wksYTD = Worksheets("Rev_Exp")

'loop through charts
For Each c In wksYTD.ChartObjects
Select Case c.Name
Case "Rev_YTD"
sngMaxScale = Range("revmaxscale")
sngMinScale = 0
Case "Exp_YTD"
sngMaxScale = Range("expmaxscale")
sngMinScale = 0
Case "EBITDA_YTD"
sngMaxScale = Range("ebitmaxscale")
sngMinScale = 0
Case Else
MsgBox c.Parent.Name
End Select

'assign min and max scale values
With c.Chart.Axes(xlValue)
.MinimumScale = sngMinScale
.MaximumScale = sngMaxScale
.MinorUnitIsAuto = True
.MajorUnitIsAuto = True
.Crosses = xlAutomatic
.ReversePlotOrder = False
.ScaleType = xlLinear
.DisplayUnit = xlNone
End With
Next c
End Sub




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Chart Auto Scale
I have an Excel Worksheet with a button that opens a form. On this form is a chart. I want this chart to automatically scale, based on the highest value (dollar amounts ranging from 0 to a few thousand). I have some sliders that the y-values follow on the form also. With the code below, the scale changes as the slider values change, but the max is not always one of the major gridlines. In other words, there is sometimes a bit of space above the last major gridline on the y-axis and the .Max value. How can I ensure that the Max is also one of the gridlines? Should I just take the max and divide it by some nice numer (say 200 or 500) and make that interval the gridlines?
Code:Dim inCalcValues(16) 'an array storing all of my y-values
Dim strValues As String 'my y-variables
Dim strYears As String 'my x-variables
Dim objChart As owc11.ChChart
Dim objChartSpace As owc11.ChartSpace
Dim axCategoryAxis As owc11.ChAxis
Dim axValueAxis As owc11.ChAxis

Private Function FindMaxValue() As Integer
    FindMaxValue = 0
    
    For i = 0 To 15
        If intCalcValues(i) > FindMaxValue Then FindMaxValue = intCalcValues(i)
    Next i
End Function

Function RoundOff(ByVal n As Integer, p As Integer) As Long
    RoundOff = ((n + Sgn(n) * (p 2)) p) * p
End Function

Private Sub SliderXX_Scroll()
    intCalcValues(XX - 1) = Me.SliderXX.Value
End Sub

Private Sub UserForm_Initialize()
    '...
    
    objChart.SeriesCollection(0).SetData chDimCategories, chDataLiteral, strYears
    objChart.SeriesCollection(0).SetData chDimValues, chDataLiteral, strValues
    
    axValueAxis.Scaling.Maximum = RoundOff(FindMaxValue, 100) + 200
    axValueAxis.MajorUnit = RoundOff(CInt(axValueAxis.Scaling.Maximum / 100), 10) * 10
End Sub

- bungee41


Edited by - bungee41 on 7/22/2006 2:31:03 PM

Chart Changing Maximum Scale
Hello guys!

I am not verry experienced programmer in VB.

I did a line chart where I set one rof of data from a table. Using a combo box I am changing values in this chart.
Because the data is changing upon a selection very much I would like to set maximum and minimum scale by using VB.
The code is thereinafter of this message. I do not know, why I does not work.

Please help me. Thanks. Boris


j = Range("O4").Value
k = Range("N4").Value
Range("D3").Select
ActiveSheet.ChartObjects("Chart 5").Activate
ActiveChart.Axes(xlValue).Select
With ActiveChart.Axes(xlValue)
.MinimumScale = j
.MaximumScale = k
.MinorUnitIsAuto = True
.MajorUnitIsAuto = True
.Crosses = xlAutomatic
.ReversePlotOrder = False
.ScaleType = xlLinear
.DisplayUnit = xlNone
End With

Changing The Axis Scale In MS Chart
Hi,

I'm Ratnakar Pedagani. I'm writing a program in visual basic to
display XYscatter or line chart. I'm getting values from a file which
consists of 10000 lines. For every line in the file i have to show
statistics on the chart. The problem i'm facing is with the X and Y
axis scale. With the different values of each line from the file i'm
retreiving it, I want to change the x and Y axis scale. All the values
taken from the file are of data type double and stored in an two
dimensional array. Then the values of array is directly assigned to
chartdata. I would be grateful if i could get Any help or Reference as
soon as possible.

Thanking you,

Awaiting your reply,
Regards,
Ratnakar Pedagani

Adjust Chart Scale With SpinButtons?
Looking for easy way to adjust embedded chart scale.

something like :


Private Sub SpinButton1_SpinDown()

 Worksheets("Sheet1").ChartObjects(1).Chart.Axes(xlValue, xlPrimary).MaximumScale = _
 Worksheets("Sheet1").ChartObjects(1).Chart.Axes(xlValue, xlPrimary).MaximumScale -5

end sub

Find Tool From Chart Point - Scale Problem
Looking for a better idea

PROBLEM

When the YScale is compressed (for example the Y axis is 0 to 1000, instead of 0 to 100), the fudge value (+/- Y Increment) becomes so large that it almost always finds the first tool in the table instead of the correct tool.

BACKGROUND

I have a number of tools that are plotted interactively on a chart.

Chart scale is adjusted dynamically based on the Y value.

Certain tool can only have a YAxis Look Value (such as a horizontal line) while other tools need an (X, Y) pair to lookup (for example the end points of a pencil line).

My database table must store the original values for X and Y not a pixel value.

These table values are obtained by converting the mouse_click pixel point (X,Y) to a value which is then used in an SQL query which contains parameters to bracket (+/- fudge) for lookup of the DB table values (X, Y).

---------------------------------------------
Thanks to everyone who took a look see.

The problem existed in a multi-tier parameter query NOT in the fudge.

Change Axis Scale
Hi,

I have data that is computed based on the user's input parameters. The resulting outputs are then graphed on a XY Scatter chart. The X values are the computed Moments and the Y values are the computed weights. I am trying to automate the chart axis' to change as the user inputs are changed. I would prefer to round the minimum value down and round the maximum value up to the next major unit, in my case 100. Can anyone be of any assistance in helping me? Thank you soo much!

How To Change Axis Scale In MSChart?
Another mschart question:

I want to control the scaling in my graph but I don't know how.

The automatic scaling works quite well but how do I change the values through the code when I disable the automatic scaling?

PSE HLP TNX!

Cannot Change Mschart Axis Scale
hi, guys:

i am wondering whether i can change the x-scale for 2dline mschart. since after putting the code below into my project, the graph still goes the same way as the code is not there. can anybody enlighten me? thanks so much!


Code:
MSChart1.Plot.Axis(VtChAxisIdX).ValueScale.Auto = False
MSChart1.Plot.Axis(VtChAxisIdX).ValueScale.Minimum = min
MSChart1.Plot.Axis(VtChAxisIdX).ValueScale.Maximum = max

or maybe it is due the way i insert the data? below is the code


Code:
For x = min To max
MSChart1.Row = x
MSChart1.RowLabel = x
Call MSChart1.DataGrid.SetData(x, 1, containerNo(x), nullFlag)
Next

How To Change The Form Scale Mode To Pixels
How to change the form scale mode to pixels
i want all the controls scale mode as pixels
if i change the form scale mode to 3-pixels, how to change the controls mode to pixels?

QUICK HELP:Change Gray Scale Picture Into Strict While-black
hi,i need a VERY QUICK HELP:

i have a picture in a gray scale (range between white and black)
and i need to convert it into strict white-black picture
does anyone can provide me with a suitable equation?

i really need ur help guys,and i need it fast!

thnx

Scale Width, Scale Height
I see...thank you two very much

Change Chart Name??
howdy folks

im automating chart updates in Excel
ran inro a problem though
i want my code to to delete a chart and then rebuild it
however, i need to specify in my code what the chart name is
and apparently, that name changes everytime you create a new chart
here's some code to help you understand my problem:

VB Code:
Sub whatever()        Selection.Copy    ActiveSheet.ChartObjects("Chart 5").Activate 'this is what im talking about(Chart 5) that changes so how do i name the chart myself so my code will work everytime    ActiveChart.PlotArea.Select    ActiveChart.SeriesCollection.Paste Rowcol:=xlRows, SeriesLabels:=False, _        CategoryLabels:=False, Replace:=False, NewSeries:=False    ActiveWindow.Visible = False    Application.CutCopyMode = False ActiveCell.offset(rowOffset:=1, columnOffset:=0).Activate  End Sub

Help!Change Pie Chart Colour
Hey there,

I'm not too sure on how to go about this.. how do i randomly change the pie chart colour accordingly...for example data one from the database would be yellow data two from the database would be green.. anyone with any bright ideas...

Thus far my codes are as such


Code:
Rs.Open "Select * From AmountWindow", Cn, adOpenStatic, adLockOptimistic

Do Until Rs.EOF

PieGraph.AddSegment Rs!Amount, Rs!ActiveWindowTitle, &HFFFF& 'Blue

Rs.MoveNext
Loop

'Draw the pie chart.
PieGraph.DrawPie picPie.hdc, picPie.hwnd, True, "The percentage Amount Of Active Window Open"

'Clear the segments ready for redraw.
PieGraph.Clear

Thanks

How To Change Rowlabel Of Ms Chart In VB6?
If my chart has only a one column, I can change them rowlabels by MsChart1.Rowlabel = "Jan" etc. But the chart has two columns or more I can not do it.

Could you tell me how coding to solve it?

Thanx

Change Pie Chart Colour
Hey there,

I'm not too sure on how to go about this.. how do i randomly change the pie chart colour accordingly...for example data one from the database would be yellow data two from the database would be green.. anyone with any bright idea...

This far my codes are as such


VB Code:
Rs.Open "Select * From AmountWindow", Cn, adOpenStatic, adLockOptimistic        Do Until Rs.EOF        PieGraph.AddSegment Rs!Amount, Rs!ActiveWindowTitle, &HFFFF&    'Blue        Rs.MoveNext    Loop        'Draw the pie chart.    PieGraph.DrawPie picPie.hdc, picPie.hwnd, True, "The percentage Amount Of Active Window Open"        'Clear the segments ready for redraw.    PieGraph.Clear


Thanks

Change Chart Type
Hi all,
I have a workbook that includes a pie chart with name “graph1” on a worksheet. I ask from a user to change the chart type to columns. I need a code that checks if the user makes the right changes or not. I tried the following code without success:
Code:
Dim xlap As New Excel.Application
With xlap.Charts(“graph1”).Add <---??
If xlap.ActiveChart.ChartType = xlColumnClustered Then
msgbox “right answer”
End If
End With

Please Help!
Thanks in advance

Change Chart Type
Hi all,
I have a workbook that includes a pie chart with name “graph1” on a worksheet. I ask from a user to change the chart type to columns. I need a code that checks if the user makes the right changes or not. I tried the following code without success:

Code:
Dim xlap As New Excel.Application 'a reference to ecxel workbook
With xlap.Charts(“graph1”).Add '<---??
If xlap.ActiveChart.ChartType = xlColumnClustered Then
msgbox “right answer”
End If
End With


Please Help!
Thanks in advance

Change Chart Order In Chartobjects
Is it possible to change the index of a chart in a chart object.
I want to reorder my charts.
---------------

Code:
Sub hulpie()
Dim c As Object
For Each c In Charts("charts").ChartObjects
if c.name="Chart 1" then
c.Index = 0
end if
Next
End Sub
The line c.index does not work.


Fred

Macro To Change Chart Source Data
i am very new to VB and excel macros...but here's what i want to do, it seems like it shouldn't be too hard.
i want a macro that will shift the source data of a chart down 2 rows. for example, if i have "R10C17:R10C19" as my x-variable set and "R11C17:R11C19" as my y-variable set and i want to change them to "R12C17:R12C19" and "R13C17:R13C19". i want this to be a continuous relative offset so that the final product will be an animation effect as the source points change in the chart through the running of the macro loop.
any help would be appriciated.

Trigger Pivot Chart Change Event
I have a pivot pie chart and I want to show the percentages around the chart. However, every time I change one of the page fields, the data labels disappear. I figured the easiest way to correct this would be to do some sort of change event so any time the chart is changed it would call a macro to add the labels in. I tried worksheet_change(), but that didn't do anything. Any advice?

Thanks!

How Do I Change A The Title Of An Excel Chart In Word?
I have a excel chart in word - and would like to change the font,line colours and titles using VBA.

I have read that people use Chartobjects do this.
The following statement is normally used
Dim x as chartobjects, y as charts
- I get a "User type not defined" for this line.

Please help!

Change Excel Chart Plotarea Color Through VB
Hi,

I am using VB6 to export data and plot a chart on an Excel worksheet. Then I tried to change the plot area color but not successful. I tried:

chartObject.Chart.PlotArea.Interior.ColorIndex = 8

It got an error: 1004 Unable to get the Interior property of the PlotArea class

However, when I tried chartarea (the outside area) and it works fine:

chartObject.Chart.ChartArea.Interior.ColorIndex = 8

Why? How can I do it?

Jeff

How To Change The Thickness Of Line-plot In MS Chart Control?
Hi,

I used Microsoft Chart Control 6.0 (SP4) to plot a 2-D line graph. I noted that the thinkness of the line graph is quite thick. Would anyone pls advise how to adjust the thickness so that it becomes thinner?

TQvM

Automation: Change Excel Chart Data Ranges From Vb6
I'm accessing two Excel charts from a VB6 program.
The VB6 program allows user to enter parameters used to filter queries on an Access database, and graph the results (EEG parameters across all sessions for that subject). The graphs have been setup in Excel. I can change the data easily, as needed. But, the only reference I have seen that enters the data ranges for the data behind the chart is the use of a ChartWizard that creates a chart with a small subset of chart parameters that includes a data range that needs to be contiguous. I need to find out how to access, and modify, the chart data ranges for each series. None of the information on the Excel object model for charts drills down deep enough to provide the info I need.

(Worksheets(1).ChartObjects seems interesting but I don't know what its properties are, except "count", which I guessed, and that a following (Chart 1") will access Chart 1.)

I need to find a way to set the data ranges on each series individually. (The data is already in place.)

I would like help on this problem specifically, and would welcome any hints on more efficient ways to get deeper into the object model, including how one "gets" or "puts" the various properties.

Thanks, in advance,
Jim

How To Change The Thickness Of Line-plot In MS Chart Control?
Hi,

I tried to plot a 2D line graph using MS Chart Control. I noted that the thickness of the line plot is too thickness for my application. Would anyone please advise how could I adjust the thickness so that the line plot becomes thinner?

TQvM

Change Chart Title In Report (Not A Form) At Runtime
I have a chart on a report, and I want to change the title of the chart at runtime using VB code. I know how to do this on a form, but the same technique does not work for a chart on a report.

Error:Change Y-axis Of Scale Of "Microsoft Graph 2000" Graph
Error:Change y-axis of scale of "Microsoft graph 2000" graph


A graph object can be accessed (to change the scales) this way in an Excel application.
With ActiveSheet.ChartObjects("Chart 2").Chart.Axes(xlValue)
.MaximumScale = 15
.MinimumScale = 5
End With

What is the equivalent in an Access 2000 application or Visual basic? I am trying to change the max and min on the y-axis (of a linear graph OLE Class: Microsoft graph 2000 chart and class: MSGraph.Chart.8) based on the data I am plotting. Each of the code (tries) below gives me an error such as “object doesn’t support this property of method”

With Me.[ContractLinearGraph].Axes(2)' this blows up
'With Me.[ContractLinearGraph].axes(xlvalue) ' this blows up
'With Me.[ContractLinearGraph].Chart.Axes(xlValue)' this blows up
'With Me.Application.ChartObjects("ContractLinearGraph").Chart.Axes(xlValue) ' this blows up

If bPlottable Then
.MinimumScaleIsAuto = False
.MaximumScaleIsAuto = False
.MinimumScale = CDbl(yaxisMinimum)
.MaximumScale = CDbl(yaxisMaxmum)
End If
End With

How To Change Source Data In Pie-Chart In Excel According To Runtime Data Through Vb
Is it possible to update the sourcedata (number of rows) for pie-chart in excel application thorugh VB.Ifso please let me know.


Thanks

MS Chart Reliability - Radar Chart / 3D Pie Chart
I see a lot of issues with MS chart.... I'm mostly coding my charts (not using MS Chart), but I'm stuck with the Radar Chart ... I haven't found any examples to work on and I need this chart badly (a polygon with nine corners - a nonagon).

Any feedback on MS Chart? Is it reliable and stable? If it is I might end up using it to create my radar chart, but I'm not sure MS Chart can make a Radar Chart... if not then:

The image I've attached shows what I want to code.

Does anybody have any code regarding a RADAR CHART? (not an Active X, source code)

Thanks

_________________________________________________________________

Edited by - vbprog1144 on 5/19/2005 11:48:26 AM

Embedded Chart In A Worksheet And A Chart Exisiting On Its Own Sheet
what is the difference between a Chart embedded in a worksheet and a chart existing on their own sheets. i mean what is the difference between being embedded in a worksheet and existing on their own sheets.


i came across the statement on the MSDN site

Note Charts embedded in a worksheet are members of the ChartObjects collection, whereas charts that exist on their own sheets belong to the Charts collection.

Is There A Good Graph/Chart Tool Anywhere??? MS Chart Isn't Working For Me!!!
I need to graph 4 columns of data against a time (x-axis) produced from a SQL select in VS.net. I've tried working with the MS chart, but its hard to work with and looks even worse.

I'm looking for something that can produce a "smooth" line chart.

Does anyone know of a GOOD graph/chart tool compatible with VS.net (windows app though, not Web app.)???

And if it is a free tool, that would be even better!!!

Julez

Create Chart In Access Using Chart Object
Code:

Dim rpt As Access.Report
Dim ctlObjFrame As Access.ObjectFrame
Dim SQL As String
Dim cw_rs As DAO.Recordset

SQL = "SELECT (Format([Date1],'DDDDD')),Sum([Events]) AS [SumOfEvents] FROM [Data] GROUP BY (Int([Date1])),(Format([Date1],'DDDDD'))"
Set rpt = CreateReport
Set ctlObjFrame = CreateReportControl(rpt.Name, acObjectFrame, , "", "", 100, 100)
Set cw_rs = CodeDb.OpenRecordset(SQL, dbopendynaset)
cw_rs.MoveFirst
ctlObjFrame.OleData= cw_rs!ChartObject
DoCmd.Restore
I got the above code from a site. It creates a new report & an objectFrame. But during run-time it gives error in "ctlObjFrame.OleData" as "Items not found in the collections" error. Can anyone please tell me why i get this error.

Chart Director Chart Viewer
i have a sample code here for my graph:


Public Sub createChart(viewer As Object, img As String)

Dim cd As New ChartDirector.API
Dim i As Integer
'The XY points for the scatter chart
Dim dataX0()
dataX0 = Array(summationx)
Dim dataY0()
dataY0 = Array(summationy)

' Dim dataX1((frminput.txtx(i - 1)))
' dataX1 = Array((frminput.txty(i - 1)))
'
' Dim dataY1()
' dataY1 = Array()

'Create a XYChart object of size 450 x 420 pixels
Dim c As XYChart
Set c = cd.XYChart(1000, 1000)

'Set the plotarea at (55, 65) and of size 350 x 300 pixels, with a light grey
'border (0xc0c0c0). Turn on both horizontal and vertical grid lines with light
'grey color (0xc0c0c0)
Call c.setPlotArea(55, 65, 350, 300, -1, -1, &HC0C0C0, &HC0C0C0, -1)

'Add a legend box at (50, 30) (top of the chart) with horizontal layout. Use 12
'pts Times Bold Italic font. Set the background and border color to Transparent.
Call c.addLegend(50, 30, False, "timesbi.ttf", 12).setBackground(cd.Transparent)

'Add a title to the chart using 18 pts Times Bold Itatic font.
'Call c.addTitle("Center of Gravity", "timesbi.ttf", 18)

'Set the axes line width to 3 pixels
Call c.xAxis().setWidth(3)
Call c.yAxis().setWidth(3)

'Add an orange (0xff9933) scatter chart layer, using 13 pixel diamonds as symbols

For i = 0 To UBound(arrX)
Call c.addScatterLayer(arrX, arrY, "", cd.DiamondSymbol, 13, &HFF9933)
Next

'Add a green (0x33ff33) scatter chart layer, using 11 pixel triangles as symbols
Call c.addScatterLayer(dataX0, dataY0, "Strategic Area", cd.TriangleSymbol, 13, _
&H33FF33)

'output the chart
Set viewer.Picture = c.makePicture()

'include tool tip for the chart
viewer.ImageMap = c.getHTMLImageMap("clickable", "", _
"title='[{dataSetName}] X = {x} , Y = {value} '")

End Sub

Private Sub ChartViewer1_ClickHotSpot(hotSpot As Collection, Button As Integer, Shift As Integer, X As Single, Y As Single)

End Sub

Private Sub Command1_Click()
frminput.Show
Unload Me

End Sub

Private Sub Form_Load()
createChart Me.ChartViewer1.Object, Me.Picture1
End Sub


but it seems that when ever i would put a label for the the orange point in my graph it would multiply itself like it is being arrayed. i know its kinda confusing but if you want i could post my whole program here so that you could all understand me. thanx!!!

Save A Chart Using Chart Director
Have anyone here use a activeX call Chart Director to create chart? I've successful create the chart i want but i cant seem to save the file. Here is the code i got for the save button:

Code:
Private Sub CmdSave_Click()
Dim c As XYChart
Dim strsavefile As String
With CommonDialog1
'.Filter = "Pictures (*.bmp)|*.bmp"
.DefaultExt = "JPG"
.CancelError = False
.ShowSave
strsavefile = .FileName
If strsavefile = "" Then Exit Sub
End With

Call c.makeChart("strsavefile")

End Sub


I keep getting a object or variable not set. How do i fix this?

How To Make A Chart (MS Chart) With Data From A DB????
Hi all,


Can u show me how to have a chart produced from data directly (or indirectly) from a MDB (access2000)???



An example project would be brilliant, or the code???




Please help

Draw Bar Chart ,pie Chart In Excel Using Vb
i want to draw pie,bar chart in excel using vb. database is ms access. pls advise me.

Clustered Chart With Stacked Chart
hi,

os XP
VB.NET WITH EXCEL 2000

i can creat charts with stacked column.
now i need create a chart with a combination of clustered and staked column.
how to create it?
is it possible with excel 2000 or not?

thanks
sudarleo

Print Contents Of A CHART (MS CHART)
Kindly help me in printing the contents of a Chart control along with the contents of a picture box control. I have the code to print the contents of the Chart. But I want to print a bitmap as the heading of the Chart. This bitmap is assigned to a picture box during runtime. The output should be :
The bitmap which will serve as the heading followed by the Chart.
Thank you for your time.

K. Ravi

Tif Scale
Hi!

i hope someone can help me please:

i have a tiff image which i want to show in a picturebox. i try to use the kodak img component and it can show the image but not resize it to 320x320 px.

The i found this page:
http://vbnet.mvps.org/code/imageapi/mswaidll.htm

which is also nice, but even there i can not rescale the picture to my resolution.

Can someone help me please???

Thanks a lot

Scale
hello what are the scale properties for example in picture box ? scale height etc. thank you.

Scale
I have a series of dimensions in inches that I would like to convert to pixels or inches. Does any one know how to do this?

Possabily like: ?

psngScale = 0.025

a = ScaleX(CSng(mrstCustom![fldBase]), vbInches, vbTwips) * psngScale
b = ScaleY(CSng(mrstCustom![fldHeight]), vbInches, vbTwips) * psngScale
c = ScaleY(CSng(mrstCustom![fldRight]), vbInches, vbTwips) * psngScale
d = ScaleX(CSng(mrstCustom![fldTop]), vbInches, vbTwips) * psngScale
e = ScaleY(CSng(mrstCustom![fldS1]), vbInches, vbTwips) * psngScale

Scale
What does this mean?

picture1.Scale (0, 0)-(1, 1)

Scale X Y
well i spoke to the head of computing here at uni and he suggested to see if the process is still running and if so kill it (did that still doesnt work but dont see the need in killing it if it works fine at home)

and also to re size the window co ordinates to default when the form is loaded initially

problem is - yeh that windowstate problem where the window will not go back to normal (vbnormal) but sticks in the taskbar no matter what u try and do

i done:


Code:
frmMain.ScaleX (6480)
frmMain.ScaleY (4095)
frmMain.WindowState = vbNormal
frmMain.Show
frmMain.SetFocus


but no avail - still the same result (doesnt matter if we take out .show or .setfocus)

what now?!

Scale
Hi All,

With my form I have a picture and command buttons.... i want this to expand or shrink depending on the size of screen the user has!!

How do i set this up??

Thanks for all your help

Re-scale
If a user maximizes a form..its ugly...because it doesnt re-scale.

Anyone know how to re-scale a form and all the controls? Or at least make it look half way decent?

Jon

I Need To Scale A Value
Hello~!

I need to convert a value from Twips to Pixels.
Can I do that without using ScaleX and ScaleY
Because im going to be doing this from a module!

Thanks!

Need Help With Scale
Hi all,

I have 2 forms in VB6.0 prj, and both forms have a picture box control. The width in one picture box is 350, and the other picture box control has 1810 in width. However, the picturebox control that has 350 in width is wider than the picture box that has 1810 in width. Both Control has the same ScaleMode. So, I must miss something here. Any idea?

Thanks
Egghead

How To Scale An EMF
I'm having big problems with EMFs: I can't get them to work.

I am coding a waveform viewer using EMFs. What I want to do is, having a waveform with X samples, set up an EMF measuring X horizontally and 65536 vertically (I want to draw 16 bits samples). For example, if my WAV has 8000 samples I want an EMF measuring 8000x65536 units which I can stretch to my picturebox using PlayEnhMetafile API.

The problem is that I don't have a clue on how to do this.

I've read several threads in this forum, and some tutorials. Every sollution is differnent and I can't get the logic. I've followed the different methods explained in each source I've read and I still haven't got what I need.

In the attachment I've included what I have done so far.

Thanks in advance.

Scale Document ?
Hy !
I start using scanned documents for the first time and have a problem of size.
I scanned a document A4 (standard sheet) and want to show it in an image control. As it would be bigger then the control i added a scrollbar. When i show it in the control, my document is bigger than normally !!!???
Well i don't know much about appearance, it must be a pb like that but don't know where to search (change dpi/pixel/inch/...) ?
Any help would be pleasant, thanks.

PS: I use an image control, would it be better to use something else ? Does the error could come from that ?

Copyright © 2005-08 www.BigResource.com, All rights reserved