Hii I am desigining one VB project like dis..
VB application to change the font of the textbox... use the controls list box for the fontname, check box for Effects , combo box for sixe, combo box for color, and option button for font style....
I have written the code for loding font names and font sizes in a list box... but i am unable to get rest of the things.. please help me regarding this.... thank you.... - Private Sub Form_Load()
-
For i = 0 To Screen.FontCount - 1
-
List1.AddItem Screen.Fonts(i)
-
Next i
-
End Sub
-
Private Sub List1_Click()
-
LoadFontSizes
-
End Sub
-
-
Private Sub LoadFontSizes()
-
Dim SaveName As String
-
Dim SaveSize As Single
-
Dim Sizes As Variant
-
Dim i As Long
-
'place holders for font name and font size
-
SaveName = cboFontSize.Font.Name
-
SaveSize = cboFontSize.Font.Size
-
Sizes = Array(6, 7, 8, 9, 10, 11, 12, 14, 16, 18, 20, 22, 24, 26, 28, 36, 48, 72)
-
cboFontSize.Clear
-
'this is the font the user has selected
-
cboFontSize.FontName = List1.Text
-
'whip through the array checking all possible font sizes
-
For i = LBound(Sizes) To UBound(Sizes)
-
cboFontSize.FontSize = CLng(Sizes(i))
-
'font supports this size, add to combo
-
If cboFontSize.FontSize = CLng(Sizes(i)) Then
-
cboFontSize.AddItem Sizes(i)
-
End If
-
Next
-
cboFontSize.FontName = SaveName
-
cboFontSize.FontSize = SaveSize
-
End Sub
5 3172
Why reinvent the wheel? Use the common dialog control and the showfont and the showcolor methods to accomplish what you want. Fewer lines of code, common interface, and in moments, you are done....
Good Luck
hii thanks for ur reply...... that is true about using common dialog controls... but my requirement is to create our own font dialog boxes using the above controls... please help me regarding this.... thank you,,,,,,,,,,,,
Explain your project properly, not the code. Your code looks a bit harder than common dialog tools for the endusers.
(You can create yourown controls(.ocx) for your project using get and set property).
Hii I am desigining one VB project like dis..
VB application to change the font of the textbox... use the controls list box for the fontname, check box for Effects , combo box for sixe, combo box for color, and option button for font style....
thank you
If your project endusers interface are highly based on design then you can create own controls as i sugges else, you can use common dialog controls.
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Mark B |
last post by:
It seems the Access 97 FontName property supports multiple font names, e.g.
"Franklin Gothic Medium, Tahoma".
I assume that means that if the first font is not available on the target
PC, the...
|
by: Megan |
last post by:
Hi-
I'm creating a database of music bands with their cds and songs.
I'm trying to program an SQL statement so that I can enter a string of
text in a textbox, press the 'Enter' key, and have...
|
by: Paul T. Rong |
last post by:
I have a listbox (of product names) control on my form. I want to pass the
selected item (a product name) to a subform, and the product unitprice
should apear automatically next to the product name...
|
by: David J |
last post by:
Hi,
I am strugling with the propertygrid and a listbox. I am using the
universaldropdowneditor from the codeproject (code below). However I am
populating the listbox via a datasource. The problem...
|
by: Ali Chambers |
last post by:
Hi,
I have created a listbox called "dtlist1" on my VB.NET form. I call a
procedure as follows:
Private Sub openfile(flname As String)
dtlist1.Items.Clear()
etc..
|
by: Kevin Walzer |
last post by:
I'm trying to set the active item in a Tkinter listbox to my
application's currently-defined default font.
Here's how I get the fonts loaded into the listbox:
...
|
by: rdade22 |
last post by:
I have a combo box (cboStore) and a listbox (Qlist) both are unbound to a form call frmFAQ. What I want is to be a able to select a Subject from the combo box and have the results show up in the...
|
by: deejayquai |
last post by:
Hello
Simple one this I guess, but I'm quite stuck at the moment.
I would like to update the records displayed in my listbox
(lstStudents) using criteria selected from my combo (cboForm) in a...
|
by: exipnakias |
last post by:
Hello Guys. In a form I created a listbox which looks up the values of a table.
I want:
1)
..to create a query where a parameter will be needed in order to be loaded.
But I do not want to...
|
by: weirdguy |
last post by:
Hello,
Just for anyone information, there is a similar title "Search in Listbox" but it is via Combo Box. In case, anyone need it, I put a link to here.
Please let me know if I break any rules...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
| | |