ScrollBar Bug/ Problem in .Net 2.0?
Hi all,
I'm mimicking the AutoScroll functionality from a ScrollableContainer on
my user control (for reasons of having more control and flexibility),
but I seem to have hit a bit of a wall.
In the case of having a horizontal scroll bar, I set his .Maximum
property to say 167, but when I use the thumb/ button to get to the
right-most extent he'll only ever get to a maximum of 158. It always
appears to be out by 9. Although I've only tried this on one PC I find
it hard to believe I'm the only person who has this problem...can anyone
shed some light on this for me?
Thanks everyone,
Kieron Tag: Support for Postscript fonts Tag: 99846
Title Bar
I wish to replace the tile bar with my own code which will have its own max
min buttons etc, but wish to still keep the Border style, if I set the
FormBorderStyle property ot none I loose the border of the window, and all
the oterh option always provide some sort of title bar.
Any Ideas.
Thanks Tag: Support for Postscript fonts Tag: 99844
SplitContainer and GetChildAtPoint
I have a UserControl that I have a SplitContainer in.
I have placed several Controls in the panel1 and 2 of the split container
and I want to be able to do a "GetChildAtPoint" when clicking on the
UserControl.
However, all I get is the SplitContainer as result. How can I disregard the
splitcontainer or how could I find the control underneath the mouse when
clicking.
I already to PointToClient on the X and Y gotten from MouseDown and pass
that point to GetChildAtPoint and that's when it fails to get the child I
clicked on. It gets its parent i.e. the SplitContainer.
Greatful for any help at all. Tag: Support for Postscript fonts Tag: 99839
Disable MDI child buttons on parent menu bar
Hi all
is there a way to disable all the three buttons of a MDI parent menu bar
relatives to a maximized MDI child form?
What I need is a MDI child that can only be Maximized (or closed).
Thank you.
C.
-------------------------------------------
Carlo, MCP (Windows Based Applications)
carlodevREMOVE@gmail.com Tag: Support for Postscript fonts Tag: 99835
more clues on my multithread problem
Hi there i have discovered that my application entirely hangs when the
modeless dialog needs to be repainted. Then all the UI becomes unresponsive
and the debugger dont let me pause the execution to see where it is each of
the threads . The modeless dialog stays as it is been working on something
because when i put the mouse cursor over it it changes to the sand watch
icon. The main form of the application is no more repainted and i cando
nothing except stopping the debugging process (an operation which takes more
time than in a normal situation).
Does this has a meaning for anyone?
A question i have is:What happens when you call the Invoke method on a form
to execute a delegate?Does the form stop its message pump to execute the
delegate or a message is sent indicating the form that it has to execute that
operation? could be the problem in there?
Thanks, im getting mad with this project Tag: Support for Postscript fonts Tag: 99831
Message queue in modeless dialogs
Hi, i have a multithreaded application which uses forms and i have a worker
thread that has to create a modeless dialog to monitor some of the operation
which it has to do. The problem is that if you create the dialog and call
show() from the thread this dialog wont't have a message queue and will
become unresponsive. I found in a page that you have to create the dialog in
the main UI thread.In that case the message queue of the main form will be
shared among the main form of my application and the modeless dialog i have
created, but there is a problem. If one of them hangs up the other too will
hang. The problem is that my application hangs at one point and i dont know
exactly the reason , the only thing i know is that it has to be something
like a deadlock that causes one of the forms become unresponsive.
I want the modeless dialog to have its own message queue independent from
the main UI message queue, ¿how i can do that? i have tried to create a new
thread which executes application.run again as i have read that this method
creates a message queue for the thread who calls it but the result was not
the expected one: my modeless dialog runs ,be sure of it but when i call
application exit in the thread of the modeless dialog all the application
exit, not only the thread which i was pretending to be th ethread of teh
dialog, follow me?
Any ideas about this? Tag: Support for Postscript fonts Tag: 99829
Select Text of Label
How can I allow my WinForm user to select/copy/paste the content of a
Label?
Thank you in advance, Jerry Nixon Tag: Support for Postscript fonts Tag: 99826
ListViewGroup Color?
Anybody know how to set this?
listview.ForeColor has no effect on it.
If I change my listview forecolor to green the group headers stay black. Tag: Support for Postscript fonts Tag: 99824
How to decide the best choice between web-form and win-form for the next solution?
How to decide the best choice between web-form and win-form for the next
solution?
In my case, the new projects will have over 200 users to use and we will
apply part-by-part function components add to production environment when we
developed a part and parts. The projects will have a very very user
friendly UI for powerful analysis and enquiry. Also, the projects should
have very high response for user actions.
For consider the deloyment, web-form will be very fast solutions. Win-form
will need to install one-by-one PCs. It will affect our decide which
web-form and win-form to apply.
Are there anyone have the best methods or ideas for our considers? Tag: Support for Postscript fonts Tag: 99819
Displaying HTML/XHTML from source XML file
Displaying HTML/XHTML from source XML file
i am having an xml file
i want to display the contents of the xml file in a web browser control
in winforms
however i want to display it as html/xhtml after applying formatting.
how can this be done? Tag: Support for Postscript fonts Tag: 99818
PropertyGrid with duplicate DisplayNames
Hi group,
I have a problem using the PropertyGrid.
I'm using a PropertyGrid to show a dynamically generated option dialog.
I use an ICustomTypeDescriptor implementation together with a custom
PropertyDescriptor that fakes out the needed "properties" for the grid,
the actual values coming from a different data source, that can also
changed programmatically. The PropertyDescriptor fakes a human friendly
DisplayName and an unique PropertyName that is only used internally.
Problem: When doing a propertyGrid.Refresh(), GridItems with duplicate
DisplayNames are not handled correctly, specifically: If I change the
value for any but the first one (in current sort order), after the
refresh the FIRST one is always selected, and it shows the string
representation of the currently changed entry (however, it DOES paint
the value representation correctly). The string representation is only
displayed incorrectly, i.e. it is not written back, and after any focus
changes, it is displayed correctly. Also, if I make the DisplayNames
unique, or the PropertyType differs, the problem goes away.
It also does not depend on the PropertyDescriptor/ICustomTypeDescriptor
combo, but happens even with static properties (just checked ;-))
Has anyone else encountered this or a similar problem and/or has any
tips?
Regards
Jasper Tag: Support for Postscript fonts Tag: 99815
WindowsService stops just after it's started - remoting
hi,
I created WIndowsService to host SAO object. Everything was ok before,
but when I get back to it a few days ago i realized that it doesn't
work properly. So what I did wrong? Service host remote object so it
has work to do and service shouldn't be stopped.
The only solution I see is to create Thread with simple loop to keep my
service runing - but I know it's bad solution. Please help me with my
problem.
Piece of sourcecode:
internal partial class Server : ServiceBase
{
private TcpServerChannel chan;
private ChainingDeamon chainingDeamon;
public Server()
{
InitializeComponent();
}
protected override void OnStart(string[] args)
{
try
{
this.NetInterfaceSetup();
}
catch (Exception e)
{
MessageBox.Show(e.Message, "DesServer Startup Error",
MessageBoxButtons.OK, MessageBoxIcon.Error);
this.Stop();
}
chainingDeamon = new
ChainingDeamon(Application.StartupPath);
}
protected override void OnStop()
{
}
private void NetInterfaceSetup()
{
this.chan = new TcpServerChannel(48004);
ChannelServices.RegisterChannel(chan, true);
RemotingConfiguration.ApplicationName = "DesServer";
RemotingConfiguration.RegisterWellKnownServiceType(typeof(DesServer.AdminProviderFactory),
"DesServer.AdminProviderFactory", WellKnownObjectMode.SingleCall);
}
}
regards
Martin Dz Tag: Support for Postscript fonts Tag: 99812
Problem with multithreaded application (Cont.)
Let me be more explicit on the problem: i've been making some testings on my
application and i realized that the application hangs in this situation:
I have a main window created in the thread which called Application.Run so
it has the message loop right? Well, then i have another thread wich
represents an entity which has to do its own operations (worker thread
created with the thread object) .Then i ask my thread object to show a
monitor where it has to write its progress in the operation, this monitor is
a non-modal dialog. The worker thread calls a method to obtain the form
which represents that monitor: this method will do a call of the Invoke
method in the form object which represents the main form of the application
and which was created in the thread which called the Application.Run
method,follow me? : ) .this invoking is to ask the UI thread to create a
monitor form object (i have to create the monitor object in the UI Thread as
it will be a non modal dialog which i will show using its Show method so it
won't have a message queue by itself ,this is the opposite to what happens if
i want it to be a modal dialog:then i call the showdialog method and it will
have its own messagequeue and it is not necessary for it to be created in the
UI Thread)
well thn the worker thread gets its monitor form object and do an Invoke to
call its Show method to display it.
Periodically the worker thread will do an Invoking to call a methos wich
updates the fields of the monitor object.
Well everything goes fine but when the monitor is running and i start moving
the main form from one side to other of the screen then the hang of the
application comes up. I think that it could be because i created the monitor
object in such a way that it share the messagequeu of the main form of the
application(creating this object in the UI Thread).
The problem is that i havent found the way to give a non modal dialog its
own message queue independent of the message queu of teh main form.
anybodu thinks that this could be the problem???? THANKS Tag: Support for Postscript fonts Tag: 99807
selection box in datagrid
I just added a datagridView to my form and it looks like it adds a
'Selector' box in the header row. That box that is blank, has the * in it
if you can add records. How do I get rid of that thing? I can't find any
option to get rid of that selector box.
Thanks. Tag: Support for Postscript fonts Tag: 99803
Problem with multithread application
Hi there.Im building a multithreaded application which uses forms and im
having some problems possibly due to my inexperience.
The project is being developed in C# with visual studio 2005.
I have a main thread which executes Application.Run() (so it has the message
loop for the interface) and later i create more threads that are executing
and in some situations have to do some operations in the UI. Some threads
also query the UI the creation of non-modal dialogs to show information "on
the fly". There arent cross-threaded operations in the UI, im sure of that.
All the operations have been queried using the InvokeRequired attribute and
the Invoke Method (i have used only the Invoke method instead of using
BeginInvoke too) so all the operations on the UI are done in the Thread tha
run Application.Run (the UI thread).
When i execute my application everything goes fine buty sometimes when i
execute it and push some button of one of the windows or when i close one of
that windows etc etc my application hangs (well i dont know if my application
but at least the UI). I think that the problem is in that im not considering
some issue of the using of the UI in multithreading applications, maybe it
is taking place a deadlock when im quering the UI tread some operations from
different threads ¿someone can advise me or has any idea about what can be
happening? thanks Tag: Support for Postscript fonts Tag: 99795
Domain Name
HI, I have questation about computer domain . How I simpli get this
information from computer ? I want use systeminformation , properties
userdomainname , but this is user domain ...
thanx
marek Tag: Support for Postscript fonts Tag: 99794
DataGridView custom column for- password add and edit
Hi All,
Please let me know how to impliment a custom datagridview column for a
password add and edit functionality.
TIA
Nikila Tag: Support for Postscript fonts Tag: 99791
Win application freezes on datagrid scroll event
Hallo,
I'm experiencing an eerie trouble using datagrids on Windows
application with .NET framework 2.0
Being concise, I say that my applications polls the serial port by
means of a separate thread. When some information is found on the tool
connected to the port (a GSM phone), such an information (SMS) is put
in the db and then an event is raised. When such an event is raised,
the delegate invokes an appropriate method that refreshes the datagrid:
every row in the grid is one received SMS.
The refreshing is made by the separate thread, so it is called the
appropriate method that enables separate threads to interact with the
objects and controls of the UserInterface belonging to the main thread,
as it is meant to be.
Ok, everything works fine but, say that the datagrid control can show
16 items before the vertical scrollbar appears, when the 17th item has
to be shown, instead to visualize the vertical scrollbar, the whole
application freezes. No errors are thrown: just freezes - not
responding application. Need to kill and restart, and so it's ok:
vertical scrollbar appear.
I've to say that this behaviour doesn't happen always. Almost always. I
mean, sometimes 20 or more SMS are found in the GSM and correctly shown
in the datagrid with scrollbar, but the most of times when the 17th is
shown, application freezes.
I'd be glad if someone could shed some light upon this strange, and
unpredictable, event.
Many thanks,
Paolo P Tag: Support for Postscript fonts Tag: 99788
Use MeasureString to determine required height
I'm trying to create a label control in VB.NET2005 that will automatically
change it's height to fit the content. To do that i'm using MeasureString to
determine required height for a set width.
What i found is that MeasureString sometimes returns the height which is
smaller then it should be and it seems to depended on the width.
So the question is am i doing something wrong or it's a bug. If it is a bug,
can someone recomend a reliable workaround.
Here is a code that used to test this. When width is set to 570, the last
line is not visible. When it's set to 590 all is OK.
Sub TestMeasureString(ByVal g As Graphics)
Dim s As Size
Dim f As Font = New Font("Arial", 11.25, FontStyle.Regular,
GraphicsUnit.Point)
Dim str As String = New String("W"c, 1000) & " END"
s = g.MeasureString(str, f, 570).ToSize
's = g.MeasureString(str, f, 590).ToSize
g.DrawRectangle(Pens.Black, New Rectangle(New Point(0, 0), s))
g.DrawString(str, f, Brushes.Black, New Rectangle(New Point(0, 0), s))
End Sub Tag: Support for Postscript fonts Tag: 99783
read guid
I have a vb.net 2.0 project where I need to read a files guid. Is this even
possible?
I need to do this via CODE, no 3rd party app please.
Can I generate guids all day long but I want to read what a dll file has
already been assigned. I know I can painfully search the registry. But there
must be a better way.
They are vb6 dll's, so they have a type library file. Can that be used?
i.e. file "testds.dll" = {000-....}
Thanx. Tag: Support for Postscript fonts Tag: 99779
DataGrid View
How do you set the width of row(-1) where the Row[x].HeaderCell are?
Also how can you write something in the topleft most cell [-1,-1]? Tag: Support for Postscript fonts Tag: 99777
Question on Inheriting Controls
I have a project which is a Windows Form "Wizard". Each "page" displayed in the
main Wizard form will be a user control. Each of these user controls will share
many similar attributes. So it seems natural for me to create a base user
control class and have all my "pages" inherit from it. But it seems that VS2005
really isn't happy doing this unless the base class is compiled and put into an
assembly other than the one containing my project. The visual designer get al
hosed up and complains. I can force it all to work by hand-coding some changes
but this seems way harder than it should be. Is there something I am missing
here? Thanks. Tag: Support for Postscript fonts Tag: 99776
DataSet and Usercontrol TestContainer has a Problem
I have a WebService that has a method that returns a Typed DataSet.
I create a UserControl that calls this method.
When the UserControl runs by "UserControl TestContainer" and calls the
WebService's method which returns a Typed DataSet the error "There is an
error in XML document (1, 220)." is thrown.
I don't know what's is wrong.
This problem only occurs when Typed DataSet is returned and running by
"UserControl TestContainer".
I'm using .Net Framework 2.0 and VS 2005.
Could someone help me? Tag: Support for Postscript fonts Tag: 99775
MonthCalendar - Hot to retrieve the Month(s) displayed?
How would I determine the first and last day, month and year of the currently
displayed month(s)? Withoutout clicking on the day 1 box? Tag: Support for Postscript fonts Tag: 99774
RichEditBox speed
Is there anyway to speed up the selecting and coloring of text in a
richedit. The parsing of the text is nothing in comparison with how long it
takes these two calls to take place (over many lines):
rtb.Select(currentPos, myLine.Length);
rtb.SelectionColor = myColor;
From my research, there are a few ways to speed up the richedit but none of
them help speed up the coloring process:
1) Inherit from the RichEdit and in an overloaded WndProc, ignore WM_PAINTs
while updating
2) Use SendMessage to pause redraws/events (EM_SETEVENTMASK, SETREDRAW)while
updating
3) Hide the RichTextBox while updating (seems to work the best...but it is
still slow)
Does anyone else out there have any better suggestions? I want to color the
entire richeditbox in one sweep...so I don't have flickering or other
noticeable side-effects caused by scrolling. I'm not looking to use a 3rd
party control either for a number of reasons.
TIA!
sb Tag: Support for Postscript fonts Tag: 99769
State of MdiClient
Hi,
I'm developing an MDI application and i am having a problem: how do i
know the state of MdiClient; what i mean is: when i maximize a MDI
child, then close it and then open a new MDI child, it will open
maximized, then if i change it's state to Normal and close, then next
opened MDI child screen will have state Normal.
So i assume that MdiClient keeps state of MDI child windows even if none
of child forms exists at the moment. How do i find that?
Thank you,
MuZZy Tag: Support for Postscript fonts Tag: 99764
Adding 'object' to Treeview?
I have a bunch of related classes that I want to add into a Treeview
with a hierarchy. However, Treeview doesn't support the insertion of
the root 'object' type into the nodes, which surprises me. I just
wanted to add them in and have the mouse events fire back with the
reference to the object clicked on. I figured I'd have to override
ToString in my classes to have them show up in the treeview in the
right way and that would be that.
But to my surprise it doesn't seem to work like that and it seems like
I have to start messing with data binding... which just seems so
overkill for the task that it must be the wrong thing to do.
Can't I just add 'object' types like I can to the collection classes?
What should I be doing instead?
Thanks for any help! Tag: Support for Postscript fonts Tag: 99761
Is the computer locked?
Is there a way using the .NET framework to find out if the machine a service
is running on is locked by the user? Tag: Support for Postscript fonts Tag: 99760
How to Package and Deploy Windows Installer 3.0
I have made setup project (VS 2005) that includes setup of my app and
Framework 2.0
How can I check if there is installed Windows Installer 3.1 and if not to
install it?
I know that I have to add launch condition, but don't know what to type in
properties.
Thanks Tag: Support for Postscript fonts Tag: 99756
ReportViewer - Multiple forms or Single form
I have finally got the hang of this ReportViewer control. The one
question that I have is dealing with multiple reports. If I have, lets
say, 10 rdlc reports should I have 10 WinForms to put them on, or put
them on one form and programmatically choose which rdlc to use.
I have been doing the second option but have been running into some
weird data binding sharing issues.
Any thoughts/suggestions? Tag: Support for Postscript fonts Tag: 99754
Notification Icon
Hi group, is there a way to make a Notification Icon object available
for the entire application?? because, for example, if i have a MDI form
(i'm using VS 2005) with a Notification Icon object, and display a
modal dialog, the click event on the notification object will not fire
while the modal is active. Any suggestions?
Thanks in advance Tag: Support for Postscript fonts Tag: 99752
Serialization
hello,
i want to do the following:
I have an extender provider which is serialized correctly. the vs designer
generates the following code for a button for example:
myButton.SetMyProvider(this, new MyItem());
Now what I want to do is that he creates a new class first. this class
called MyItem has a collection. so i want that the code is generated like
the following
MyItem Item1 = new MyItem();
Item1.MyCollection.Add(new MyChildItem());
Item1.MyCollection.Add(new MyChildItem());
myButton.SetMyProvider(this, Item1);
Is it possible to get the objects serialized a way like that? Tag: Support for Postscript fonts Tag: 99750
Using System.Web.Mail.MailMessage in Windows Forms
Hi,
I've written a small proof of concept application to show we can send emails
in VB.NET and it works a treat using this piece of code:
Dim myEmail As System.Web.Mail.MailMessage = New
System.Web.Mail.MailMessage()
myEmail.From = txtFrom.Text
myEmail.To = txtTo.Text
myEmail.Body = txtBody.Text
SmtpMail.SmtpServer = ""
SmtpMail.Send(myEmail)
But if I specify a mailserver in SmtpMail.SmtpServer I get this error:
Could not access 'CDO.Message' object.
Why does setting SmtpMail.SmtpServer = "" send the email?
Does this mean that using System.Web.Mail.MailMessage is reliant on having
Outlook or Outlook Express installed (Currently I have Outlook 2003
installed)?
Thanks
Darren Tag: Support for Postscript fonts Tag: 99748
Slow Rendering on Windows Forms when I am using graphics as backgr
Hello,
I am trying to build a KIOSK application, where all windows forms are filled
with graphics images and a lot of buttons.
The major bproblem is that when the application is running and the forms are
ready to display on the screen I see a lot of cuts... for example when I show
a form that has a background image (800x600) and about 20 buttons on it,
which each of the button has a background image, the render on the screen is
not the recomended....!
Is there any technique that I could do the rendering smoother and faster???
Many thanks
George Barbagiannis
P.S. Computer 2.4G 1GB 128MB VGA Tag: Support for Postscript fonts Tag: 99741
Windows forms Datagrid cell text
Hi,
I am trying to write some code that will return the text from a datagrid
cell when you click on it. So far I have the following code (which maybe
completely the wrong way to go about this), which returns the row number,
and the column number, but I am not sure how to get the contents of the cell
from this.
///
Private Sub dg1_MouseUp(ByVal sender As Object, ByVal e As
System.Windows.Forms.MouseEventArgs) Handles Dg1.MouseUp
'Returns the room for the datagrid row that has been clicked
Dim pt = New Point(e.X, e.Y)
Dim hti As DataGrid.HitTestInfo = Dg1.HitTest(pt)
If hti.Type = DataGrid.HitTestType.Cell Then
MsgBox(hti.Row & " " & hti.Column)
Endif
///
Thanks
Richard Tag: Support for Postscript fonts Tag: 99736
How to get mouse event when using DesignSurface?
Hi all,
When I use DesignSurface and DesignSurface Manager to build a Designer, I
only can use SelectionService's SelectionChange event to know which component
is selected. But I don't know how to get mouse click in the component.
Becuase I want to show a contextmenustrip in each component.
Thanks, Tag: Support for Postscript fonts Tag: 99733
Email and .NET
Hello,
I am trying to format an email and have a .net application open up Outlook
or Outlook Express so that the user can simply click Send and have the
formatted email send from their email account. I am currently doing this
the following way:
Dim sParams As String
Dim TheTo, TheSubject, TheBody As String
TheTo = txtEmail.Text
TheSubject = ""
TheBody = ""
sParams = "mailto:" & TheTo
sParams = sParams & "?subject=" & TheSubject
sParams = sParams & "&body=" & TheBody
System.Diagnostics.Process.Start(sParams)
The problem this is that it creates a new instance of Outlook every time the
event is fired to create the email. All I want is for a new email to appear
and add the data that I want. After about 6 or 7 emails are created this
way, Outlook freezes up and stops working.
Any suggestions will be greatly appreciated,
This is vb .net.
Chuck Tag: Support for Postscript fonts Tag: 99730
Edit different data types in a DataGrid in the same column on different rows
Hi All
Hopefully someone out there can answer this. I have a data source that
displays a set of property names and values (each name/value pair will
be displayed on a different row).
I want to be able to enable the data source to be edited through the
grid, but each of the values on different rows may be a different data
type.
I know I can apply a column style to set a whole column to display a
ComboBox for a selection, a DateTimePicker, etc., but I'd like to know
if there's a way to apply the style on a row-by-row basis. In doing
this I should be able to display all the property name/value rows and
have a different edit mode control appear for the value in each row
depending on its data type.
I should not neglect to mention that the data type of the value column
can be defined programatically, as it's also held in the data source to
describe the type of data in the value column.
Can anyone please advise if this is possible, or if you'd like more
information to clarify the problem.
Thanks in advance,
Sam. Tag: Support for Postscript fonts Tag: 99728
clicking MDI child does not activate form...
Clicking an mdi child form will not activate the form unless I click on
the sizeable border or title/caption bar. Sometimes it works correctly
and I can click anywhere on the underlying child form and it pops to
the front. Other times, I can type in text boxes of the child for,
drop down combox boxes, etc, while the child form remains behind other
forms. Gotta love .NET, right?
I have noticed countless other posts on this topic going back to 2001,
but no resolution.
Has anyone been able to track down the cause for this behavior? Tag: Support for Postscript fonts Tag: 99725
studio deleted my resx file, and now it won't rebuild it properly!
I'm using Visual Studio 2003. I have a C# Forms app with several forms.
While working, Studio asked to check the .resx file of a particular
form out of SourceSafe. It then completely erased the .resx file,
leaving the form empty in the Designer. However, all the code is still
in the .cs file!
Most solutions I've found say to delete the offending .resx file, and
Studio will rebuild it for you. Unfortunately, that's not happening
here. I close the form, delete the file, and try to reopen the form,
but it comes up with a blank form again.
This is EXTREMELY frustrating. Does anybody know how to fix this?
Lee Crabtree Tag: Support for Postscript fonts Tag: 99724
CheckedListbox and CheckOnClick
I am working with the CheckedListBox and trying to get it to perform
functionality similar to the Windows Explorer Choose Details window. The
one thing I can't get to work is with the clicking on the checkbox part to
autocheck. I can set the CheckOnClick to true, but I don't want it to
autocheck if I click on the text part. Only if I click on the checkbox
part. Anybody have any ideas on this?
Lance Tag: Support for Postscript fonts Tag: 99722
translucent panel...
i need to be able to adjust the opacity of a Windows Forms 'Panel' control.
currently, this is available on Forms, but not on Panel controls. can
someone please show me a trick to make this happen with panels or any other
control that i can use without having to display another Window/Form?
much appreciated,
ben Tag: Support for Postscript fonts Tag: 99721
Multithreading in Form
Hi All,
I am new to C# thread programming. I got one issue. I appreciate if
anybody can point what i am doing wrong here.
I have created one C#.NET application (VS.NET 2003 and 1.1 Framework).
It contains two forms. (Form1 and Form2)
Form1 contains only one button.
On click of this button two threads will be created.
This thread will just display the Form2.
Form2 contains only one ActiveX control(Created by me, Works fine in single
thread app for last 3-4 years).
When i excute this application, if i click on the Button on Form1, Threads
are created and it shows the Form2 and ActiveX control. So far its fine.
When i close the Forms created by the thread it crashes.
When i use the Debuger it says "User Break Point Called" and Call Stack
shows following :
NTDLL! 7c901230()
_CrtDbgReport(int 2, const char * 0x5f4d0cf0 THIS_FILE, int 374, const char
* 0x00000000, const char * 0x00000000) line 353
AfxAssertFailedLine(const char * 0x5f4d0cf0 THIS_FILE, int 374) line 39 + 20
bytes
AfxWndProc(HWND__ * 0x0141056a, unsigned int 8, unsigned int 16057944, long
0) line 374 + 21 bytes
AfxWndProcDllStatic(HWND__ * 0x0141056a, unsigned int 8, unsigned int
16057944, long 0) line 57 + 21 bytes
USER32! 77d48734()
USER32! 77d48816()
USER32! 77d4c63f()
USER32! 77d4c665()
SYSTEM.WINDOWS.FORMS! 7b823b1e()
SYSTEM.WINDOWS.FORMS! 7b823a2b()
SYSTEM.WINDOWS.FORMS! 7b896ca4()
SYSTEM.WINDOWS.FORMS! 7b82291b()
0096453a()
USER32! 77d48816()
USER32! 77d4b4c0()
USER32! 77d4b50c()
NTDLL! 7c90eae3()
USER32! 77d48734()
USER32! 77d5418d()
USER32! 77d53fd9()
USER32! 77d5b82a()
USER32! 77d54e28()
USER32! 77d561b3()
USER32! 77d6a92e()
USER32! 77d6a294()
USER32! 77d95fbb()
USER32! 77d96060()
USER32! 77d80577()
USER32! 77d8052f()
__crtMessageBoxA(const char * 0x032fb9c8, const char * 0x102579a0 `string',
unsigned int 73746) line 65
CrtMessageWindow(int 2, const char * 0x5f4d0cf0 THIS_FILE, const char *
0x032fcafc, const char * 0x00000000, const char * 0x032feb20) line 520 + 22
bytes
_CrtDbgReport(int 2, const char * 0x5f4d0cf0 THIS_FILE, int 969, const char
* 0x00000000, const char * 0x00000000) line 419 + 76 bytes
AfxAssertFailedLine(const char * 0x5f4d0cf0 THIS_FILE, int 969) line 39 + 20
bytes
CWnd::DestroyWindow() line 969 + 21 bytes
COleControl::OnFinalRelease() line 358
CCmdTarget::InternalRelease() line 223
CCmdTarget::ExternalRelease() line 234
COleControl::XQuickActivate::Release(COleControl::XQuickActivate * const
0x03356630) line 69
OLE32! 7750de71()
OLE32! 7750dbd2()
OLE32! 77554a4f()
OLE32! 77554a30()
OLE32! 77564daf()
OLE32! 7750221e()
OLE32! 77502171()
OLE32! 774ff221()
OLE32! 774fee88()
OLE32! 775131f0()
OLE32! 774fd141()
OLE32! 774fd0e9()
NTDLL! 7c9011a7()
NTDLL! 7c919213()
KERNEL32! 7c80cce7()
KERNEL32! 7c80b511
My C#.Net app source code looks like this:
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
Application.Run(new Form1());
}
void MyThreadFunction()
{
Form frm = new Form2();
//Show the Form which contains the SymFacX. Here "using" is the keyword
which will release the frm object(Form2) once its job is done.
//If we didnt release this frm object. ActiveX will throw an excetion. As
SymFacX will try to delete itself but still frm object contains the reference.
using(frm)
{
frm.ShowDialog();
}
//frm.Dispose();
//GC.Collect();
}
private void button1_Click(object sender, System.EventArgs e)
{
//Create Thread
newThread1 = new Thread(new ThreadStart(MyThreadFunction));
//Start the Thread
newThread1.Start();
//Create Thread
newThread2 = new Thread(new ThreadStart(MyThreadFunction));
//Start the Thread
newThread2.Start();
}
private void Form1_Closing(object sender,
System.ComponentModel.CancelEventArgs e)
{
newThread1.Join(0);
newThread2.Join(0);
Environment.Exit(0);
} Tag: Support for Postscript fonts Tag: 99720
Setting combo box items property?
I am building a user control that has a combo box (comboBoxMain) as a
constutient control. The user control has an Items property, which will set
the items of the combo box. I want the user control Items property to be
browsable at design-time, so the user of the control can click the
properties, enter a list of items in the String Collection Editor and have
them appear in the combo box.
Here's the code I'm using now:
[Browsable(true)]
[EditorBrowsable(EditorBrowsableState.Always)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)]
[Editor("System.Windows.Forms.Design.StringCollectionEditor,System.Design",
"System.Drawing.Design.UITypeEditor, System.Drawing")]
[Description("The list of objects in the combo box")]
public ComboBox.ObjectCollection Items
{
get { return comboBoxMain.Items; }
set { comboBoxMain.Items = value; }
}
The Editor attribute brings up the String Collection Editor, but it isn't
retrieving any items I place in the combo box. And nothing that I enter in
the editor is making it back to the combo box.
What do I need to do to complete the connection between the user control
Items property and the combo box Items property? Thanks.
--
David Veeneman
Foresight Systems Tag: Support for Postscript fonts Tag: 99716
No touch deployment - internet cache full
We have had a few instances in our organization that the user was unable to
run a no-touch deployment exe from our intranet. Clearing their full
internet cache corrected this problem.
This happened in 2 scenarios:
1. When trying to run the no touch .exe over the intranet would do nothing.
2. When trying to run the .exe over the intranet the user would run their
old cached copy of the application and not download the latest from the
server.
In both scenarios clearing their internet cache and launching the
application again corrected this problem.
I thought the idea with internet cache is First In, First Out... in thus...
cache would be cleared to accomodate new temporary internet files. Is this
correct or is there an issue with no-touch deployment in this regard.
Has anyone else ran into this problem, and if so what solutions have you
come up with. Remember we have a large organization and no touch deployment
applications are being used by 100+ individuals. One way I know would be to
write a login script to clear the internet cache... of course.. not every
user will reboot their PC every night... and isn't ideal for other reasons.
Thanks in advance... Tag: Support for Postscript fonts Tag: 99715
ConfigurationManager app.config
Dear Friends,
I have been trying to get the following to work properly, but with
little luck. I have created a class that inherits from ConfigurationSection.
I then added a <configSections> ... <section name="test"> in a new
app.config (which I added manually to my project). It seems to be able to
read the app.config, but not write back to it. I seem to have a
partial/temporary working config file that is created in the bin\debug
directory called XXX.vshost.exe.config. It seems to temporarily store the
proper values when I save the settings, but seeing that it is rebuilt
dynamically everytime the application is run, I lose all settings. What gets
to me is that the settings are not written to the app.config file. I get no
errors when I execute .Save method. Just no info is written.
Does anyone have an example in VB.NET or a guide/tutorial, etc... In
essence, I want to use my ConfigurationSection derived class to be able to
load and save a custom section in the app.config file as I have seen others
do, but can't get it to work myself. Also, any help on how to properly set
up an app.config file with the <configSections> etc... properties.
Regards,
Giovanni Tag: Support for Postscript fonts Tag: 99713
Data binding a ListBox to a List<T>
I have 2 list boxes on the form. Each listbox is bound to a different
List<T>. My goal is for the user to select an item in ListBox1, click
a button, and have that item moved to ListBox2.
The way I approached this was to have a populated List<T1> bound to
ListBox1. I set the DataSource, DisplayMember, and ValueMember
properties of ListBox1 and the items in the List<T1> were correctly
shown in the listBox. I bound ListBox2 to List<T2>. Since List<T2>
had nothing in it, ListBox2 correctly showed no items.
I thought that if I removed an item from List<T1>, that ListBox1 would
update to reflect that but it doesn't seem to work that way.
Similarly, I thought that by inserting an item into List<T2>, that the
ListBox2 would update to reflect the addition. It does not seem to
work that way.
How can I get the ListBoxes to update and show the current contents of
their respective List<T> objects?
Is there a way to "rebind" them?
Thanks,
Chris Tag: Support for Postscript fonts Tag: 99712
Create something of ContextMenuStripItem type ????
f I can declare a menu item as :
Dim mnuItem As MenuItem
then why cant I declare something of ContextMenuStripItem type.
There is a collection of items for a contextmenustrip.!!
I have a method :
private void NewLoad(object sender, System.EventArgs e)
{
//I need to do something like
MenuItem mn = (MenuItem)sender;
}
In debug when I hover my mouse over "object sender" I get
"[System.Windows.Forms.ContextMenuStrip], Name: contextMenuStrip1, Items: 6}"
I am baffled Tag: Support for Postscript fonts Tag: 99704
Disable ArrowKey
Hello,
I have a datagrid and I would that if I press an arrow key (up and down) the
cursor don't move up and down on the datagrid.
There is a solution for my problem?
I have used keypress and keyup but don't capture the arrow keys.
Only KeyDown capture ArrowUp and ArrowDown but e.Handler = True don't avoid
the event "press arrow key" and the cursor move in the datagrid.
Thank you
Marco Tag: Support for Postscript fonts Tag: 99703
I have some fonts installed on my machine which I think are postscript
format (they are .pfm files), but I can't use these in my windows
application. Any reason why not ?
"JezB" <jezbroadsword@blueyonder.co.uk> schrieb:
>I have some fonts installed on my machine which I think are postscript
> format (they are .pfm files), but I can't use these in my windows
> application. Any reason why not ?
.NET supports fonts in TrueType or OpenType format only.