o
k
q
u
e
s
t
i
o
n
s
.
c
o
m

Font property not fully working -

Hi

I have added a Font property to my active x control so developers can change the font using vb's properties window

To do this I have the following code..

VB Code:
  1. Public Property Set Font(ByVal oFont As StdFont)
  2.     Debug.Print "1.Write Font Size: " & m_oFont.Size
  3.     With m_oFont
  4.         .Bold = oFont.Bold
  5.         .Charset = oFont.Charset
  6.         .Italic = oFont.Italic
  7.         .Name = oFont.Name
  8.         .Size = oFont.Size
  9.         .Strikethrough = oFont.Strikethrough
  10.         .Underline = oFont.Underline
  11.         .Weight = oFont.Weight
  12.     End With
  13.    
  14.     PropertyChanged "Font"
  15.    
  16.     Debug.Print "2.Write Font Size: " & m_oFont.Size
  17. End Property
  18. Public Property Get Font() As StdFont
  19.     Set Font = m_oFont
  20. End Property

And here is my Property bag methods

VB Code:
  1. Private Sub UserControl_WriteProperties(PropBag As PropertyBag)
  2.     PropBag.WriteProperty "Font", m_oFont
  3. End Sub
  4.  
  5. Private Sub UserControl_ReadProperties(PropBag As PropertyBag)
  6.     Debug.Print "1.Read Font Size: " & m_oFont.Size
  7.     m_oFont = PropBag.ReadProperty("Font")
  8.     Debug.Print "2.Read Font Size: " & m_oFont.Size
  9. End Sub

now If i pop my control on my form and set a new font with the font dialog then click ok to confirm that font, the font is set to what i need.

But when i click run, all the font property values are reset except Font.Name

I dont understand why only the Font Name works, all the other attributes like bold, size, type etc reset to there default values.

Does anyone know why this is doing this to me?


Thanks

 

Getting object property by dragover -
Hi, How to get the property from an object by getting over it regardsCharles


Contained Controls -
I am trying to edit the property of a control that is in my UserControl. There are going to be a couple different controls so, I need one Function or Procedure that will take care of this problem. Is it possible to use a variable name in place of a property Example: Publi


Custom Control Font Property -
Can anyone tell me how to set the font property of a label control from a propertry on a usercontrol. so that public Property get Font() as stdFont font = label1.font end ptoperty public property set Font(obj as stdFont) label1.font = stdfont end property works


[2005] Serialization -
When working with user control properties, I'm finding that I lose any property value set in the IDE property window upon running. I seem to remember that they need to be serialized in order to persist from design time to run time? Also, if I need to "filter" out unsupported


Fully load IE -
Working in VB. I need to make it wait until the page called in IE loads before going to the next command. I have just been using a pause but page keeps loading at different times and program keeps messing up. Anyone know a code to make it wait for IE to fully load before conti


Let Fully Load -
Working in VB. I need to make it wait until the page called in IE loads before going to the next command. I have just been using a pause but page keeps loading at different times and program keeps messing up. Anyone know a code to make it wait for IE to fully load before contin


Validate Date Property on User Control -
One of the LET properties on my user control is of type DATE. When a user inserts an invalid date to that property they get an invalid property value error. I have tried to trap for this error but it is occurring before control is passed to the LET property. Right now, I am thinking


[2005] AutoSize Property from Control doesn't show up in Property Grid -
I have created a new control inherited from Control. I want to add a Property called 'AutoSize'. When I try and add it, I get the warning: property 'AutoSize' shadows an overridable method in the base class 'Control'. To override the base method, this method must be declared 'Overri


font property questions -
I have some questions about when I set the font property:how dows this carry across when the app is pacakged for setup? Does setup package the font(s) with the app? Does it just assume that the end-user will have the font? Does setting the font override the user's windows settings? I


Make a Font Property -
Hi everyone. I have maken an ocx control that has a font property. How i do to display the fonts dialog when i click the font property of my control ? Because if i declared a property like As OLE_COLOR, (by example) Public Property Get BackColor() As OLE_COLOR BackColor =


Making Font Property -
Hi everyone. I have maken an ocx control that has a font property. How i do to display the fonts dialog when i click the font property of my control ? Because if i declared a property like As OLE_COLOR, (by example) Public Property Get BackColor() As OLE_COLOR BackColor =


Performance VB6 vs VB.NET -
I've been working with VB6 for quite a while now but it's looking likely that I'll have to start working with VB.NET soon. How does VB.NET executable compare with VB.NET executable in terms of performance? The project I've been working on for the past year uses the VB OpenGL API


Font problem -
I have a compliled ocx which is an arabic text box but it has no font property and it uses the system default font as the font,It also has a fontsize property. how can i change it's font.


N££d An 0pini0n H£r£!!! -
OK, HONESTLY HERE, I WANT THE TRUTH, WHO HERE THINKS THAT I AM CRAZY FOR EMBARKING ON THE WONDERFUL 'VB' TOUR OF WRITING A FULLY FUNCTIONAL M.U.D. SERVER (Multi User Dungeon)???


Getting a Picture from a Byte Array -
I am still working on the grid OCX but there is a problem which blocks my way. Could you please help me to solve it? The main thing is that I have an array of Bytes (which I will find a way to express in a formula to get them) and I am trying to get these Bytes into a StdPicture


[2005] DGV RowTemplate.ReadOnly property and unbound cells -
I'm not sure if I'm understanding the role that the DGV RowTemplate.ReadOnly property serves. I have a DGV with several unbound checkbox cells and an unbound textbox cell. The DGV is also bound to a BindingSource, but all those cells are hidden. The ReadOnly property of the unboun


