Winform becomes unresponsive
Hi all, basically i have a WMI scanner which i install as a windows
service. using .NET remoting the service registers an object which
records the status of the scanner (ie how many assets its' scanned so
far etc..)
I then have a windows application which reads the status object to
display the progress of the scanner (ie which asset is it scanning and
an overall % complete)
This all works fine when i scan up to 50 assets but i am in the
process of load testing the scanner and am increasing the number of
scans to 100, 150 etc..
the scans do work but the windows application basically locks up for
the majority of the scan.
I have a thread on the scanner service which starts up the scan and
sleeps inbetween scans for x minutes.
the scanner itself uses a threadpool to scan all the assets on the
network and a thread to upload results to a webservice.
I am using a timer on the windows application to check the status
obejct every second and then display the results on the form, this
seems to be the bit that keeps locking up (only when lots of assets
are being scanned tho)
how can i keep my windows application responsive, no matter how many
assets i am trying to scan? Tag: RichTextBox Images Tag: 79125
DataGrid - Background colours?
I want to enumerate the cells in my datagrid and specify different
background colours for each cell depending on its contents. Is this
possible? There are no properties for DataGrid.Item(Index, Index)... Tag: RichTextBox Images Tag: 79121
DataGridBoolColumn with multiple values (override SetColumnAtRow)
I have a table that I have to show in a DataGrid. One of the columns in the
table is column that shows some states. When reading it, the states will be
one of -2, -1, 1 or 2. After the user modifies the column, it will have to
save -2 for false and 2 for true. The problem is that I have to show these
values as a check box, i.e. for each value < 0 to show an unchecked checkbox
and for values > 0 to show a checked checkbox.
I tried to make my own class derived from DataGridBoolColumn and to override
the methods SetColumnValueAtRow and GetColumnValueAt Row. Here is the code:
protected override object GetColumnValueAtRow(CurrencyManager lm, int row)
{
DataView view = (DataView)lm.List;
if(Convert.ToInt32(view[row].Row[this.MappingName]) > 0)
{
return true;
}
else
{
return false;
}
}
protected override void SetColumnValueAtRow(CurrencyManager source, int
rowNum, object value)
{
DataView view = (DataView)source.List;
if(Convert.ToBoolean(view[rowNum].Row[this.MappingName]))
{
value = 2;
}
else
{
value = -2;
}
}
Well... the problem is that it doesn't work too well. I can see the checks
all right, but I cannot change them. I think that the problem is that I don't
understand too well the role of the CurrencyManager object. I couldn't find
any example on the net on how to override SetColumnValueAtRow.
If anybody knows how to do it or has another idea please post it. Thank you! Tag: RichTextBox Images Tag: 79120
CheckedListBox issue
Hi
now I.m a little confuse
I need to loop a CheckedListBox (only the CheckedItemCollection) . I cant
use a for each loop because I need to get the current and the next item in
the collection, so I need index (I guess..)
and I'm using this code:
For i = 0 To lstLista.CheckedIndices.Count - 1 Step 2
FunctionPrint(lstList.Items.Item(i) +" " lstList.Items.Item(i + 1)
Next
the problem is that I'm not retrieving the items I want (the Checked items)
and I cant find the instruction to get the CheckedItems using indexs
any sug
ken Tag: RichTextBox Images Tag: 79108
ComboBox Bug
I have a Combobox with the following properties:
Me.cboAddServices.DropDownStyle =
System.Windows.Forms.ComboBoxStyle.DropDownList
Me.cboAddServices.DropDownWidth = 240
Me.cboAddServices.Location = New System.Drawing.Point(32, 16)
Me.cboAddServices.Name = "cboAddServices"
Me.cboAddServices.Size = New System.Drawing.Size(225, 21)
Me.cboAddServices.TabIndex = 60
This comboBox in placed inside a groupBox that is on a TabControl. The
comboBox control is populated through the datasource property by a dataSet
table.
I have seen many problem related to tabControls & comboBoxes but none are
like mine. My problem is that when I select a listItem in the comboBox it
reselects the first item. After a second attempt on selecting the SAME item
it highlights it. This has to be done for each listItem in order to select it.
Any ideas? Tag: RichTextBox Images Tag: 79105
opacity property not working
Let me start by saying that I have successfully used the Form.Opacity
property in many other windows in my application.
I have several forms that inherit from a base class form that do not seem to
respond to the Opacity property. I've tried setting it in the designer and
programatically. I've inspected the property in the debugger and it shows up
at Opacity = .75, as desired.
As I said, I can successfully put other windows that have varying levels of
transparency up at the same time which work just fine.
Any help would be appreciated.
Thanks,
Davey Tag: RichTextBox Images Tag: 79103
Application crash caused by ToolTip.RemoveAll.
If you install .Net Framework 1.1 SP 1 or .Net Framework 1.0 SP 3, you could
start getting random application crashes if you use ToolTip.RemoveAll.
The ToolTip control has had a memory leak since 1.0. To solve this, we put
into the each form's close event the ToolTip.RemoveAll() statement.
ToolTip.Dispose() didn't fix the memory leak.
When SP 1 came out our application started randomly crashing. Sometimes it
took five minutes, sometimes as long as five hours. Microsoft finally chased
it down to the RemoveAll statement that had been changed. We switched to
Dispose and the crashes stopped. They had also fixed Dispose so that it
cleaned up the memory leak (they didn't actually fix the control leaking,
just the Dispose method).
This issue is now that if you don't have SP 1 installed, the ToolTip control
will leak. Given the choices I would much rather have the leak than the
crash!!! Tag: RichTextBox Images Tag: 79101
Effective exception handling
I would like to know what people are using for effective exception handling
in windows forms applications?
I ideally want to log all exceptions raised by my application without try
catch blocks in every method.
The only way I can seen to do this is by subscribing to both the
Application.ThreadException and the AppDomain.UnhandledException.
Any suggestions on what the best way to achieve this?
Many thanks
DT Tag: RichTextBox Images Tag: 79098
Combo box controls in Windows Applications render list items blank
Several of our windows applications are rendering the items created in
controls like ComboBox controls as blank. The items are actually in the
collection but the window that is displayed what the ComboBox is open shows
all items as blank.
We also noticed that a simple operation like MessageBox.Show("Hello World",
"My Application") renders the "OK" as blank also (no text is displayed) and
the Text property for the message being displayed (Hello World) is also blank.
Is there any issue reported with the System.String class and the XP SP2?
Any idea will be appreciated.
Thank you in advance. Tag: RichTextBox Images Tag: 79096
Trapping if enter has been type
For some reason my application will not recognize the enter key as a keydown
event what gives???
I just want to test if the enter key has been struct in a textbox any
suggestions?
Thanks in Advance. Tag: RichTextBox Images Tag: 79093
accessing form controls in Vb.net
Hi all,
I have created two forms namely form1 and form2 in my application. I
created a button "start" in form1. When this button is clicked form2
is initialised as a child object and an instance of form2 is displayed
at the same time hiding form1 from the user. In form2 I have an "exit"
button, which when clicked invokes "me.close()". This closes form2
which is active. but still the program is not stopped, Because form1
was the startup object and it is been hidden. So the hidden form1 is
alive and hence the program does not stop and the user is not seeing
anything on his screen.Please tell me a way to hide form1 when form2
is invoked and at the same time when form2 is closed the entire
program should be closed.
With smiles,
Deepa. Tag: RichTextBox Images Tag: 79090
SizeGrip Active Area
I have a number of resizable windows in my application. Some of them are
displayed as modal dialogs while others are displayed as normal windows. The
ones that appear as dialogs show the size grip at the bottom right corner.
The active area over this size grip is a rectangle that includes the size
grip as displayed.
When I display a normal window, the size grip does not display. Even if I
set the SizeGripStyle property to Show, the active area remains the same
(just near the border). I would expect the active area to be larger as it is
in the modal dialog case.
Is there a way to make the active area larger when the size grip is
displayed? It is confusing to see a size grip icon, move your mouse over it,
and then not be able to resize the window because you are not in the active
area.
Thanks,
Rangi Keen Tag: RichTextBox Images Tag: 79077
Drawing own titlebar or caption
This is a multi-part message in MIME format.
------=_NextPart_000_0062_01C4B605.5C8CA770
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Hi,
I want to draw my own colors into the titlebar of a Form.=20
I tried to get the WM_NCPAINT-message and drawed into a the non client =
region:
protected override void WndProc(ref System.Windows.Forms.Message msg)
{
if( (msg.Msg =3D=3D WM_NCPAINT))
{
IntPtr hdc;
if (msg.WParam.ToInt32() =3D=3D 1)=20
{
hdc =3D GetDC(msg.HWnd);
//hdc =3D GetDCEx(msg.HWnd, (IntPtr)msg.WParam, =
DCX_WINDOW|DCX_INTERSECTRGN);
// Paint into this DC
Graphics g =3D Graphics.FromHdc(hdc);
g.FillRectangle(new SolidBrush(Color.Red), -20,-20, =
this.Width, this.Height);=20
ReleaseDC(msg.HWnd, hdc);msg.Result =3D (IntPtr)0;
//g.Dispose();
}
}
else=20
{
base.WndProc(ref msg);
}
}
But this did not work. Than I found something with a borderless Form. =
First creating a 1 px bigger non client area, and then paint into, but =
the code example couldn't include into my project (I do not know why), =
because of using of NatvieMethods.
Now I really don't know anymore. I only want to use my own color for a =
gradient titlebar and be indepentend of fucking windows themes and =
coloring
Thank you your best comments :) And please help me!!
Robert.
------=_NextPart_000_0062_01C4B605.5C8CA770
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2900.2523" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY>
<DIV><FONT face=3DArial size=3D2>Hi,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>I want to draw my own colors into the =
titlebar of a=20
Form. </FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>I tried to get the WM_NCPAINT-message =
and drawed=20
into a the non client region:</FONT>
<P><FONT face=3DCourier size=3D2>protected override void WndProc(ref=20
System.Windows.Forms.Message msg)<BR></FONT><FONT face=3DCourier=20
size=3D2>{<BR></FONT><FONT face=3DCourier size=3D2> =
if( (msg.Msg =3D=3D=20
WM_NCPAINT))<BR></FONT><FONT face=3DCourier=20
size=3D2> {<BR></FONT><FONT face=3DCourier=20
size=3D2> IntPtr =
hdc;<BR></FONT><FONT=20
face=3DCourier size=3D2> if=20
(msg.WParam.ToInt32() =3D=3D 1) <BR></FONT><FONT face=3DCourier=20
size=3D2> {<BR></FONT><FONT =
face=3DCourier=20
size=3D2> hdc =
=3D=20
GetDC(msg.HWnd);<BR></FONT><FONT face=3DCourier =
size=3D2> =20
//hdc =3D GetDCEx(msg.HWnd,=20
(IntPtr)msg.WParam, DCX_WINDOW|DCX_INTERSECTRGN);<BR></FONT><FONT =
face=3DCourier=20
size=3D2> // =
Paint into=20
this DC<BR></FONT><FONT face=3DCourier size=3D2> =20
Graphics g =3D=20
Graphics.FromHdc(hdc);<BR></FONT><FONT face=3DCourier =
size=3D2> =20
g.FillRectangle(new =
SolidBrush(Color.Red),=20
-20,-20, this.Width, this.Height); </FONT><FONT face=3DCourier=20
size=3D2><BR> =20
ReleaseDC(msg.HWnd, hdc);</FONT><FONT face=3DCourier size=3D2>msg.Result =
=3D=20
(IntPtr)0;<BR></FONT><FONT face=3DCourier size=3D2> =20
//g.Dispose();<BR></FONT><FONT=20
face=3DCourier=20
size=3D2> }<BR></FONT><FON=
T=20
face=3DCourier size=3D2> }<BR></FONT><FONT =
face=3DCourier=20
size=3D2> else <BR></FONT><FONT face=3DCourier=20
size=3D2> {<BR></FONT><FONT face=3DCourier=20
size=3D2> base.WndProc(ref=20
msg);<BR></FONT><FONT face=3DCourier=20
size=3D2> }<BR></FONT><FONT face=3DCourier=20
size=3D2>}</FONT></P>
<P><FONT face=3DArial size=3D2>But this did not work. Than I found =
something with a=20
borderless Form. First creating a 1 px bigger non client area, and then =
paint=20
into, but the code example couldn't include into my project (I do not =
know why),=20
because of using of NatvieMethods.</FONT></P>
<P><FONT face=3DArial size=3D2>Now I really don't know anymore. I only =
want to use=20
my own color for a gradient titlebar and be indepentend of fucking =
windows=20
themes and coloring</FONT></P>
<P><FONT face=3DArial size=3D2>Thank you your best comments :) And =
please help=20
me!!</FONT></P>
<P><FONT face=3DArial size=3D2>Robert.</FONT></P>
<P><FONT face=3DCourier size=3D2></FONT> </P></DIV></BODY></HTML>
------=_NextPart_000_0062_01C4B605.5C8CA770-- Tag: RichTextBox Images Tag: 79076
mshtml and the click event inside of a windows service.
I have an application that uses the Ax web browser object. When I call the
IHTMLElement.click() method on an input button (<input type="submit"> or
<input type="button">), the click fires appropriately, if I'm running it
from a windows forms based application.
However, when I run the EXACT same code under a windows service, either as a
logged in user or as the local system account, the click fails to process.
Clicking on other elements (like <a>) works.
I've tried submitting the form directly, in cases where a submit occurs, but
can't do that either. Both GET and POST actions fail.
What am I doing wrong? Is there something that prohibits the onclick event
from firing for buttons when running as a service? Am I missing something?
Robert Tag: RichTextBox Images Tag: 79074
DataTable DataRow tag property??
I'm programmatically creating a DataTable like so:
OccRow = OccupancyTable.NewRow
OccRow.Item(0) = ObjRS("RoomName").Value
Is there any way to give OccRow.Item(0) some sort of unique reference like
the tag property of other controls? Tag: RichTextBox Images Tag: 79072
Disable Datagrid Row Indicator
Hi
How to Disable the Datagird's Row Indicator (Triangle)
which gets displayed on the Row header, without setting
rowheadersvisible = False
Thanks
Bala Tag: RichTextBox Images Tag: 79070
Disable Datagrid Row Indicator
Hi
How to Disable the Datagird's Row Indicator (Triangle)
which gets displayed on the Row header, without setting
rowheadersvisible = False
Thanks
Bala Tag: RichTextBox Images Tag: 79069
how can my winform receive keyboard events?
hi all
i want my winform to receive keyboard events.
however, when i add input controls to my winform
(such as a button),
my winform stops receiving keyboard events.
how can my winform receive keyboard events?
assaf Tag: RichTextBox Images Tag: 79067
ArgumentOutOfRangeException adding items to a CheckedListBox.
Create a new form, add a CheckedListBox to it. Add the following code to the
form's Load event:
private void Form1_Load(object sender, System.EventArgs e)
{
this.checkedListBox1.BeginUpdate();
this.checkedListBox1.Sorted = true;
try
{
this.checkedListBox1.Items.Add("ABC");
this.checkedListBox1.Items.Add("def", true);
}
finally
{
this.checkedListBox1.EndUpdate();
}
}
If the CheckedListBox is sorted, and you are between a BeginUpdate and
EndUpdate, then an ArgumentOutOfRangeException will be thrown if you try to
add an item to the list and set it's checked state at the same time. Getting
rid of the BeginUpdate/EndUpdate or Sorted property "fixes" this. Tag: RichTextBox Images Tag: 79066
Custom datagrid
I would like to create a tablelike datagrid without binding to a datasource.
Is there a control for me to do this? Tag: RichTextBox Images Tag: 79062
How to use a custom font
Hi !
I wonder how I can change the font of a .NET C# application ? I have a
".ttf", I suppose it's a TrueType font file. I will appreciate any help, if
you have tutorials it will be great too.
Should I copy it to Windows System folder ?
Thanks in advance,
Regards.
Sadi. Tag: RichTextBox Images Tag: 79057
CalculatePageInfo: Invalid parameter used.
Hi,
When trying to print a document I get an Invalid parameter used
exception in PrintPreviewControl.CalculatePageInfo.
I m using .NET 1.1 on Windows XP machine.
Regards,
Pankaj Tag: RichTextBox Images Tag: 79053
Disable focus on webBrowser control
Hi all,
I dynamically load a webBrowser control on a windows form control. Every
time I load the webBrowser control the focus is set to the webBrowser control.
How can the focus be set to another control on the form, after the
webBrowser control is loaded?
Thanks Edi Tag: RichTextBox Images Tag: 79050
how to set application-wide keyboard handling?
hi all
i have a 2 winforms in my app.
one is the owner of the other.
i capture keyboard events for
each form.
can i instead tell the entire 'app'
to respond to certain keys.
and not have to tell each form to handle the keys.
i actually have over 20 forms,
so handling keys for each form
would be a lot of dirty work.
assaf Tag: RichTextBox Images Tag: 79047
Building a windows forms "spy"
Hi
I am about to develop a program that scans the text properties of a number
of text boxes in another program and copies them to the clipboard. The
software that I want to scan has no function for printing on a printer, and
therefore I am building this extension to enable simple printouts.
The program I am scanning is built in C#. My program should be built in C#
too.
I do not know the names of the textboxes, so to begin with I need to be able
to get the names of the textboxes to scan. These names will probably not
change, so when have gotten these names I can add them to the code. I know
the name of the form (or at least the caption of the form) that the
textboxes are in. I have no need for changing the properties of the
textboxes either.
Does anyone have some simple code that can help me getting started?
Thanks
Jonas Bergman Tag: RichTextBox Images Tag: 79044
Increate ListView row height
Hi experts
How can I increase individual row's height of the ListView control ?
Any help would be very much appreciated.
Thanks in advance.
Dotnetjunky Tag: RichTextBox Images Tag: 79038
vc++.net exporting database
i am developing a user interface prototype using windows forms in a vc++.net
environment. i have a database(ms-sql) which contains the necessary data for
displaying in a complex datagrid.
when i create a setup file of my prototype user interface, how can i include
the database along with it? i wuld want to be able to do this so that when
the application is installed on an other machine, i would want the datagrid
to display the data items.
thanx in advance Tag: RichTextBox Images Tag: 79032
Question about printing
Dear all,
I'm new in printing in VB.NET 2003 and want to print a run-time generated
form which contains line drawing shape and text. I found that PrintDocument
is good for printing by code but not for entire form. Actually it is not a
kind of report but label sticker so I don't think Crystal Report is my
choice. Does anybody have idea on my issue?
Thanks for your attention and kindly help!
Regards,
James Wong Tag: RichTextBox Images Tag: 79030
DateTimePicker - Time value?
How do I stop my DateTimePickers storing a time value? I just need to insert
the date part into my database but the DateTimePicker.Value property seems
to be in the format ##/##/## ##:##:## Tag: RichTextBox Images Tag: 79028
Windows User (Human) Interface Guidelines?
Apple's got this document:
http://developer.apple.com/documentation/UserExperience/Conceptual/OSXHIGuidelines/index.html
or
http://tinyurl.com/vgge
Is there any such guideline document targetted at gui designers on the
Microsoft Windows environment(s)? Any links will be greatly appreciated!
Kind regards
Abdullah Tag: RichTextBox Images Tag: 79027
how to print form???
hi all,
how can I print the form at design time as well as at runtime. In VB6 there
was a option in File menu to print form and there was method of form
PrintForm.
How can I do the same in dot net????..
any suggesstion will be appreciated..
Ansari Tag: RichTextBox Images Tag: 79025
Help!!! Visual Inheritance......
Hi,
I want to know if I'm doing something wrong. I'm inheriting frmChild
from frmBase in Project1. frmBase is referring to its MdiParent in a function
call from Form_Resize event. When I try to open the designer for the frmChild
it throws an exception for this, saying "Object reference not set to an
instance of an object."
Why is this happening. Does that mean I cannot use any runtime
instanciation in a base form? Or do I have to turn something off? Why is the
code executing in the designer. If I give a message box in the base form, it
pops up when I am loading the Child form!!!!!
Any help is appreciated..
Thanx,
Debi Tag: RichTextBox Images Tag: 79021
Main Menu Toolbar Icon is not coming out.
I have a Main Menu coded in VB.Net, which contains a Toolbar on top. There
are 10 buttons with image on the Toolbar.
During design time, the image on the Toolbar button can be displayed. But,
during runtime, all images on the Toolbar button cannot be displayed out. Why?
Thanks. Tag: RichTextBox Images Tag: 79020
Why does transparency only work sometimes with 32 bit color depth?
I have an application that uses transparency. My video settings are
1600x1200 and 32 bit color. I can make the main dialog transparent but
other controls and child windows are not transparent, I see the colored box
around my control. If I switch my color depth to 16 bit everything is fine.
Why does it work on some forms but not others.
I can even make my main form transparent and drop a custom control that has
transparency set. The main form goes transparent but the custom control has
a blue (my transparent color) box around it. Again if I switch color depth
it works fine.
I heard that somewhere in the .NET documentation it says transparency is not
supported under 32 bit color. I have a hard time believing this. Are there
any computers that don't come in 32 bit color mode anymore?
Jim Tag: RichTextBox Images Tag: 79008
Memory leak - Forms with Owners
I have created a project that has two forms. Form1 has a button which
runs the following code:
private void button1_Click(object sender, System.EventArgs e)
{
Form2 f = new Form2();
f.Owner = this;
f.Show();
f.Close();
this.RemoveOwnedForm(f);
f.Dispose();
f = null;
}
Using .NET Memory Profiler (http://www.scitech.se/memprofiler) I am able
to see that Form2 is not disposed. This seems to be a huge issue. Has
anyone experienced this problem? Is there a workaround? Have I done
something incorrectly?
If I remove the line where the Owner is set, there is no problem with
Form2 being Disposed.
Thanks,
Nate Tag: RichTextBox Images Tag: 79001
Memory leak - Forms with Owners
I have created a project that has two forms. Form1 has a button which
runs the following code:
private void button1_Click(object sender, System.EventArgs e)
{
Form2 f = new Form2();
f.Owner = this;
f.Show();
f.Close();
this.RemoveOwnedForm(f);
f.Dispose();
f = null;
}
Using .NET Memory Profiler (http://www.scitech.se/memprofiler) I am able
to see that Form2 is not disposed. This seems to be a huge issue. Has
anyone experienced this problem? Is there a workaround? Have I done
something incorrectly?
If I remove the line where the Owner is set, there is no problem with
Form2 being Disposed.
Thanks,
Nate Tag: RichTextBox Images Tag: 79000
WM_KEYDOWN, WM_CHAR and WM_KEYUP
I am using SendMessage() to send characters to a window. After using
Microsoft Spy++ to look at window messages when I click a key, I noticed
that the enter key sends WM_KeyDown WM_Char and WM_KeyUp but the home key
only sends WM_KeyDown and WM_KeyUp. Is there some rule I can use to tell if
I should send the WM_Char or not? Tag: RichTextBox Images Tag: 78986
exceptionless exceptions in masked edit box
Hello,
I encountered something to that, even though I have worked it out for
myself, I thought should be passed on.
While I was debugging an event handler (Validating) for a masked edit
box, I suddenly found myself 'back in the UI'. The line of code that
precipitated the surprise exit from the event handler to the UI happened to
generate a null reference exception, but no detectable exception was reported
(either in the IDE debug run or in the released program).
The line of code was not in a try/catch block (there are others in the
handler and, when appropriate, they are triggered). It was the true source
of the bug being worked on, but it was not detected until much later in the
code because as far as anyone knew the event handler validated the control
quite nicely.
I figure that whatever 'hidden' code calls the event handler does so from
within its own try/catch block. When it encounterd this particular
exception, it simply returned execution to the 'UI thread' (no explicit
multi-threading was used in the program, that descriptive phrase was intended
to limit verbiage (looks like I failed there)).
I don't know if this is just an issue with the masked edit box or with
more controls.
Thought you'd like to know,
mklapp Tag: RichTextBox Images Tag: 78983
ok to use threading in winforms for remote connections?
Is it proper to use threading in winforms to retrieve data from a remote sql
server? I thought about setting the timeout period in the connection string,
but what would be better is to start my bind() function in a new thread so
the app isn't tied up searching for the sql server.
Any problems I should be aware of?
-Max Tag: RichTextBox Images Tag: 78982
How TO DO VS.NET Resizable Tear Off MDI(s)
Does any body know how to do visual studio.net style resizable tear off MDI(s)?
I have played with the new splitter tool in vb.net 2005 and it is somthing
like what I am trying to do but it doesn't have closing or push pen abilities.
--
Think, Speak & breath Code! Tag: RichTextBox Images Tag: 78980
Stream Writer
Hello,
I have created a MemoryStream that is holding Binary Data. How do I get the
Data out of the Memory Stream into a file on my hard drive. All the
examples I have seen for a MemoryStream write the contents to the console.
Thanks
Chuck Tag: RichTextBox Images Tag: 78972
Inherited Form Designer gives Exception
Hi,
I have Project1 in which I have frmBase. I compiled the code and then
added an inherited form(frmChild) to the project which inherits from
frmBase. When I open the designer for frmChild the designer throws an
exception, "Object reference not set to an instance of an object."
Please help, what should I do to use inheritance within a project.
Thanx,
Debi Tag: RichTextBox Images Tag: 78971
Global connection strings?
I have a question regarding connection strings. Most of my apps have
multiple forms each of which stores a connection string back to (generally
speaking) the same SQL db (i.e. it's set up the way that VS.Net appears to
work by default).
Is there any advantage in having some kind of global connection string?
(...apart from the obvious one about making it easier to update if the db
moves to a different server...). What is best practice?
Thank you Tag: RichTextBox Images Tag: 78970
this.size doesn't come out to 1024*768
it says
width: 1030
height: 774
I have my form maximized.
what causes this discrepancy, and how do i correct it? I can notice that the
contents on the screen are not centered.
thanks again! Tag: RichTextBox Images Tag: 78969
Default file type handlers
Is there a way to get the path to the application that is the default
handler for a given file type w/o having to manually crawl around the
registry? Tag: RichTextBox Images Tag: 78966
LinkArea not Deserializable
Create a form, drop a LinkLabel on it, and set the form's Localizable
property to True in the designer. If you run this with full trust, everything
works. Run it without full trust (by going to the command line and running
\\localhost\...\program.exe) and you will get the following exception:
System.Security.SecurityException: Request for the permission of type
System.Security.Permissions.SecurityPermission, mscorlib, Version=1.0.5000.0,
Culture=neutral, PublicKeyToken=b77a5c561934e089 failed.
at
System.Runtime.Serialization.Formatters.Binary.ObjectReader.CheckSecurity(ParseRecord pr)
at
System.Runtime.Serialization.Formatters.Binary.ObjectReader.ParseObject(ParseRecord pr)
at
System.Runtime.Serialization.Formatters.Binary.ObjectReader.Parse(ParseRecord
pr)
at
System.Runtime.Serialization.Formatters.Binary.__BinaryParser.ReadObjectWithMapTyped(BinaryObjectWithMapTyped record)
at
System.Runtime.Serialization.Formatters.Binary.__BinaryParser.ReadObjectWithMapTyped(BinaryHeaderEnum binaryHeaderEnum)
at System.Runtime.Serialization.Formatters.Binary.__BinaryParser.Run()
at
System.Runtime.Serialization.Formatters.Binary.ObjectReader.Deserialize(HeaderHandler
handler, __BinaryParser serParser, Boolean fCheck, IMethodCallMessage
methodCallMessage)
at
System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(Stream
serializationStream, HeaderHandler handler, Boolean fCheck,
IMethodCallMessage methodCallMessage)
at
System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(Stream serializationStream)
at System.Resources.ResourceReader.LoadObject(Int32 pos)
at System.Resources.RuntimeResourceSet.GetObject(String key, Boolean
ignoreCase)
at System.Resources.ResourceManager.GetObject(String name, CultureInfo
culture)
at System.Resources.ResourceManager.GetObject(String name)
at
Clientele.Utility.DbHealthChecker.ConfigurationSettingForm.InitializeComponent()
at Clientele.Utility.DbHealthChecker.ConfigurationSettingForm..ctor()
at Clientele.Utility.DbHealthChecker.MdiMainForm.MdiMainForm_Load(Object
sender, EventArgs e)
at System.Windows.Forms.Form.OnLoad(EventArgs e)
at System.Windows.Forms.Form.OnCreateControl()
at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
at System.Windows.Forms.Control.CreateControl()
at System.Windows.Forms.Control.WmShowWindow(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
at System.Windows.Forms.ContainerControl.WndProc(Message& m)
at System.Windows.Forms.Form.WmShowWindow(Message& m)
at System.Windows.Forms.Form.WndProc(Message& m)
at System.Windows.Forms.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg,
IntPtr wparam, IntPtr lparam)
Basically, this stops us from using a LinkLabel when our forms are
localizable and the EXE isn't run with full trust. Tag: RichTextBox Images Tag: 78965
WS_EX_LAYERED/LockWindowUpdate problem
Hello,
I use LockWindowUpdate() API function through P/invoke to prevent updating
form content while updating/removing/adding something in form (child
controls). Despite of the bug in W2k (Q270624, Layered Windows Disappear
During Calls to the LockWindowUpdate() Function) I do something like this:
1. Remove WS_EX_LAYERED attribute from form through SetWindowLong API
2. Call LockWindowUpdate
3. some updates (adding/removing child controls through standard .NET methods)
4. Call LockWindowUpdate - for form unlock
5. set back WS_EX_LAYERED flag on a form
6. redraw form
but on W2k after a point 5 form disappears and I cannot resolve this issue.
Thanks in advance
-bda- Tag: RichTextBox Images Tag: 78960
drawing text, autosizing textbox, flickering ...
Hi (VS.Net 2003 + SP),
how to make anchored textboxes, toolbars or statusbar not to flicker on
resize?
And one more thing, I wanted to make multiline textbox to autosize in height
and width. Since autosizing is done only in singleline, I used
prefferedSize= Graphics.MeasureString(control.text, control.font)
to get required size. But after resizing textbox, I saw that it is too wide
and height is less than required. So I tried to paint text myself. Then I
saw, that everyline of that text is painted differently (using standart font,
same text on every line), changing text to Arial 9pt, helped a bit. But
anyway it is too wide and height is less than required for textbox. How to
implement full autosizing for textbox? Tag: RichTextBox Images Tag: 78951
Status images in DataGrid
Hello,
is there any way how to use first column (RowHeader) to display custom
images (e.g. status icons)?
Thanks a lot
Vladimir Tag: RichTextBox Images Tag: 78946
OK, when inserting an image within a Rich Text Area is there any method to
stop the image from being resized?