Sample from MSDN on <ApplicationSettingsBase Class> has a Resize
Hello,
I have a problem with the sample from the following article:
http://msdn2.microsoft.com/en-us/library/system.configuration.applicationsettingsbase.aspx
When the form is resized from the left side, or top, it will change the
location to the point where it was resized to and keep the original size.
I am assuming that this is not the default behavior in this case.
Is there a workaround?
Thanks.
Regards,
Genadij. Tag: ProfessionalColors class cheat sheet Tag: 95188
Disable Sorting in VB.NET
I thought the only thing I had to do to disable column sorting in
VB.NET was to set datagrid.AllowSorting = False. Unfortunately this
has never worked for me. I discovered another set of code that seems
to work for 99% of the cases where I need to disable datagrid column
sorting:
Private Sub datagrid_MouseDown(ByVal sender As Object, ByVal e As
System.Windows.Forms.MouseEventArgs) Handles datagrid.MouseDown
Dim pt As New Point(e.X, e.Y)
Dim hti As DataGrid.HitTestInfo = dgACE.HitTest(pt)
If hti.Type <> DataGrid.HitTestType.ColumnHeader Then
MyBase.OnMouseDown(e)
End If
End Sub
However, this code does not work when my datagrid resides on a user
control. The datagrid_MouseDown event is triggered but sorting still
occurs for the column. It's critical that I disable sorting in the
datagrid due to the other things I am trying to do with the datagrid.
I'm about ready to pull my hair out trying to figure this one out so
any suggestions on how to resolve this issue would be greatly
appreciated!
Thank you!
Joy Tag: ProfessionalColors class cheat sheet Tag: 95186
FlowLayoutPanel - Move Control (.NET 2.0)
Is there a way of changing the position of a control in a FlowLayoutPanel?
The only ways I can see is by systematically calling BringToFront on each
control in the right order or by pulling all the control out and ading them
back again in the correct order. Both these ways seem to me to be kludges.
TIA Tag: ProfessionalColors class cheat sheet Tag: 95185
How to combine AutoScroll and virtual content scroll
I am a .NET newbie and started working on al user control, where one scroll
dimension -- say horizontal -- moves the contained controls (like AutoScroll)
and the other dimension leaves the controls sticky and updates the virtual
content of the contained controls -- lets say some text boxes -- with .NET
2.0.
I tried to use AutoScroll by setting
ScrollableControl.AutoScrollMinSize.Height to the virtual content size and
updating the content of my text boxes by using a Scroll event handler. But
this also moved my text boxes vertically and I was not able to reset their
location without introducing flickering. Question: Is there a way to make
some contained controls remain sticky or is there a way to make to movement
of the controls invisible?
My second approach was to use manual scrolling. Besides that this approach
introduces a lot more code and I had to do the layout manually, it introduced
flickering of the scroll bars when resizing. I assume that this is introduced
by the timig of layouting and control-repainting. With my first approach by
using AutoScroll there was no flickering when resizing the control. Question:
Is there a flicker save way to do layouting and painting of contained
controls.
Thanks in advance for any hints. But I want to do it purely using platform
independent .NET code, so overriding WndProc or using P-Invoke is not an
option for me. Tag: ProfessionalColors class cheat sheet Tag: 95183
Fonts and Labels in a Windows Form Messed Up?
I'm converting a .NET 2.0 Beta project to the final version using Visual
Studio. In doing so, I've come across a strange problem with the fonts in my
labels. To see the problem, I have an empty form with 2 labels, one "Timing
Details:" and one "Package Details:" - each one Bolded. When viewing the
form in design mode within Visual Studio, everything looks good - as
expected. But when I run the form, the word "Details" in each of the two
labels looks different. The second one looks scrunched up.
Here's the guts of my form code - nothing out of the ordinary as far as I
can tell:
partial class Form1 {
private void InitializeComponent() {
this.packageDetailsGroupLabel = new System.Windows.Forms.Label();
this.timeDetailsGroupLabel = new System.Windows.Forms.Label();
this.SuspendLayout();
//
// packageDetailsGroupLabel
//
this.packageDetailsGroupLabel.Font = new System.Drawing.Font("Microsoft
Sans Serif", 8.25F, System.Drawing.FontStyle.Bold,
System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.packageDetailsGroupLabel.Location = new System.Drawing.Point(12,
47);
this.packageDetailsGroupLabel.Name = "packageDetailsGroupLabel";
this.packageDetailsGroupLabel.Size = new System.Drawing.Size(163, 13);
this.packageDetailsGroupLabel.TabIndex = 22;
this.packageDetailsGroupLabel.Text = "Package Details:";
//
// timeDetailsGroupLabel
//
this.timeDetailsGroupLabel.Font = new System.Drawing.Font("Microsoft Sans
Serif", 8.25F, System.Drawing.FontStyle.Bold,
System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.timeDetailsGroupLabel.Location = new System.Drawing.Point(12, 9);
this.timeDetailsGroupLabel.Name = "timeDetailsGroupLabel";
this.timeDetailsGroupLabel.Size = new System.Drawing.Size(163, 13);
this.timeDetailsGroupLabel.TabIndex = 21;
this.timeDetailsGroupLabel.Text = "Timing Details:";
//
// Form1
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(220, 79);
this.Controls.Add(this.packageDetailsGroupLabel);
this.Controls.Add(this.timeDetailsGroupLabel);
this.Name = "Form1";
this.Text = "Form1";
this.Load += new System.EventHandler(this.Form1_Load);
this.ResumeLayout(false);
}
private System.Windows.Forms.Label packageDetailsGroupLabel;
private System.Windows.Forms.Label timeDetailsGroupLabel;
}
If you have any ideas, or would like to see a screenshot of what I'm talking
about, please let me know.
Thanks,
Chris Tag: ProfessionalColors class cheat sheet Tag: 95181
Listen event on different thread and update data on UI thread
Hi,
I have a class in which I am receiving a event continuously at a great
speed. I need to listen to that event and show it on the grid in the GUI.
The problem is that the event is very very fast.
How can I listen to this event in a separate thread. Then take the data and
put it in the DataTable. I can send this DataTable back to the GUI thread
where I have a windows form on which I have applied the grid control. Please
let me know if I am not clear.
Please help.
Regards,
Rajat. Tag: ProfessionalColors class cheat sheet Tag: 95179
Form and a MCppCodeDomParser error:
Hello. Every time I try and change the design or layout of the form I
receive this error.
MCppCodeDomParser error:
However, the code will compile and run fine.
Any ideas?
--
www.integrated-dev-sol.co.uk
Remove 123 from email address to reply.
Anti spam and virus measure. Tag: ProfessionalColors class cheat sheet Tag: 95177
Visual Studio macro running as a STA thread
Dear All,
We have written a small set of dlls that contain some WinForms...we
lauch these forms in Visual Studio using a macro. By default the macro
thread is a MTA thread. Are there any issues if we make this thread an
STA thread?
I need this as an STA thread as the user wants to copy some elements
from the grid in the clipboard. I don't want to create a separate STA
thread for the copy functionality.
Why is the macro thread an MTA thread? Is MS planning to change it back
to STA thread?
Please help
Thanks in advance...
Many regards
Jack Tag: ProfessionalColors class cheat sheet Tag: 95171
Is IMessageFilter only for .net windows?
Hi;
(I am trying to figure out the best way to intercept Word's message pump in
a .net app.) It looks like an IMessageFilter object can only be attached to
the message pum of a .net Application so it could not be used with Word. Is
this correct?
--
thanks - dave Tag: ProfessionalColors class cheat sheet Tag: 95163
NativeWindow.ReleaseHandle
Hi;
I want to use NativeWindow to wrap the hwnd of Word (which is already
running and so the window exists). I need to release the handle and dispose
my NativeWindow object when the window goes away.
As Word is not a .net app, it does not have .net windows and therefore I
can't have it call an event. Do I just watch for the WM_DESTROY message in
the message pump?
--
thanks - dave Tag: ProfessionalColors class cheat sheet Tag: 95162
Where is MyNativeWindowListener and MyNativeWindow?
Hi;
The VS 2005 documentation (release) for the NativeWindow class discusses the
samples MyNativeWindowListener & MyNativeWindow. But I cannot find the actual
samples anywhere. Where are they?
--
thanks - dave Tag: ProfessionalColors class cheat sheet Tag: 95161
Take over screen.
I need to write an app where I use the entire screen. This includes getting
rid of the task bar. How do I do that?
TIA - Jeff. Tag: ProfessionalColors class cheat sheet Tag: 95154
Databound ListBox Won't Update on Clear?
I have a ListBox control bound to an ArrayList:
m_expressionFilters = New ArrayList
m_expressionBindingManager = BindingContext(m_expressionFilters)
lstboxFilters.DataSource = m_expressionFilters
When I add an Item to the ArrayList, that change is immediately reflected in
the ListBox:
m_expressionBindingManager.SuspendBinding()
m_expressionFilters.Add(CurrentFilter)
m_expressionBindingManager.ResumeBinding()
However, when I call the Clear method of the ArrayList, the changes are not
reflected in the ListBox:
m_expressionBindingManager.SuspendBinding()
m_expressionFilters.Clear()
m_expressionBindingManager.ResumeBinding()
At this point, the m_expressionFilters ArrayList has a Count of zero, but
the Items formerly held in the ArrayList are still listed on the form in the
ListBox. I have tried calling the Refresh and Update methods on the
ListBox, but that produced no visible changes at all.
Any help or advice would be greatly appreciated.
Carl Tag: ProfessionalColors class cheat sheet Tag: 95151
crystal integration
Using v1.1 of the .Net Framework, I added a Crystal Report item to my
solution as an embedded resource. My problem is that when I drop a
ReportDocument component onto my form, the window that prompts me to select
a typed reportDocument does not include in its drop-down the embedded report
that I added, and so I can't integrate the report into the form thru the
crystalReportViewer. Any idea why I wouldn't see the report show up in the
drop-down?
Thanks! Tag: ProfessionalColors class cheat sheet Tag: 95147
Handling System Shutdown in a WindowsForms App
Hi. I have an application that runs as a Tray Icon app with no visible window
(most of the time) and right now, the system will not shut down while that
app is running. I think I need to handle "SystemEvents.SessionEnded" or
something to properly deal with that but I don't understand how, inside the
code for my Main Form for the application, I set up a handler for the event
and then what I actually DO with the event once it comes (though I assume I
just do whatever I would normally do to exit my application grcefully).
Can someone help me with a sample?
Alex Tag: ProfessionalColors class cheat sheet Tag: 95141
Detect any kind of activity in a window.
I need to write a function so if the user doesn't do anything in 15 minutes,
it will log them out. I've got the timer set up fine I'm just looking for an
easy way to detect people doing anything. What's the easiest way to do it?
It looks like it may be mousemove on the windows. Is this reasonable?
TIA - Jeff. Tag: ProfessionalColors class cheat sheet Tag: 95140
ListView.tag lost object
Hi,
I have a Form with two ListViews; The ListViews are diplayed on the
Design surface, but I progmatically adding the items to each ListView.
When adding the items to the list view I am iterating through and
setting the following:
...
With myListViewItem
.Text = drArticles("Title").ToString
.ToolTipText = drArticles("Summary").tostring
.Tag = CType(drArticles("ID"),Guid)
End With
myListView.Items.Add
...
This works fine and the items are displayed.
The problem arises when I respond to a SelectedIndexChanged event I can
retrieve the .ToolTipText and .Text values from then
SelectedListViewItemCollection but the .tag property is always empty (it
knows the object type is GUID but does not have the value. I know the
value is being set as I can set the ToolTipText to same ID as the TAG
and it is stored correctly.
Any ideas?
Many thanks in advance Tag: ProfessionalColors class cheat sheet Tag: 95138
ListView.tag loast object
Hi,
I have a Form with two ListViews; The ListViews are diplayed on the
Design surface, but I progmatically adding the items to each ListView.
When adding the items to the list view I am iterating through and
setting the following:
...
With myListViewItem
.Text = drArticles("Title").ToString
.ToolTipText = drArticles("Summary").tostring
.Tag = CType(drArticles("ID"),Guid)
End With
myListView.Items.Add
...
This works fine and the items are displayed.
The problem arises when I respond to a SelectedIndexChanged event I can
retrieve the .ToolTipText and .Text values from then
SelectedListViewItemCollection but the .tag property is always empty (it
knows the object type is GUID but does not have the value. I know the
value is being set as I can set the ToolTipText to same ID as the TAG
and it is stored correctly.
Any ideas?
Many thanks in advance Tag: ProfessionalColors class cheat sheet Tag: 95137
Close all windows in a VB.Net program
I've got a VB.Net program where under a condition I want to close all of my
windows (logging out the user due to inactivity). Is there a way to close
all of the currently open windows without going through each one to check if
it exists?
TIA - Jeff. Tag: ProfessionalColors class cheat sheet Tag: 95136
General Windows Forms and Memory Question
I am seeing an interesting memory issue with a winform in my application.
I've noticed everytime I show a form in my application, the memory usage
increases. When I close the form, the memory isn't released. The only time
the memory is released is when I "minimize" the application. Eventually,
overtime, my application consumes a good amount of memory.
Has anyone experienced this?
Thanks,
Yosh Tag: ProfessionalColors class cheat sheet Tag: 95135
ClickOnce returns XML instead of starting application
Hi
I just deployed a ClickOnce Application to a Windows 2000 Server, which only
has .NET 1.1 installed.
When I launch the application via the auto generated html page I get the
.Application XML back. I was expecting the application to launch.
If I deploy the same SmartClient to my local XP machine with .NET 2.0, the
applications installs and starts just fine.
Am I missing something? Do I need to install .NET 2.0 on the Windows 2000
server, or do I need to register some MIME types on the server? If so, could
you please provide a link (I can't find anything in the documentation... but
I found place that said that I should be able to deploy to any HTTP 1.1
compliant web server).
Please help.
Thomas Tag: ProfessionalColors class cheat sheet Tag: 95132
.NET 2.0: ToolStripTextBox with Caption?
In a Winforms 2.0 application, I have a StatusStrip which hosts a
ToolStripDownDown item to display a small menu. The menu consists of
two checkable menu items and one ToolStripTextBox . Now I want to
display a simple caption on the left of the textbox. I cannot seem to
find an easy possiblity to do this, altough this seems a very common
scenario to me. After all, which programmer wants to just display a
textbox without any caption? Can somebody help me? Do I really have to
bake my own control inherited from ToolStripControlHost just for this?
Thanks for any help
Urs Eichmann Tag: ProfessionalColors class cheat sheet Tag: 95129
propertygrid hosting in IE
I am not able to get properties in propertygrid with custom TypeConverter
working properly when hosted in Internet Explorer. Please help Tag: ProfessionalColors class cheat sheet Tag: 95128
TabControl.OnDrawItem
Hello ppl!
I am manually drawing tab items in a TabControl by using a handler attached
to the DrawItem event on such control. I am using rectangles inside the
Item's region
for the background and drawing strings for text using the graphics object
provided in the DrawItemEventArgs. I al also painting the aread just to the
right of the last tab with another rectangle in the same DrawItem event.
The form runs just fine and I can see the tabs asd intended on the initial
load. However, as I move the form to either the left or right just beyond
the screen, my painted rectangle simply dissapears or gets smeared. If the
form is moved beyog the screen's upper or lower boundaries the rectangle gets
painted again. This also happens if another window is on top of the
tabcontrol. I tried timers for refreshing the control and the form. Tried
also a refresh on the form on a Move event and managed to eliminate the
problem is the form moves beyond the right screen boundary but still the
same problem on the left boundary. Anyway I can work around this?
Thanks in advance
sampe code of the event handler:
private void tabControl1_DrawItem(object sender,
System.Windows.Forms.DrawItemEventArgs e)
{
Graphics g = e.Graphics;
int lastTabIndex = this.tabControl1.TabPages.Count-1;
System.Drawing.StringFormat textFormat = new StringFormat();
textFormat.Alignment = StringAlignment.Center;
textFormat.LineAlignment = StringAlignment.Center;
textFormat.Trimming = StringTrimming.None;
textFormat.FormatFlags = StringFormatFlags.NoWrap;
Rectangle tabRect = this.tabControl1.GetTabRect(e.Index);
Rectangle lastTabRect = this.tabControl1.GetTabRect(lastTabIndex);
//filler rectangle beyond last tab
g.FillRectangle(new SolidBrush(Color.Blue), lastTabRect.Right,
lastTabRect.Top, this.tabControl1.DisplayRectangle.Width,
lastTabRect.Height);
//tab Item background
g.FillRectangle(new SolidBrush(Color.Red), tabRect);
//Item text
g.DrawString(this.tabControl1.TabPages[e.Index].Text,
e.Font,
new SolidBrush(Color.White),
tabRect,
textFormat);
} Tag: ProfessionalColors class cheat sheet Tag: 95127
Splashscreen disappears
I added a Splashscreen to my Windows Forms project.
I specified it in Project - Application Tab - Splash screen.
When I launch the project the splash screen turns up, which is fine.
BUT then a NullReferenceException is thrown!
I turned on "Break when an Exception is thrown" but it will not stop on a
code line that is visible to me.
My application uses a frmMain as start form.
The frmMain code is enclosed by a Namespace.
When I enclosed the SplashScreen code in the same Namespace and modified
Project - Application Tab - Splash screen to point out the new full name,
then the problem disappears, but so does the SplashScreen .......!
As far as I can see there are no more settings I should have set to get it
working. Tag: ProfessionalColors class cheat sheet Tag: 95126
Control to graphically connect listviews (or treeviews)
Hello.
I'm lookin for a way to have two listboxes whose some elements can be
connected graphically by an arrow. The arrows should 'move' as the listboxes
scroll, 'following' the elements they are attached to.
It should be similar to the relations fields in graphic
representation of SQL queries (as in Visual Studio's Query Designer)
I'd like to have a similar effect with two treeviews (whose element can
connected by arrows, as in Biztalk Mapper)
Does anyone know if there is a third party control that allow this?
Thank you. Tag: ProfessionalColors class cheat sheet Tag: 95125
Smart Client Offline Application Block in .NET 2.0?
Hi,
Couple of questions:
1. Does anyone know whether Microsoft have plans to redevelop the SCOAB for
.NET 2.0?
2. Has anyone had experience using the existing release of SCOAB with .NET
2.0?
We have recompiled the block in 2.0, and there are lots of warnings and a
couple of compile errors (to do with Win32 calls using unsafe code within
the caching component) in the release build.
Thanks,
Chris Tag: ProfessionalColors class cheat sheet Tag: 95124
Run Time Controls
hi,
I'm adding 5 Text box controls during runtime in my windows application. I'm
adding those in a for loop.
But i got only one text box as result in my form.
Why like this? And what i have to do for displaying all 5 text boxes?
Regards,
Gomathi Tag: ProfessionalColors class cheat sheet Tag: 95117
guide to design a custom/ flashy windows application
I did developed a windows application which mainly does the function of
displaying data and updating the data changed by the user using visual
studio.net 2003
Now I want to improve the look and feel of the user interface of the
application. I tried embedding some pictures onto the forms and then
making the labels to have transperent color. But this change throwed an
'Invalid Value' error.
Any suggestions for my issue resolving or regarding the development of
user interface is greatly appreciated.
Thanks in advance
arun Tag: ProfessionalColors class cheat sheet Tag: 95108
Serializing/Deserializing from a Modal UI Editor
I created a control that I derived from Windows Forms Control. I added one
string property, which is the name of a file. This property is a Modal UI
Editor property for which I provided a form named ShapeEditor. When the user
presses the ellipsis in the Properties window of the control in the IDE,
ShapeEditor is displayed and enables the user to draw shapes. The shape
objects are collected in an ArrayList and then serialized to a file using a
BinaryFormatter as follows.
FileStream sw = new FileStream(ShapesFileName, FileMode.Create);
ArrayList Shapes = new ArrayList();
// Create shapes and populate Shapes.
....
Shapes.Add(ShapeObject);
.....
// Then serialize
bf.Serialize(sw, Shapes);
// Deserialization is the reverse:
Shapes = new ArrayList();
sr = new FileStream(ShapesFileName, FileMode.Open);
BinaryFormatter bf = new BinaryFormatter();
Shapes = (ArrayList)bf.Deserialize(sr);
// Use objects
foreach (ShapeObject s in Shapes)
Here is the problem.
When I invoke ShapeEditor from the properties window
foreach (ShapeObject s in Shapes)
fails with an invalid cast exception even though Shapes[0].GetType() returns
a ShapeObject.
However, if I invoke ShapeEditor from a running program, everything works
fine(the same code is executed). It is as if the IDE is somehow interferring
with the deserialization.
Any help greatly appreciated. Tag: ProfessionalColors class cheat sheet Tag: 95107
Custom Control ClipRegion Question
In a few of my custom controls, I need to ensure that when the control goes
from a partially obscured state to a fully exposed state, that the entire
ClientRectangle control is re-rendered, rather than just the portion that
was exposed. This seems like a simple thing, yet my simple mind hasn't come
up with a solution that works in all cases...
I've tried Graphics.SetClip, btw, and it didn't do anything. Perhaps I
haven't interpreted the black box correctly...
Any ideas appreciated... Tag: ProfessionalColors class cheat sheet Tag: 95106
BindingSource vs. old binding
I'm getting myself confused about the new BindingSource. In the old days I'd
bind a combobox like this to show the "productName" field:
DataSet ds = getDS();
cboX.DataSource = ds.Tables["Products"];
cboX.ValueMember = "productID";
cboX.DisplayMember = "productName";
Now I guess I can do this:
BindingSource bs = new BindingSource(getDS(), "Products");
which sets the bs.DataSource and the bs.DataMember (ie the table within the
dataset).
But, how do I tell it what field to display when the table has multiple
fields? There is no longer any DisplayMember or ValueMember property. Tag: ProfessionalColors class cheat sheet Tag: 95105
Problem changing the size property in the Resize event
I am trying to preserve the aspect ratio of a form when it is resized. To
simplify the problem, I'm starting with a square form, and trying to keep it
square when either the width or height is changed. My code is based on the
example found in MSDN, July 2005, for the Control.Resize Event.
Here is the relevant code:
public class Form1 : System.Windows.Forms.Form
{
private Size _previousSize;
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.Container components = null;
public Form1()
{
//
// Required for Windows Form Designer support
//
InitializeComponent();
//
// TODO: Add any constructor code after InitializeComponent call
//
_previousSize = this.Size;
}
private void Form1_Resize(object sender, System.EventArgs e)
{
Control control = (Control) sender;
System.Console.WriteLine(
"Height={0}\tWidth={1}",
control.Size.Height, control.Size.Width);
Size newSize;
// Ensure the Form remains square (Height = Width).
if (control.Size.Height != _previousSize.Height)
{
System.Console.WriteLine(
"Height changed: oldSize={0}", _previousSize.ToString());
newSize = new Size(control.Size.Height, control.Size.Height);
System.Console.WriteLine("newSize={0}\n", newSize.ToString());
_previousSize = newSize; // save new value for previous size
control.Size = newSize;
}
else if (control.Size.Width != _previousSize.Width)
{
System.Console.WriteLine(
"Width changed: oldSize={0}", _previousSize.ToString());
newSize = new Size(control.Size.Width, control.Size.Width);
System.Console.WriteLine("newSize={0}\n", newSize.ToString());
_previousSize = newSize; // save new value for previous size
control.Size = newSize;
}
}
}
My code writes some debugging data to the console.
Here is the debugging data that is produced when I execute the Size command
from the control menu of my form, and press the right arrow key three times.
Height=300 Width=311
Width changed: oldSize={Width=300, Height=300}
newSize={Width=311, Height=311}
Height=311 Width=311
Height=300 Width=322
Height changed: oldSize={Width=311, Height=311}
newSize={Width=300, Height=300}
Height=300 Width=300
The first press of the right arrow key just starts the resize operation. On
the second press of the key, the code changes the Height from 300 to 311.
But on the third press of the key, the Height has changed back to 300 on
entry to the Resize event. That is the problem.
On the screen, the form alternates between increased sizes and its original
size.
Does anyone know what's causing this problem? Tag: ProfessionalColors class cheat sheet Tag: 95104
Problems with Fonts in Visual Studio .NET
I am trying to build a Windows applications with some special fonts (DIN).
However, after installing the fonts, the fonts appear in almost all editors
except Visual Studio .NET. Infact, the font even appears in the dropdown
list box to select a font in the Tools | Options | Environment | Fonts and
Colors dialog box... but for some reason, I cant use it in building
applications... I dont see the the font listed in the drop down for Labels,
Button Names, Form Names and such.
Any help would be greatly appreciated.
Thanks. Tag: ProfessionalColors class cheat sheet Tag: 95100
Custom message window
Hello,
I want to make a custom message window on my app, I want to fit my window
size to the number of lines on my string message. How can I do that? some
place with FAQs about. Tag: ProfessionalColors class cheat sheet Tag: 95095
Create an object surface using GDI+
Hi,
I'm trying to create an object surface (much like PowerPoint's, but for
easier things) using GDI+. I mantain a record of the objects, and their
properties, so as of now I'm able to paint the items in the Graphics object.
However, I also need to make some work with this objects. The first one
is to know, when the user clicks somewhere, in which of the items he or
she has clicked. As first, I was trying to use Rectangle methods, but my
items can be rotated, so it doesn't work very well.
Second, I need to move the items, so I don't know how to do it well. For
example, an user clicks on an item, a popup menu shows, and selects
rotate. The actual results must be shown on the screen until the user
accepts the changes.
Is there any tutorial / information / help available for waht I'm
looking for?
Thanks in advance Tag: ProfessionalColors class cheat sheet Tag: 95089
Treeview Question
I realize now that I most likely should have programmatically created my
(many nodes) treeview instead of using the designer to add nodes.
It was more convenient, but since each double-click of an item outputs
different information, I really need to go back and forth between the name
of each node and the output sub's Select Case statement - -
That being said, - now I'm at a crossing point - -
So - now I need to change over so that the entire tree is built
programmatically in the form's load event.
Is there any way to export all the nodes created in the Designer, so that
they can be easily converted to a programmatic building of the treeview? Tag: ProfessionalColors class cheat sheet Tag: 95085
multiselect print documents word VBA6
I have populated a list box which has been activated for multiselect. The
list box has approx 15 names within it that corrospond with documents. I wish
the user to be able to make mutiple selections and the corrosponding
documents to be printed. However failing dismally at getting the right code.
Could anyone possibly help please Tag: ProfessionalColors class cheat sheet Tag: 95083
CheckedListBox displaying duplicated items(V2.0)
I have a CheckedListBox, I add an item with .Items.Add() and get two entries
displayed. If I try to select the second one I get a null reference error.
(It's sorted, but unsorted has the same problem.)
Am I doing something wrong?
.net 2.0, WinXP Pro Tag: ProfessionalColors class cheat sheet Tag: 95080
can messagebox be used in object not derived from winforms
Can I actually use a messagebox within my own class which is not derived from
Forms?
Thanks,
--
---He who will not economize will have to agonize. ----- Tag: ProfessionalColors class cheat sheet Tag: 95079
DatagridView, Data Binding, New Row
Hi!
I have this scenario: I have a windows form. I have a DataGridView Control
which is bound to a DataSource. Under the DataGridView I have texboxes which
represent each one of the columns in the Datasource (also shown in the
datagridview)
As I move from row to row, the values of the textboxes (which are also bound
to the datasource) change according to the value of each column of such row.
That is perfectly normal.
I have set the DataGridview not to allow user to add edit or delete rows so
they must press a button to "Add New Row".
How do I move (Or select) the row pointer to the New row (last row) such
that the bound Textboxes point to the new row (showing empty values of
course). In this way the user can type any value into the texboxes and
therefore update the new row.
Thanks!
--
I love .NET! Tag: ProfessionalColors class cheat sheet Tag: 95078
How to bring a foreign window to top?
Hi,
from a dotnet winform application I start a process which is a Windows
application. I want the window to stay visible even if the user clicks on the
winform window.
I tried to call BringWindowToTop:
[DllImport("user32.dll")]
public static extern Boolean BringWindowToTop(IntPtr hWnd);
IntPtr hWnd=process.MainWindowHandle;
bool bResult=de.itools.util.Win32.ApiCalls.BringWindowToTop(hWnd);
where process is the System.Diagnostics.Process which was startet before. I
get true as result, but the window does not come to foreground.
As this doesn't work I tried with other window handles:
IntPtr hWnd=process.Handle;
or
IntPtr hWnd=de.itools.util.Win32.ApiCalls.GetTopWindow(
process.MainWindowHandle);
or
IntPtr hWnd=de.itools.util.Win32.ApiCalls.GetTopWindow(
process.Handle);
but with no success. It seems all these calls dont affect the window at all.
TIA
Frank Tag: ProfessionalColors class cheat sheet Tag: 95077
overflowbutton@toolstrip
Dear all,
I have in C# 2.0-Application of me insert a toolstrip-Menu, something comes
to a overflow, and a overflow-button is displayed. Because I have custimize
the toolstrip-menu, I will custimize the overflow-button too.
I custimize the overflow-button with the command
this.toolStrip1.OverflowButton.ShowDropDownArrow = true;
this.toolStrip1.OverflowButton.Text = "More >>";
this.toolStrip1.OverflowButton.ToolTipText = "MORE >>";
this.toolStrip1.OverflowButton.DisplayStyle =
ToolStripItemDisplayStyle.ImageAndText;
this.toolStrip1.OverflowButton.Font = new System.Drawing.Font("Arial",
11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point,
((byte)(0)));
this.toolStrip1.OverflowButton.Enabled = true;
this.toolStrip1.OverflowButton.Visible = true;
this.toolStrip1.OverflowButton.BackColor =
System.Drawing.Color.CornflowerBlue;
....
And when I run the Application, the will displayed in the "normally" Style.
Why? Can you help me?
Another global settings:
OS: Win XP
Windows Style: Classic and the XP-Style
Tool-Strip-Render Mode: System
Best regards
stift Tag: ProfessionalColors class cheat sheet Tag: 95074
howt use global variable like functionality in vb.net?
hi ..
im kind'f new to vb.net ..
how do i make use of a global variable like functionality into my vb.net
application
for the purpose of user management ?
i just found this document
http://dotnet.mvps.org/dotnet/faqs/?id=accessmainform&lang=en ... using
which i can read the main forms content but what if i want to set\change
certain values of the main form?
--
Renjith Chembakarayil Tag: ProfessionalColors class cheat sheet Tag: 95073
Using listbox multiselect option
Please Help, Im using word VBA 6 I belive. I have populated a list box with
approx 15 document names. I wish the user to be able to multiselect the
documents, then press a command button to print out the various selected
documents. However having real problems getting even close to the right code.
Can anyone help Tag: ProfessionalColors class cheat sheet Tag: 95072
Multiselect list box to print out mutiple documents
I have a populated list box (20 items) all documents names. I wish the user
to be able to multiselect the documents, press a command button and have all
the selected documents print. However Im having real problems with how to
write the code for this, can anyone help please Tag: ProfessionalColors class cheat sheet Tag: 95070
How to Cancel all Databindings
I have databound an object to some controls in a edit-form. I would like to
allow the user to cancel all the changes made by pressing "Cancel" button or
confirming the changes by pressing "OK". I rather don't want to manually
transfer the properties from a cloned object ... is there a way of doing
this nice and tidy the .net way?
/Andreas Zita Tag: ProfessionalColors class cheat sheet Tag: 95068
datagrid Vs gridcontrol
Normally, I use datagrid in my applications. Since, I have Xceed controls,
I've replaced the datagrid with gridcontrol (from Xceed components).
But at the run time, the previous datagrid is visible, instead of replaced
gridcontrol....can 'YOU' help me?
Thanks in advance....
davidsnoah@yahoo.com Tag: ProfessionalColors class cheat sheet Tag: 95064
Firing an event whenever a control is added
Is there an event which fires whenever a control is added to a
ControlCollection? There doesn't seem to be, but I'm wondering if
there's a kludge anyone's come up with to spot whenever a control is
added?
Cheers,
Andy D Tag: ProfessionalColors class cheat sheet Tag: 95063
I'm looking for a visual cheat sheet for using the ProfessionalColors
class with the 2.0 framework controls.