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




Textbox Size Change In VB6


Hon'ble gurus,
Please suggest me how to increase the width of the textbox by the size of a character when you go on writing and decrease it by the same size when you delete a character.I am using VB6.
pkb_pkb


pkb_pkb




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Change TextBox Size According To Text
I need to create a textbox that is 76 characters wide and 46 rows. How can I do this beyond eyballing it. This is because what they type in a text box has to appear the exact same on a report. What I need is once they have typed in 76 characters it needs to go to the second line where they can type in another 76 characters an so on. If the word is too large to fit on the line they are typing it on it need to go to the next. Very much like word. I was just wondering if there is some kind of formula that would help me convert the size of 76 characters and make the textbox that size.

TextBox Array, Change Size
I have an array of TextBox. How do I at design time change the size of all of them. They all have the same size but I want them to be bigger.

Change The Field Or Textbox Size In Crystal Report Programatically Using VB6
Hi every body

I hope some one can help me to solve this problem

I need to make a changeable data report using vb6 with crystal report 8.5

each time the report will be printed with different fields wich the user will choose

what I need to know Is how to change the field size in the report programatically in vb6 to be the same as the field size in the database

thanks for your time

Ashraf



Edited by - ams_ashraf on 12/23/2007 11:32:36 PM

PictureBox Size Change With Form Size [Solved]
I have a toolbar and a statusbar on my form, i want the size of the picturebox to follow the size of the form. So this is my code

Code:
Private Sub Form_Resize()


If Me.WindowState <> 1 Then 'not minimized
    On Error Resume Next
    
    
    Picture1.Top = Toolbar1.Top + Toolbar1.Height
    
    Picture1.Left = 0
    
    Picture1.Width = StatusBar1.Width
    
    Picture1.Height = StatusBar1.Top - (Toolbar1.Top + Toolbar1.Height)
    
        
End If

End Sub



This works perfect if the window state is 0 (normal) if it is maximized the size of the picturebox is the same as it was before i maximized.

Below is the testcode



Edited by - anders@dac.se on 6/16/2004 6:37:13 AM

Form Size Change With Screen Size
Hi

I Want Change My Form Size On Different Resolution ( 800*600, 1024 *768 )
Please Help

Popupmenu Background Color Change As Well As Font Size Change
hi folks
am creating one popupmenu using createpopupmenu() API
and also i insert items dynamically using insertmenuitem API
and display using Trackpopupmenu().
My problem is

1)i want to change the background color of popup menu?????
2 i want to change the font size in popup menu ???????
dynamically .
if any body know API or how to change the font size and change the background color in popupmenu ,please help ur friend.

Important:
I don't need menu editor.
i need only popup menu.
expecting a positve reply.
-------------------------------------------------
"HARD WORK NEVER END FAILS"
-------------------------------------------------

Textbox Size/font Size
Does anyone know how to resize a textbox (at runtime), so that if you change the font size for it, it'll adjust to fit the font?

Change Textbox.Text Without Firing Change Event?
This is probably going to be one of those threads that just shoots down the list but I was wondering if there is a way to change the contents of a textbox through code that won't fire its change event. I don't think it is possible but I have seen some pretty cool stuff on the forum and thought I'd give it a shot. Thanks.

DB Size Does Not Change ??
hi all,

i was working on a code to upload my outlook mails to an access database. i managed that ... and i realised my access DB size swelled. So i went to the tables and deleted all the records manually. and now all my tables are empty. But my DB size does not change .... its still some 300MB.

can any one tell me whats happening here ??

to over come it i can just delete the DB and recreate a new one with the same structure, but i am curious to know.

thanks once again all you guys

-Vinod



Edited by - cjvinod on 1/24/2005 4:36:57 AM

Change Listbox Contains Upon Change Of Textbox
Greetings,

I'm facing a problem here..
I want to change my listbox contains upon the change in my text box.

Its like when we use Jump function in Winamp.

heres my code:


VB Code:
Dim conn As New ADODB.ConnectionSet conn = GetConnection(0)Dim rs As New ADODB.RecordsetSet rs = New ADODB.Recordset 'rs.Open "SELECT PART_CODE FROM AGENT_PROD_REJECT where PART CODE = '" & txtPartCode.Text & "'", conn, adOpenKeyset, adLockOptimistic Dim xlstPartCode.ClearFor x = 0 To rs.RecordCount - 1If IsNull(rs!PART_CODE) Then    lstPartCode.Text = "No Record Yet"ElseIf Not IsNull(rs!PART_CODE) Then    lstPartCode.AddItem rs!PART_CODE     'MsgBox "Ada " & rs.RecordCount & " rekod"End Ifrs.MoveNextNext x rs.CloseSet rs = Nothing


