Dependency between two DataGridViewComboBoxColumn
Hi,
I'm doing a DataGridView with two ComboBox columns. In the first
ComboBox I've all the sates of a country and in the second I've the
counties of each state.
I need to create a dependency between the two ComboBox, in such a way
that in the second ComboBox just appear the counties that belong to the
state selected in the first ComboBox.
To accomplish the task I've been created a TableAdapter which
contains all the counties and a DataView to filter this TableAdapter.
In this way everything work, but when I change the "state" (in the
first ComboBox) to a different value when I move the mouse over the
second ComboBox in a row that has a county that belong to another state
I get the following exception
"System.ArgumentException: DataGridViewComboBoxCell value is not
valid."
I know that the problem arises because the DataView is filtered to some
"state" different than the state that the county belongs to.
Does anybody know how can I fix it?
Maybe there's another way to accomplish the task. I just need to
resolve this.
Thanks,
Robe. Tag: DataGridView Scroll Tag: 99905
[C#] RichTextBox autoscroll after style change
Hi,
I'm working on a RichTextBox with some "in-program" style-features
(e.g. *no way* becomes bold : like MS Word does). Got everything
working fine, flickerfree and reasonable fast, but in order to set the
style of some part of the text I use the "Selection" method (in the
case of *text* the
richTextBox1.SelectionFont.Bold = true
No problem so far, unless there are scrollbars involved. Somehow, when
I type into the RichTextBox (and after the styles are applied) the
current selection position becomes the top row; unless there is no
"scrollbar left" to scroll down to.
I've added a small sample of the code below
[Code]
Cursor = Cursors.WaitCursor;
int origSelStart = richTextBox1.SelectionStart;
int origSelLength = richTextBox1.SelectionLength;
// Freeze control
SendMessage(richTextBox1.Handle, 11, 0, 0);
if (SingleLine)
{
// Only do the appropriate line
ApplyLineStyle(Line);
}
else
{
// Apply style on all lines
for (int i = 0; i < richTextBox1.Lines.GetLength(0); i++)
{
ApplyLineStyle(i, false);
}
}
// Unfreeze control
SendMessage(richTextBox1.Handle, 11, 1, 0);
richTextBox1.Refresh();
// Turn original selection-state back
richTextBox1.SelectionStart = origSelStart;
richTextBox1.SelectionLength = origSelLength;
SingleLine = false;
Cursor = Cursors.Default;
[/Code]
What am I missing, is there a property or method I could use?
TIA,
Leon Tag: DataGridView Scroll Tag: 99902
WebBrowser control and Flash
Hi all
Flash does not respond with the webbrowser control for .net 2.0.
Is there a work around to get flash working?
thanks
Sean Tag: DataGridView Scroll Tag: 99901
Modal app [2.0]
I have written a signature capture mini-app for tablet PCs. The way this
works is that our main application calls this little app with a command line
arg of the jpg name to save the signature to. The app consists entirely of a
single form with an ink gathering control and 2 buttons so the user can
cancel or save the signature.
We need this little signature app to be on top of everything at all times.
The client has specified that the user should not be able to do anything at
all until they have either hit the 'Done' button or the 'Cancel' button.
What's the best way to accomplish this? I can think of a few different ways
to do it, but I'm unsure what the recommended way is. Tag: DataGridView Scroll Tag: 99895
Creating a Windows Forms DLL for usage in Win32 application
Hi,
is it possible to create a DLL including some functions which will
create a Windows Forms Dialog? If this is possible i'd like to know if
i can use this DLL in native ( normal win32 ) applications? If this is
also possible please tell me how this has to be done.
Thanks a lot
Michael Tag: DataGridView Scroll Tag: 99894
win32 in memory
Does anyone have a sample code for this? I want to draw an image in memory
into another image using C# and win32 gdi.. if its confusing i'll rephrase
it. I want to draw many images into one image in memory using win32 gdi
(sample using bitblt or any suggested win32 that works the fastest) since the
.NET gdi is very slow in drawing graphics in my own opinion. I would really
appreciate any help. please any smaple code at all would be very much
approciated. Thank You so much in advace.
Stan Tag: DataGridView Scroll Tag: 99893
datagrid multiple cell selection
Hi All,
I have a datagrid (1.1) which has 5 rows and 3 columns, for example. For
every row, I need to select only one column cell (just like a radiobutton
group) either by clicking the cell or by keyboard space bar press. That
particular cell I would like to highlight too.
So, in the end I should have 5 highlighted cells, one in each row.
Can somebody plz guide me to do this. Many thanks in advance.
FUnky Tag: DataGridView Scroll Tag: 99887
Get object which DataGridView row is bound to
VS 2005 winforms project: I have a DataGridView bound to a list of business
objects. On it's RowEnter event I want to get a reference to the business
object that row of the DataGridView is bound to. How can this be done?
// Persons_BLL obj
// obj is an instance of Persons_BLL
// Here's how Persons_BLL is defined:
// public class Persons_BLL : BindingList<Person_BLL>, IBindingList
this.bindingSource1.DataSource = obj;
this.dgvList.DataSource = this.bindingSource1;
Here's my RowEnter event. Now how can I get a reference to the business
object of Person_BLL for that row 'e'?
private void dgv_RowEnter(object sender, DataGridViewCellEventArgs e)
{
try
{
}
catch (Exception ex)
{
ExceptionHandler.ErrLog(ex);
}
}
Thanks.
--
moondaddy@nospam.nospam Tag: DataGridView Scroll Tag: 99884
Closing a form
I have a windows form (a). On the form there is a search button that causes
another windows form (b) with a datagrid used to display the retrived data
from the SQL database. I would like to close form (a & b) when I select the
requested record. And reopen form (a) and display the selected record. I have
tried 'Owner.Close():'. The code thats used to call the search form (b)
follows:
private void btFind_Click(object sender, System.EventArgs e)
{
oclose = 1; // setup to do a close after the search is complete.
SearchOwner dddd = new SearchOwner(txtSearch.Text);
dddd.Show();
txtSearch.Text = string.Empty; // Clear the search field
}
Can someone give me some help thanks. Tag: DataGridView Scroll Tag: 99874
Data Form Wizard defualtss.
Using VS 2003...
When using the Solutions Explorer, add new item, Data Form Wizard, when it
produces the grid layout of a single record, the form column names are to
long to fit in the default label, so it requires a lot of manual work to get
the form useable. Is there anyway to set the defaults for the Data From
Wizard? For example, change the property of all labels to AutoSize = True
would help alot.
Any ideas?
Bob Day Tag: DataGridView Scroll Tag: 99873
Does a Window have to be visible to receive Messages
I am trying to monitor incoming messages by overriding the
System.windows.form WndProc method. I have a radar device that sends messages
via the Message parameter for the WndProc method. The program i am developing
should be a console application but the radar only sends messages via the
wndproc method, so I am wondering if a window form has to be visible in order
for the messages to be received? I would like to just create an object of my
window class and use the methods I've created to manipulate my messages but
it appears that this won't work or I'm doing something wrong. I would
appreciate any help. Thanks Tag: DataGridView Scroll Tag: 99872
Simple "Browse for a file" control
I apologize that I am new to windows forms programming. I'm looking for the
correct control or components to use to create standard browse-for-a-file
capability. I'd like to have a textbox and a button next to it that says
"Browse". When you click the browse button you would get the standard
windows api dialog that allows you to browse for a particular file. When the
user finds his/her file, they would select it and the textbox would be
populated with their selection.
This is very easy to do with web / html controls, but I've never had to do
it in a windows form unfortunately. I've done a bit of googling and I'm
getting results for a lot of custom / enhanced solutions. I'm looking for a
simple example. If anyone could please provide some direction I'd greatly
appreciate it.
--
PK9 Tag: DataGridView Scroll Tag: 99870
RichTextBox woes
My app needs to load a plaintext file (1 to 15MBs), edit & convert it to
rtf, and finally output it to a RichTextBox (RTB). Simple enough...
Loading a 5MB file (average case for this app) and editing/converting it to
an rtf string takes about 1 second to accomplish...no big deal. However,
doing a "myRTB.Rtf = myRtfString;" takes another 25-30 more seconds!.
That's even after I've hidden the RTB and prevented the underlying RichEdit
control from generating WM_PAINT & other events while I'm updating it (via
SendMessage SET_REDRAW & EM_SETEVENTMASK respectively).
Anyway, I'm out of ideas when it comes to speeding up the RTB since it seems
from my research that slowness is a longstanding problem with the underlying
RichEdit. I should also mention that I don't want to get into partial
loading/editing...I've tried it...it had its own set of issues.
So in light of the above problem...is there a safe way to update the
RTB's.Rtf property from within a thread? My goal now is to:
a) update the RTB in the background thread (if possible) so I don't lost
app responsiveness
b) allow a user to cancel the operation if they choose to do so
TIA!
-sb Tag: DataGridView Scroll Tag: 99866
Email blocked by ISP
Hi gurus,
I need some advises/suggestion.
We are using the following command to send email from the client. Its pretty
simple
Dim MailMessage As New System.Net.Mail.MailMessage(strFrom, strTo)
MailMessage..
MailMessage..
Dim client As New System.Net.Mail.SmtpClient("host")
client.Send(MailMessage)
It works on most of the systems.
But some systems it got blocked by ISP, so system is not able to send
emails.
We are planning to change the process and use web service to send e-mail.
My question is, is it good idea to overcome this problem. Or there is any
other way to send email using SMTP.
Please advise me.
Thanks, Steve Tag: DataGridView Scroll Tag: 99862
Window size control
I wish to have a window whose width can be resized but not its height.
I tried this:
this.MaximumSize = new System.Drawing.Size(0, 300);
this.MinimumSize = new System.Drawing.Size(0, 300);
which according to the documentation on MaximumSize and MinimumSize should
accomplish what I want. The 0's are supposed to mean that only the system
limits
apply.
What is occurring is that the form appears with minimal width, the correct
height
and the form is not resizable in any direction.
Can anyone clear this up for me?
Regards
Chris Saunders Tag: DataGridView Scroll Tag: 99856
ContextMenuStrip showing only after second right mose click
Hello!
I upgraded my legacy .NET 1.1 application to .NET new ToolStrip
controls and everything seems to work OK except some wierd
ContextMenuStrip behaviour.
ContextMenuStrip is bound to several controls on the Form (Form
itselfs, TabControl, DataGrids inside tabs) and in
ContextMenuStrip.Opening event all ToolStripMenuItems are created and
added to the ContextMenuStrip (they are removed and disposed after
use). But the strange thing is that when user clicks the right mose
button for the first time during process lifespan context menu does not
show up. ContextMenuStrip.Opening event is raised, items are created
and added (I checked it with tracing) and menu is not shown. The very
same event raised second time shows context menu.
Now I have changed initial context menu content (it was empty at the
start by design) by adding single dummy ToolStripMenuItem during
initialization which obviosuly is removed and destroyed and everything
works fine.
I do consider this kind of behaviour being a bug - can somone from MSFT
comment on this.
Cheers
http://sourceforge.net/projects/ngmp Tag: DataGridView Scroll Tag: 99855
One click deployment and plugins
I have a windows app which is distributed using click once deployment.
This works great but I now face a dilemma.
I have just developed a plugin for my application which I would like the
parent application to consume/invoke using reflection.
Is there any way I can force these plugins to download with the main
application assembly ?
The whole idea of developing plugins is to be able to drop my plugins into
the bin folder and hey presto......it works but I just cant figure out how to
deploy them. Tag: DataGridView Scroll Tag: 99854
Dashed Line
Trying to draw a dashed line within a User Control I get error:
Changes cannot be made to Pen because permissions are not valid
Why is this ??
Pen dashed = Pens.DarkGray;
dashed.DashStyle = System.Drawing.Drawing2D.DashStyle.Dash;
g.DrawLine(dashed, 0, 100, 200, 100); Tag: DataGridView Scroll Tag: 99852
Help with Menu Item, MDI app
Hi Everybody
I want to add to my "File" menu the "Recent Files" list in Visual C# 2003.
Hope you can help me.
thanks Tag: DataGridView Scroll Tag: 99851
Combo box clearing
Hi,
I have combo Box clearing when form overlaps...Can't seem to catch the
event.
Why is it doing this? Tag: DataGridView Scroll Tag: 99849
Support for Postscript fonts
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 ? Tag: DataGridView Scroll Tag: 99847
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: DataGridView Scroll 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: DataGridView Scroll 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: DataGridView Scroll 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: DataGridView Scroll 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: DataGridView Scroll 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: DataGridView Scroll 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: DataGridView Scroll 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: DataGridView Scroll 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: DataGridView Scroll 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: DataGridView Scroll 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: DataGridView Scroll 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: DataGridView Scroll 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: DataGridView Scroll 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: DataGridView Scroll 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: DataGridView Scroll 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: DataGridView Scroll 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: DataGridView Scroll 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: DataGridView Scroll 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: DataGridView Scroll 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: DataGridView Scroll 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: DataGridView Scroll 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: DataGridView Scroll 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: DataGridView Scroll 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: DataGridView Scroll 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: DataGridView Scroll 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: DataGridView Scroll 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: DataGridView Scroll 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: DataGridView Scroll Tag: 99760
I need to scroll to a specific row and then freeze the view at that point.
Does anyone know how to do this??