hi...
how do I successfully resize a richtextbox within the main form, my code as
follows...
Private Sub frmMainForm_Resize(ByVal sender As Object, ByVal e As
System.EventArgs) Handles MyBase.Resize
rtfTextArea.Height = frmMainForm.ActiveForm.Height - 10
rtfTextArea.Width = frmMainForm.ActiveForm.Width - 100
End Sub
as expected I get a 'System.NullReferenceException' error, how do I fix this
Thanks,
Gary
p.s. it so much easier in VB6? 5 2415
strange it seems to work for me, i did use me.width, me.height maybe thats
the catch?
"Gary" <sp**@spam.com> wrote in message
news:%2***************@TK2MSFTNGP11.phx.gbl... hi...
how do I successfully resize a richtextbox within the main form, my code
as follows...
Private Sub frmMainForm_Resize(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Resize
rtfTextArea.Height = frmMainForm.ActiveForm.Height - 10
rtfTextArea.Width = frmMainForm.ActiveForm.Width - 100
End Sub
as expected I get a 'System.NullReferenceException' error, how do I fix
this Thanks,
Gary
p.s. it so much easier in VB6?
Hi Gary,
Did you look to the dock properties, that makes all so much easier than in
VB6
(Maybe you have to use some extra pannels, but when i see that you use
almost the whole form I think not)
I hope this helps a little bit?
Cor
rtfTextArea.Height = Me.Height - 80
rtfTextArea.Width = Me.Width - 20
this worked
thanks guys...
Gary
"Gary" <sp**@spam.com> wrote in message
news:%2***************@TK2MSFTNGP11.phx.gbl... hi...
how do I successfully resize a richtextbox within the main form, my code
as follows...
Private Sub frmMainForm_Resize(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Resize
rtfTextArea.Height = frmMainForm.ActiveForm.Height - 10
rtfTextArea.Width = frmMainForm.ActiveForm.Width - 100
End Sub
as expected I get a 'System.NullReferenceException' error, how do I fix
this Thanks,
Gary
p.s. it so much easier in VB6?
* "Gary" <sp**@spam.com> scripsit: rtfTextArea.Height = Me.Height - 80
rtfTextArea.Width = Me.Width - 20
This will cause incorrect display results if borders and taskbars of the
form have an other size. You may want to use the value of the
'ClientSize' property.
--
Herfried K. Wagner
MVP · VB Classic, VB.NET
<http://www.mvps.org/dotnet>
* "Gary" <sp**@spam.com> scripsit: how do I successfully resize a richtextbox within the main form, my code as follows...
Private Sub frmMainForm_Resize(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Resize
rtfTextArea.Height = frmMainForm.ActiveForm.Height - 10
rtfTextArea.Width = frmMainForm.ActiveForm.Width - 100
The exception will be thrown if, for example, there is no 'ActiveForm'
because no forms are displayed. You can check this with code like that:
\\\
If Not Me.ActiveForm Is Nothing Then
...
End If
///
--
Herfried K. Wagner
MVP · VB Classic, VB.NET
<http://www.mvps.org/dotnet> This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: vanvee |
last post by:
Hi
I have a user control that contains a RichTextBox in vb.net. In my
program, I create multiple instances of this control (with the
RichTextBox being in each one), that appear one above the...
|
by: Thomas Richter |
last post by:
Hi,
I can't get of the black flicker when I resize my form.
this = Mainform : System.Windows.Forms.Form
If I set the size from 300 to 500 I see for ca 500ms some
black areas. I try to solve it...
|
by: TheBinar |
last post by:
Hi
I have a user control that contains a RichTextBox in vb.net. In my
program, I create multiple instances of this control (with the
RichTextBox being in each one), that appear one above the...
|
by: M O J O |
last post by:
Hi,
If I inside a thread creates a RichTextBox and only use this inside the
thread, will there be any thread problems?
I need to convert between Text and RTF inside a thread.
Thanks!!
M...
|
by: Jacek Jurkowski |
last post by:
.... make COM exposed object to have
both constructors COM visible not only
the first one?
|
by: Vimalathithan |
last post by:
I just developing a editor. I have provide the options like Bold, Italic, underlin, font change, font size change. These font options are keep in with one toolstripbutton. the toolstripbar keep...
|
by: dli07 |
last post by:
Hello,
I'm trying to convert a piece of code that creates a dynamic vertical resizing bar in a table from internet explorer to firefox. It's based on a post from...
|
by: TAB |
last post by:
"none" <none@none.comskrev i meddelandet
news:eaJIxCA7IHA.2260@TK2MSFTNGP03.phx.gbl...
Use richtextbox selection properties. Like richTextBox.SelectedText or
SelectedRtf if you would like to...
|
by: Linda Liu[MSFT] |
last post by:
Hi CES,
Thank you for posting here!
I notice that you post a same issue in the
microsoft.public.dotnet.framework.windowsforms.controls newsgroup and I
have replied to that thread. For your...
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
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: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
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: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
| |