Putting an Image 'Property' in ActiveX Control -
Hi! I want to insert an image property to a custom ActiveX control that I'm building. I tried the folowing code, Public Property Let Picture(s As Image) varPicture = s UserControl.Picture = varPicture.Picture PropertyChanged ("Picture") End Proper


Assigning Default Property Values to a Class Property -
HI Everyone, I wish to assign a default property value to my class property. Could anyone tell me how do I do that? Regards, Abhijit


ActiveX BackColor/ForeColor Properties -
Hello all, Im just starting ActiveX Programming and i was wondering how to make a BackColor and ForeColor Property for the "Label" Type Control. Ive Got Font fine, but BackColor isnt working. Ive tried; Public Property Get BackColor() As OLE_COLOR Set BackColor = U


[2008] Run application... -
Hey, I am trying to make another application run inside my form, i have been trying to do this using an MDI form, i am having problems getting the code to work in the newer versions of .NET, i have fully working code in VB6 that will allow me to do this but i need it in .NET 08


[2005] Custom Property Default Value for fonts -
How would I set a Font Properties DefaultValue. I am currently using: Dim f as Font = New Font("Tahoma", 8.25!) then in the property: <DefaultValue(GetType(Font), "f")> But the property defaults to "Franklin Gothic Medium" when I right


activex doubts. -
How to create properties page using the menu item Add - property page. One more Question! I have problem in adding the font property to my user control. The font does not change when i change the font property (created by me) in the user control I hev a textbox text1 in my user cont


how to know the web page is fully loaded -
I'm using a AxWebBrowser in VB .NET to load some web pages. After each page is fully loaded, I want to do some computation, such as: how many words in the page, how many pictures in the page, etc.. Usually, we can use AxWebBrowser_NavigateComplete2 to detect the current page is loa


why need .frx files -
I'm working on a project and something really weird is happening. Whenever I make the font of a label bold, and then take the project or the form to another machine, the label doesn't appear bold any more. when I open the font dialog box I find bold is selected and whenever I choose b


Subproperties -
I managed to create subproperties for a custom control, but I am running into one problem. The parent property is displaying the control.classname value instead of being blank (like the Font property). Below is the image. You'll notice next (to the right) of the Font property it


A simple Panel question... -
Why does a Panel control have a Font property? What does it affect? Any controls added to the panel will have their own Font property that controls their appearance, so I don't see the point of the panel control having a Font property, especially since it has no text property.


Can someone explain COM Instancing for me -
I am having a little problem fully understanding the instancing property of ActiveX COM components. The instancing property has these to choose from: 1-Private 2-PublicNotCreatable 3-SingleUse 4-GlobalSingleUse 5-MultiUse 6-GlobalMultiUse I have read a bunch of technical jarg


Confused with Error 48 Help !!! -
I am new to VB, coming from VFP. I am working on a project using VB6 together with Visual Studio 6 (SP3). I have two projects given to me to do some transalations on the screens. On two computers I can fully compile and run, but on another one, the project run within VB6 environmen


Is window fully painted -
How can I tell if a window is fully painted? I'm taking some screen shots of different windows, which works fine except that I have to bring the window to the front before I can capture the image and sometimes it captures only a partial image because I'm BitBlting it before the window


What property to use to see if a file is protected or not -
I have a good number of Audio and video files. Some of these are protected (DRM). I used the following code .......... Set fs = CreateObject("Scripting.FileSystemObject") Set f = fs.GetFile(filespec) s = f. (NEED Property HERE) The problem is tha


[02/03] Make program stop working -
Hi people, I've been away for some time but you guessed it I'm back lol. Just a simple question really, is it possible to put some coding in to my program which will make it stop working in the future for example I want the program to function fully but to stop working on the 29th o


SQLDMO Column - Default property -
I'm creating a routine where I am adding new columns to a target table based on the columns on a source database table. Every property in the Column object is working, except the Default property, which is always NULL on the source column. Snippet: With objTargetColumn


Limit text in a text box... -
Hey all, I have a friend who is trying to design a template in word for a form. They want to be able to only type a certain number of characters in a text box. This is not possible with a normal text box, so i showed them how to put a VBA text box in and set the MaxLength property.


Fully Justify -
I am trying to get the code that will fully justify text within a RTF. Does anyone have any ideas? I also need to know if i need my own icons for toolbar items. Thanx in advance


Need to add a Please Wait window -
I am trying to pop up a window to tell the users to "Please Wait" so they do not start clikcing buttons until the program is fully loaded. the problem I am having is that the window starts to come up but you can only see the outline of the window and not the actual text I ha


Property not saved -
Hello everybody, I have created a textbox which exposes a property called Value which has options that are Alphabetic, Numeric, AlphaNumeric etc. Textbox is working fine, but when I use this textbox in my application and set the property to some value, this value doesn't save and n


[02/03] Setting working area -
Hello everybody, I've been searching for this, but can't find a solution, except on expert-exchange.com [here]. Sadly this is a website where you have to pay for your answer and I'm not willing to do that. Now, onto explaining my problem: I'm creating a toolbar for Windows, whic


Auto Web - Download pages -
The new version is in a new post down below. Just Keeping the Thread alive once more. Okay guys i am creating an app that schdules downloads for pages. The app is not fully running and you might get some errors. I still do not know all of them, but i am working on it. I just want you


Help with working with events in .net 1.1 -
I have a business entity class accountEntity. I want to put an event in that class. Whenever a property within the class changes I want the event to be raized and as result call a method myMethod. So I declare my events like this: Class AccountEntity() Public Eve


Please help me: how to add help to my dll -
As a newbie here, thanks for any kind of help. (I did search before ask, but got very confused). I am working on a dll file to ArcMap, I need to have help file (I would like chm) for this dll, also there are several places on the interfaces to invoke this help file, could any one t