but i have error "Syntax error in query expression"

Is anyone know??
Please..i had headache enough thinking the solutions.

How To Change The Title Bar Size
I want to remove the default icon from the left corner of the title bar of the vb form. By modifying the BorderStyle property the icon is removed but the title bar height also reduces.

How to change the title bar size to normal size or to remove the icon without affecting the size.

USMAN

Change The Size Of Tabs
How do you change the tab sizes in a richtextbox??

Change Paper Size
what is the cording to change paper size and set as landscape .. what is the right cording i m trying like this

printer.papersize = 9
printer.oriantation = 2

its not working
y is that ??

what should i do

How To Change Pixel Size ?
Can we change the pixel size ? If yes how can we do it through VB ?

How To Change A Varchar Size ??
I need to change the size of two fields in my table. The existing sizes are not big enought. I tried using this code but it generates an error:

ALTER TABLE table1 {
ALTER COLUMN Field1 varchar(55),
ALTER COLUMN Field2 varchar(20);
}

And by increasing the size of the fields affect the existing data?

Change Field Size With DAO 3.5
Is it possible to change the size of a textfield, using DAO 3.5?

using the following alter table statement only seems to work with DAO 3.6.

Code:
ALTER TABLE Authors ALTER COLUMN Author varchar(57);
Malloc

Change Font Size In RTB, But Not All Of It!
I have the code below to change the size of the selected font in a RichTextBox.

If the user selects a different size font part way through using the RTB, how do I get the text from that point on to be the newly selected size?
I have a combobox with the sizes available for the font.


Code:
Private Sub cmbFontSize_Click()
On Error GoTo ErrTrap

If Len(rtbNotes.SelText) > 0 Then
rtbNotes.SelFontSize = cmbFontSize.List(cmbFontSize.ListIndex)
rtbNotes.SetFocus
Else
''rtbNotes.SelFontSize = cmbFontSize.List(cmbFontSize.ListIndex)
End If

Exit Sub

