|
Hi,
I'm working with c# in pocket pcs and i have to send and receive some data from a pocket pc (rz1710) to a palm (zire 31). Has anyone faced a problem like this? Can anyone help me giving some tip ? Any help will be welcomed :}
Thanks in advance
Wiler Coelho
|
|
|
|
|
As a continuation of this thread on transparent panels, I've come to an interesting dilema. I'm interested in having a browser window with overlaying transparent panels. The trouble I'm finding is in finding and utilizing a way to Invalidate the browser window such that it's child controls (the panels) will act 'transparent' and draw the browser contents on their background...similar to the OnPaint and OnPaintBackground events. There is sample code at the link above for a basic project example I've put together. I'll include it below just in case. You will, however, have to re-add the resouces Microsoft.mshtml & the AxSHDocVx components (probably on your toolbox with the Add Components option) If anyone has some thoughts or suggestions I would greatly appreciate it! I basically just want a way to 'draw boxes on top of' a web browser. Thanks again!
~rcurrie
using System;<br />
using System.Drawing;<br />
using System.Collections;<br />
using System.ComponentModel;<br />
using System.Windows.Forms;<br />
using System.Data;<br />
using mshtml;<br />
<br />
namespace WindowsApplication3<br />
{<br />
public class Form1 : System.Windows.Forms.Form<br />
{<br />
private System.Windows.Forms.Label label3;<br />
private System.Windows.Forms.Label label1;<br />
<br />
private bool LeftMouseDown = false;<br />
private Point MouseDownPos;<br />
private Rectangle DragRect;<br />
private ArrayList FinalRects;<br />
private AxSHDocVw.AxWebBrowser axWebBrowser1;<br />
<br />
private System.ComponentModel.Container components = null;<br />
<br />
public Form1()<br />
{<br />
InitializeComponent();<br />
<br />
this.axWebBrowser1.Navigate("http://www.msnbc.com");<br />
<br />
this.MouseDownPos = new Point( 0,0 );<br />
this.FinalRects = new ArrayList();<br />
<br />
this.SetStyle(System.Windows.Forms.ControlStyles.SupportsTransparentBackColor, true);<br />
this.SetStyle(System.Windows.Forms.ControlStyles.AllPaintingInWmPaint, true);<br />
this.SetStyle(System.Windows.Forms.ControlStyles.DoubleBuffer, true);<br />
this.SetStyle(System.Windows.Forms.ControlStyles.UserPaint, true);<br />
}<br />
<br />
protected override void Dispose( bool disposing )<br />
{<br />
if( disposing )<br />
{<br />
if (components != null) <br />
{<br />
components.Dispose();<br />
}<br />
}<br />
base.Dispose( disposing );<br />
}<br />
<br />
#region Windows Form Designer generated code<br />
private void InitializeComponent()<br />
{<br />
System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(Form1));<br />
this.label3 = new System.Windows.Forms.Label();<br />
this.label1 = new System.Windows.Forms.Label();<br />
this.axWebBrowser1 = new AxSHDocVw.AxWebBrowser();<br />
((System.ComponentModel.ISupportInitialize)(this.axWebBrowser1)).BeginInit();<br />
this.SuspendLayout();<br />
this.label1.BackColor = System.Drawing.Color.Transparent;<br />
this.label1.Dock = System.Windows.Forms.DockStyle.Fill;<br />
this.label1.Location = new System.Drawing.Point(0, 0);<br />
this.label1.Name = "label1";<br />
this.label1.Size = new System.Drawing.Size(400, 400);<br />
this.label1.TabIndex = 1;<br />
this.label1.Paint += new System.Windows.Forms.PaintEventHandler(this.label1_Paint);<br />
this.label1.MouseUp += new System.Windows.Forms.MouseEventHandler(this.label1_MouseUp);<br />
this.label1.MouseMove += new System.Windows.Forms.MouseEventHandler(this.label1_MouseMove);<br />
this.label1.MouseDown += new System.Windows.Forms.MouseEventHandler(this.label1_MouseDown);<br />
this.label3.BackColor = System.Drawing.Color.Transparent;<br />
this.label3.Controls.Add(this.label1);<br />
this.label3.Location = new System.Drawing.Point(188, 32);<br />
this.label3.Name = "label3";<br />
this.label3.Size = new System.Drawing.Size(400, 400);<br />
this.label3.TabIndex = 0;<br />
this.label3.Paint += new System.Windows.Forms.PaintEventHandler(this.label3_Paint); <br />
this.axWebBrowser1.Dock = System.Windows.Forms.DockStyle.Fill;<br />
this.axWebBrowser1.Enabled = true;<br />
this.axWebBrowser1.Location = new System.Drawing.Point(0, 0);<br />
this.axWebBrowser1.OcxState = ((System.Windows.Forms.AxHost.State)(resources.GetObject("axWebBrowser1.OcxState")));<br />
this.axWebBrowser1.Size = new System.Drawing.Size(819, 476);<br />
this.axWebBrowser1.Controls.Add(label3);<br />
this.axWebBrowser1.TabIndex = 1;<br />
this.axWebBrowser1.Invalidated += new InvalidateEventHandler(axWebBrowser1_Invalidated);<br />
this.axWebBrowser1.Validated += new EventHandler(axWebBrowser1_Validated);<br />
this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);<br />
this.BackColor = System.Drawing.SystemColors.Control;<br />
this.ClientSize = new System.Drawing.Size(819, 476);<br />
this.Controls.Add(this.axWebBrowser1);<br />
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;<br />
this.MaximumSize = new System.Drawing.Size(825, 500);<br />
this.MinimumSize = new System.Drawing.Size(825, 500);<br />
this.Name = "Form1";<br />
this.Text = "Form1";<br />
((System.ComponentModel.ISupportInitialize)(this.axWebBrowser1)).EndInit();<br />
this.ResumeLayout(false);<br />
<br />
}<br />
#endregion<br />
<br />
[STAThread]<br />
static void Main() <br />
{<br />
Application.Run(new Form1());<br />
}<br />
<br />
protected override void OnPaintBackground(PaintEventArgs pevent)<br />
{<br />
base.OnPaintBackground(pevent);<br />
}<br />
<br />
private void label1_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e)<br />
{<br />
if( e.Button == MouseButtons.Left )<br />
{<br />
Console.WriteLine("Panel2_MouseDown");<br />
MouseDownPos = new Point(e.X, e.Y); <br />
LeftMouseDown = true;<br />
DragRect = new Rectangle(e.X, e.Y, 0, 0);<br />
this.label1.Invalidate();<br />
} <br />
}<br />
<br />
private void label1_MouseMove(object sender, System.Windows.Forms.MouseEventArgs e)<br />
{<br />
if( e.Button == MouseButtons.Left )<br />
{<br />
Console.WriteLine("Panel2_MouseMove");<br />
DragRect = CalcDragRect(e.X, e.Y);<br />
this.label1.Invalidate();<br />
} <br />
}<br />
<br />
private void label1_MouseUp(object sender, System.Windows.Forms.MouseEventArgs e)<br />
{<br />
if( LeftMouseDown )<br />
{<br />
Console.WriteLine("Panel2_MouseUp");<br />
LeftMouseDown = false;<br />
DragRect = CalcDragRect(e.X, e.Y); <br />
this.label1.Invalidate();<br />
FinalRects.Add(DragRect);<br />
}<br />
}<br />
<br />
private void label1_Paint(object sender, System.Windows.Forms.PaintEventArgs e)<br />
{<br />
if( LeftMouseDown )<br />
{<br />
Pen pen = new Pen(Color.Blue);<br />
pen.DashStyle = System.Drawing.Drawing2D.DashStyle.Dash;<br />
DrawRect(e.Graphics, DragRect, pen);<br />
pen.Dispose();<br />
}<br />
}<br />
<br />
private void label3_Paint(object sender, System.Windows.Forms.PaintEventArgs e)<br />
{<br />
foreach( Rectangle rect in FinalRects )<br />
{<br />
DrawRect(e.Graphics, rect, Pens.Red);<br />
}<br />
}<br />
<br />
public void DrawRect(Graphics g, Rectangle rect, Pen pen)<br />
{<br />
if (rect.Width == 0 && rect.Height == 0) <br />
{<br />
g.DrawLine(pen, rect.X, rect.Y, rect.X, rect.Y + (float)0.01);<br />
}<br />
else if (rect.Width > 0 && rect.Height == 0) <br />
{<br />
g.DrawLine(pen, rect.X, rect.Y, rect.Right, rect.Y);<br />
}<br />
else if (rect.Width == 0 && rect.Height > 0) <br />
{<br />
g.DrawLine(pen, rect.X, rect.Y, rect.X, rect.Bottom);<br />
}<br />
else<br />
{<br />
g.DrawRectangle(pen, rect);<br />
}<br />
}<br />
<br />
private System.Drawing.Rectangle CalcDragRect(int mouseX, int mouseY)<br />
{<br />
return Rectangle.FromLTRB( System.Math.Min(mouseX, MouseDownPos.X),<br />
System.Math.Min(mouseY, MouseDownPos.Y),<br />
System.Math.Max(mouseX, MouseDownPos.X),<br />
System.Math.Max(mouseY, MouseDownPos.Y) <br />
);<br />
}<br />
<br />
private void axWebBrowser1_Invalidated(object sender, InvalidateEventArgs e)<br />
{<br />
}<br />
<br />
private void axWebBrowser1_Validated(object sender, EventArgs e)<br />
{<br />
}<br />
}<br />
}<br />
|
|
|
|
|
Hi!
Is anyone familiar with VTK (Visualization ToolKit)? I have a major problem using it with windows forms:
I have a windows form, wich is MDIParent, built with C#.
I have another window built with vtkRenderWindow and I want it to appear inside the windows form (as a child window).
Has anyone done this? How?
Pleeeeeease help me!!!!
Patrícia Gonçalves
|
|
|
|
|
I am trying to use VTK from C# code. Did you figure out a way for this? I also need to keep the code cross platform (may be with mono.net). Any suggestions / advice, will be of great help.
Thanks,
|
|
|
|
|
Hi!
I used vtkdotnetwrap, a wrapper for VTK and C# developped by two researchers from the University of West Bohemia (Czech Republic).
You can download it here: http://herakles.zcu.cz/research/vtk.net/.
|
|
|
|
|
|
how can i load a crystal report using dataset with two tabes
the tables should not duplicate
i need practical example
|
|
|
|
|
I've been asked to setup a webpage to use to change passwords. That's the easy part... the tricky part is that I have to run the password through a rule check. It can't be a dictionary word, has to be 8 characters, must have a number in it... etc etc. Anyone know of an easy way to do this? I'm just figuring that this has been done so many times before, there has got to be something already implemented that I can use.
[Edit] I have googled, but I'm not sure what to google for... password rule doesn't get me anywhere [/Edit]
// TODO: Write code.
|
|
|
|
|
Check this out
http://www.thecodeproject.com/csharp/PasswordDialog.asp
Live Life King Size
Alomgir Miah
|
|
|
|
|
Thanks for the link. that was interesting, but not quite what I'm looking for. The article states: "This dialog can be easily extended to add rules to force a minimum size, and even force a combination of case sensitive letters, numbers and punctuation, but that is beyond the scope of this article."
It's this extra stuff that I'm looking to find code for. I could easily write it myself, but I figure someone else has already done this for me. I'm looking for a library or premade class that checks a password against a given dictionary, plus customizable numbers and punctuation rules.
// TODO: Write code.
|
|
|
|
|
|
Another kewl link, but I couldn't find anything about checking a given password against a dictionary in that article.
// TODO: Write code.
|
|
|
|
|
What about Regular Expressions?
modified 12-Sep-18 21:01pm.
|
|
|
|
|
That would of course be a good way of doing it... know of some code that already has that implemented? I'm just trying to avoid writting code that someone else has already put together.
[Edit] Thanks for mentioning Reg Exp btw... That led me to this[^]. Now I just need some code to check the password against a dictionary. [/Edit]
// TODO: Write code.
|
|
|
|
|
No code, but the basic idea should be fairly simple. Load the dictionary into a hash table, and test to see if the proposed passwords in it.
|
|
|
|
|
Hi,
I am new to windows graphical programming world. Recently i need to develop a applciation that allows user to map one side of objects to another...(It is lie Mapper).
So, i need to develop that allows user to draw line joing from source object to destination object...
How should i achieve this?
Thanks
GoTech
|
|
|
|
|
how can i create a view using sqldmo
by linking servaer tables
please i need practical example
|
|
|
|
|
Hi,
I have 2 C# Projects together (web service / windows application)in one Solution in Visual Studio 2003 and I want to share some window´s project´s classes to the web service project.
The only way I´ve been able to do this, is to Create the third Project within the same solution as a ClassLibrary (DLL) and copy/paste some of the windows application´s classes to that third project.
Then I add a reference (in the web service / windows application projects) to the third Classlibrary project by doing:
References->Add Reference-Projects->*Pick the Classlibrary project*
Is there any other (more simple) way of doing this?
Thanks in advance!!
BinaryHead
P.S. I know how to share classes within the same project (just by using simple namespaces).
|
|
|
|
|
Hi!
That's exactly the way to do it. Referencing the other project directly usually won't work because you get circular dependencies.
The only way to solve these is to put common parts into a separate assembly and referencing this assembly from your other projects.
The good news is that VS takes care of distributing the common assembly to where-ever it's referenced in your project when you rebuild, so you don't have to waste a doubt on where to copy the output after building.
Regards,
mav
|
|
|
|
|
you can share a common file (a class say) at a source level between two different solutions by just adding the file (add an existing item) to the appropriate project. The default in vs would be to create a copy of the file in each project that it is added to, but if you look closely the 'open' button on the file selection dialog is actually a drop-down combo, with the last choice being 'link file'. If you use the 'Link file' choice, no copy is created, and the file becomes truly shared between the projects, just like a common header file is used in C++.
Absolute faith corrupts as absolutely as absolute power
Eric Hoffer
All that is necessary for the triumph of evil is that good men do nothing.
Edmund Burke
|
|
|
|
|
how can i add a progress bar into a datagrid. i would like to perform some actions when an iten in the datagrid is clicked and control the progressbar accordingly. How can i do this.
|
|
|
|
|
There is a similar article
http://www.codeproject.com/cs/miscctrl/RenDataGridComboBoxColumn.asp
Hope this helps.
Live Life King Size
Alomgir Miah
|
|
|
|
|
Hello there
I am building a control where user will browse one XML file and will play with the records in that. what I have done is very simple. After browsing XML I just use Dataset.readXML to get the contents and then
dataGrid1.DataSource= Dataset;
now I want that the values should be automatically saved in the XML file when changed. how ???
Second thing after binding = I have one column in Datagrid which I shall make read only. it should keep the last Changed value. means if the name was
"ABC" and user Changed it then Column 2 should have value "ABC" and the new value in column 1 should be assigned by user.
|
|
|
|
|
This may be an easy fix. Nevertheless, I am having problems running a program on a separate machine then what it was developed on. The executable runs and is operational. However, the resolution is WAY off. The form becomes quite large. The buttons are large and they moved slightly to the right as well. I was sure that it was just the resolution on the machine that the executable was running on. That was not the case. Therefore, I am here. Seeking help from anyone that may have encountered a similar problem. Thanks in advance.
|
|
|
|
|
Is this happening on any other machine, or just some of them? IF the latter, one posibility is that the system is set to use large fonts and the controls were scaled in responce to the accesibility changes.
|
|
|
|