[VBA] Change Size Of Label
Hello,
I have an Access report. At the "onFormat" event I want to change the "height" of an element.
There is a line around this element (a box), so I check for the change of size.
So I tried:
Me.myElement.Height = 5
And this does work. I get a line (i don't even see the data).
But when I actually try to make the height very large for example 50, the maximum the box will grow on is whather space the text take.

How can I fix that ? Is there something I am doing wrong ?

The reason why I am trying to do this:
I have different info in my report
For example:
Info 1, Info 2, Info 3... and so on
When I generate my report each one of them is surrouned by a box (ie, border = solid).

Info 3 is a bit like a memo.
My problem right now is that the box around info 1 is not equal to the box around info 2 or info 3... I want to have all the boxes size to be equal to the largest.
So that's why I have to know how to set the height programatically so that when the report is generated it sets the heigh of the boxes to the height of the "tallest" box.
But if you have a way around let me know please !

thanks !


>>>>> UPDATE :
I fixed part of my problem.
I disabled the "Can grow" and "Can Shrink"
My issue now is for EACH detail i want to find the tallest size ( i know how to do that), but I don't know how in the "OnFormat" event do it for EACH detail in the report... right now it does it for everything... all the details box are the same....
please help,
thanks

>>>>> MORE UPDATE :

I did figure out to force the size of the fields. (the cangrow and canshrink have to be set to false)
My problem is that I want all the fiels to be the same size as the field with the tallest size.
The fields (Memo, and Description) are the tallest one no matter what.
So I want to do a check to see which one of the two is the tallest and then set the size of everything else equal to the tallest.

So right now I have in the OnFormat event:


If Me.Memo.Height > Me.Description.Height Then
Me.Field1.Height = Me.Memo.Height
Me.Field2.Height = Me.Memo.Height
Me.Field3.Height = Me.Memo.Height
Me.Field4.Height = Me.Memo.Height
Me.Field5.Height = Me.Memo.Height
Me.Field6.Height = Me.Memo.Height

Else
Me.Field1.Height = Me.Description.Height
Me.Field2.Height = Me.Description.Height
Me.Field3.Height = Me.Description.Height
Me.Field4.Height = Me.Description.Height
Me.Field5.Height = Me.Description.Height
Me.Field6.Height = Me.Description.Height

End If


PROBLEMS:
Right now this does not work.
BUT if I give a number instead of "Me.Descriptionm.Height" or Me.Memo.Height
Everything works properly.
I think it's because I have to write the code in a way so that it's applied to each "detail" iteration. I am not sure how.


The other problem is that the Memo and Description field are both set to "Cangrow" yes.
So that I know big they get.
Let's say Memo is bigger than description. I will want to set Description at the same size as Memo.
But I can't, because "Cangrow" is set as yes. And it does not look like I can change this setting from VBA...

Please help, it's a bit hard to understand, but I have been stuck for a long time on this one.

I am doing all of this to have all the solid lines around the fields sized the same. Because if I enable the cangrow option, i will a nice box around each field, but each one of them is different size... so it's looks a bit weird for a "table" type report.

Thanks for your help

Picture Change Able Size
i currently have a small doodle program but i want to be able to change the canvas size, like in MSpaint you can drag it to change size, how would i code this?

How Can I Change The Image Size
I drawed lots of regions and line inside of a picturebox using API. (around 150 regions filled by different kind of brush)

I wonder how can I change their size when i resize the picturebox. I try cls and draw again, the effect is not smooth as all the data are read from database.

Any good method?

Thanks

Change Another Window's Size
Can I change another window's width and height from my VB application If I know the caption on that window?
Thanks

Change Paper Size
How to get the Data Report height after loading the Report?
How to change the user difined Printing paper size in VB?

Why Can't I Change The Word Size ?
I set font.size = 24. But the word printed out is still very small.

How Can I Change The Paper Size???
Hi to all

I'm using VB6 and i make a report with the datareport (default of vb).

I 'm searching the Web to find how i can change the paper size of the printer that user select but nothing.

I have a report tha prints Folio - Letter but it hasn't the same margins with the vbprpsFOLIO.

When the user select a printer from print button ( In Microsoft DataReport) i want to change the paper size of that printer.



**Sorry for my bad English**

Thnks

Change Size*RESOLVED-THANKS*
Ok sometimes in vb I want to make my list box a certain size and vb will automaticlly resize it to a different size but I want it a certain size and not vb changing it to a different size so could someone please tell me how I can have it so it will stay how ever I want it? I dont have autosize on... Thanks guys I appreciate the help

How Can I Change My Form Size To A4?
hello im printing the hacky way form.print, mua ha ha

how big is a page in the numbers form size is set in, i.e, i have a form.height = X and form.width = Y, what are X and Y for an A4 form?

cheers ears

Change Window Size
hi all,

hoe can i supress that the user can change the size of my form

thx
kreuzfeld

Change Page Size?
How do I change the page size of a data report? I need 8.5"x14", but I can't figure out how to make it this size.

Thanks,
Greg

Change Paper Size Through VB
Hi all,

can anyone let me how to change the paper size through VB code dynamically as per requirement, ie some of my data reports are using letter size papaer some using legal and some A4, I have tried printer.paperSize but it is not working ,

Thanks in advance

bye

Change Font Size
Is it possible to change the font or font size of the VB IDE?

I.e. I want to lower the font size of the code editor so I can see more code on my screen at once. Hopefully, without changing my screen resolution.

TIA.

Tristan Wolf

Confucious say, "Man who fight salmon should use right hook."

Change Field Size
Hello,

I have a table where a field's size is set to '9'. I need to expand it to '15', by code.

I'm using VB 6 SP5, ADO, Access 97.

Thanks


------------------------------
Fabio Centenaro
frcentenaro@yahoo.com

How To Change An Image Size?
Hi again...
I would like to know if there is a way to load a picture on a pictureBox and to make this picture the appropiate size as to fit on the pictureBox control dimensions...

Hope someone can help...

File Size Change
Is there a way to have a program detect when there is a change in the file size of a txt?

Change Size Of An Apps
I us the shell command in VB to run an application, but I want to control the size of the application in my code. E.g I run notepad, but the size is to big, of course I can change the size in notepad. But I want to control this from VB by e.g a button.

Change Focus From Textbox To Textbox
Hello Evryone:

I would like to know how to change the focus between textboxs using the "ENTER" key instead of using the tab key. Right now the tab key is moving between the boxes but not the enter key?

Any Ideas?

Thanks
Art W

Change Screen Size DX During Run-time
Ive seen this done before, er... somewhere.

Does anyone know how to Make DirectX (7, i think), switch between fullscreen and windowed mode as many times as a user wants during run-time?

Drag, Drop And Change The Size
i already know how to drag and drop any object in vb 6 program using DragDrop funtion but it seems quite difficult.

does vb 6 has functions to drag and drop any object in its form other than DragDrop function? and if can, is there any way to move it in grid(like we move it before run the program)? and also to change the size by click and drag the side/corner of the object??

How To Change Font And Size On Runtime
Hello, im making an application that needs the ability to be resized according to the user's screen (640x480, 1042x768, etc) or whenever the user wants to. What is the best way to implement it? Different forms? Anyone has done something to accomodate a form when the fonts are changed? Thanks..

Change Font Size In A RichTextBox
Is there a simple command to change the font size of all the text in a RichTextBox. The only method that I have found so far is

RichTextBox1.SelStart = 0
RichTextBox1.SelLength = Len(RichTextBox1)
RichTextBox1.SelFontSize = 14
RichTextBox1.SelStart = 0

It works but highlights all the text first, then changes the font size and finally restores the cursor to the start of the text.

RichTextBox1.Font.Size = 14 only changes the first bit of text.

Change Picture Size At Runtime
i have tried to change my form.picture size at runtime to no avail. i have used even the loadpicture function without success. the picture does load, but no change in size happens. any suggestion?
thanks,
jomamameister
jomamameister@yahoo.com

Change Size Of A Displayed Help Window
Is it possible to change the default (not maximized) windows size of a displayed Help context within VB?
The helpfile is displayed via next code:

With CommonDialog1
.HelpContext = 1000
.HelpCommand = cdlHelpContext
.ShowHelp
End With

Thanks

Change Pset Pixel Size
how can i change the size of a pixel i paint when i use Pset?
+_+

thanks,
Kat (karen)

Change Printer Paper Size
my DataReport paper size is larger than the printer default size

How to change paper size programatically?


Code:
Printer.PaperSize = PrinterObjectConstants.vbPRPSUser 'supported by the priner driver
Printer.Width = #### 'number in twips which is larger than my report width
OR

Code:
Printer.PaperSize = ...A2 'The constant for A2 which is also supported by the printer driver
won't work, it has no effect on the printer at all (for my program or system-wide) and the error still popups.


the printer is EPSON LQ-1050 (wich driver is packed with win98/ME)

I searched the forums for this, I found alot of articles, I read more than 50 one, I got nothing usefull.

and this is the same article I wrote in other forum with about 4 replies and had no answer.
http://www.vbforums.com/showthread.p...51#post1555751

any help please

How To Change Size Width For Listview
I have problem here.. How I can loop the listview to set the width size ?I have 1 untill 5 column. I want to set the same size with for this column.


Code:
Dim i
for ListView1.count - 1
ListView1.ColumnHeaders(i).Width = 3000
next i

Change MSflexgrid Column Size
I use MSflexgrid, I would like to change the cell size, where the properties to change the cell size?I can't find it

Change Text Color And Size
I have set the text size, color and the font time to print it out.The code below doesn't change the text properties.How to set the text properties?



Code:
Printer.Print "Legend": ForeColor = vbBlack: FontSize = 15: FontName = "Times New Roman"

To Change Font Size Of The Titlebar
Hello,

I've changed the Font of the title bar of the form through "systemparametersinfo" parameters. n now i want to change the font size.


But in the case of multilingual fonts the display changes coz the font size is different for different languages.

can u help me to change the font size of the title bar?????
the code to change the font of the title bar as follows :





Private Type LOGFONT
lfHeight As Long
lfWidth As Long
lfEscapement As Long
lfOrientation As Long
lfWeight As Long
lfItalic As Byte
lfUnderline As Byte
lfStrikeOut As Byte
lfCharSet As Byte
lfOutPrecision As Byte
lfClipPrecision As Byte
lfQuality As Byte
lfPitchAndFamily As Byte
lfFaceName(1 To 32) As Byte
End Type


Private Type NONCLIENTMETRICS
cbSize As Long
iBorderWidth As Long
iScrollWidth As Long
iScrollHeight As Long
iCaptionWidth As Long
iCaptionHeight As Long
lfCaptionFont As LOGFONT
iSMCaptionWidth As Long
iSMCaptionHeight As Long
lfSMCaptionFont As LOGFONT
iMenuWidth As Long
iMenuHeight As Long
lfMenuFont As LOGFONT
lfStatusFont As LOGFONT
lfMessageFont As LOGFONT
End Type

Private Declare Function SystemParametersInfo Lib "user32" Alias "SystemParametersInfoA" (ByVal uAction As Long, ByVal uParam As Long, lpvParam As NONCLIENTMETRICS, ByVal fuWinIni As Long) As Long
Private Declare Function CreateFontIndirect Lib "gdi32" Alias "CreateFontIndirectA" (lf As LOGFONT) As Long

Dim ncm As NONCLIENTMETRICS 'NONCLIENTMETRICS to change
Dim Orincm As NONCLIENTMETRICS 'NONCLIENTMETRICS to replace original
Dim Returned As Long
Dim lf As LOGFONT
Dim hFont As Long


Private Sub Combo1_Click()

Dim i As Integer
ncm.cbSize = Len(ncm)

Returned = SystemParametersInfo(41, 0, ncm, 0) 'get the system NONCLIENTMETRICS
Orincm = ncm 'store the value of system NONCLIENTMETRICS to use later
'now to change the font name
'other functions can be used to change t
' he font name
'but for simplicity i have used asc() &
' mid()


For i = 1 To Len(Combo1.Text) 'use ncm.lfMenuFont.lfFacename(i) to change menu font
ncm.lfMessageFont.lfFaceName(i) = Asc(Mid(Combo1.Text, i, 1))
ncm.lfCaptionFont.lfFaceName(i) = Asc(Mid(Combo1.Text, i, 1))
Next i
ncm.lfMessageFont.lfFaceName(i) = 0 'add null at the end of font name
ncm.lfCaptionFont.lfFaceName(i) = 0
Returned = SystemParametersInfo(42, 0, ncm, &H1 Or &H2) 'remove &H2 if you don't want to affect all the open windows

lf.lfHeight = 24 ' character height in pixels
lf.lfWidth = 12 ' character width in pixels
lf.lfEscapement = 0 ' orientation of next character
lf.lfOrientation = 0 ' orientation of first character
lf.lfWeight = 400 ' normal thickness
lf.lfItalic = False ' not italic characters
lf.lfUnderline = True ' not underlined characters
lf.lfStrikeOut = False ' not strikeout characters
lf.lfCharSet = 255 ' OEM character set
lf.lfOutPrecision = 0 ' default output precision
lf.lfClipPrecision = 0 ' default clipping precision
lf.lfQuality = 0 ' default scaling quality
lf.lfPitchAndFamily = 64 ' default pitch, script font family

hFont = CreateFontIndirect(lf)
MsgBox hFont
MsgBox "Message & Caption Font Changed to " & Combo1.Text, vbOKOnly, "Amit"
' Returned = SystemParametersInfo(42, 0, Orincm, &H1 Or &H2) 'replace original font
' MsgBox "Message & Caption Font Replaced to " & StrConv(Orincm.lfCaptionFont.lfFaceName, vbUnicode), vbOKOnly, "Amit"


'
End Sub



Private Sub Form_Load()

' Heres a very simple code to change the
' system
' NONCLIENTMETRICS like the the window t
' itle font,
' the message font,menu font using VB. Y
' ou can also change
' other elements like status font etc
' in your window only or all the open wi
' ndows
' like PLUS! or display settings (appear
' ance)
' also it is possible to underline, stri
' kethru fonts in
' your window with this code. This code
' is very useful
' if you are coding a multi-lingual soft
' ware.
' For more info and more free code send
' e-mail.
'
' email - vengs_amit@yahoo.com

Dim i As Integer
Show
' to flood the combo box with first 10 f
' onts


For i = 1 To 200 ' or use For i = 1 To Screen.FontCount to flood all the fonts in your pc
Combo1.AddItem Screen.Fonts(i)
Next i
End Sub

Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
Returned = SystemParametersInfo(42, 0, Orincm, &H1 Or &H2) 'replace original font
MsgBox "Message & Caption Font Replaced to " & StrConv(Orincm.lfCaptionFont.lfFaceName, vbUnicode), vbOKOnly, "Amit"

End Sub

Private Sub mnuExit_Click()
Returned = SystemParametersInfo(42, 0, Orincm, &H1 Or &H2) 'replace original font
MsgBox "Message & Caption Font Replaced to " & StrConv(Orincm.lfCaptionFont.lfFaceName, vbUnicode), vbOKOnly, "Amit"
End

End Sub

Change Size Font In Flexgrid
Hi

How can I to change size font from flexgrid, via Code ?

Please post a example


tks

Help Me To Change The Font Size Of My POS Printer
Hello forum,
I have a TP-100 dotmatix pos printer and I'm curruntly print receipt using printer.print method. But when I try to change the font size using printer.fontsize, there is no effect on the print outs. I want to use different sizes of fonts in my POS printer. Is there any way I can do this without using Printer.FontSize.

I also want to know how to display line of text on a Pole Display. If theres anyone to help me that will be a great help. Thank You!

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