|
hi
I want to know how to print a textbox text..
Thank u
*** Why EXPERTS behave like a fool ***
|
|
|
|
|
Hi,
There is direct way to print the contents of a RichTextBox in .Net. However, there is a way to get this done. Please go through the following article posted at Microsoft's website:
http://support.microsoft.com/kb/812425[^]
This article provides step-step implementation of printing the contents of a RichTextBox.
I hope this helps .
Regards,
John Adams
ComponentOne LLC
|
|
|
|
|
Thank you ..
Can u tell me how pass that string value to a crystal report ...
*** Why EXPERTS behave like a fool ***
|
|
|
|
|
hi friends.
All of you have seen that tab in visual studio where solution explorer, toolbox, properties is written and when user move mouse over them, one panel come out where we have some data in treeview. Hope you got the scenario.
Now i too have 2 treeview in my window application.
and i want the same interface which visual studio provide in my application.
is there any inbuilt control provide by framework.
Hope you understand what i want.
Thanks lot friends.
Avtar Singh Sohi.
|
|
|
|
|
You are looking for a tab control with auto hide and run time docking feature. Unfortunately currently any window control does not provide you similar features.
However there are many third party tab controls which come with these features. You may use google to find them.
-Dave.
Dave Traister,
ComponentOne LLC.
www.componentone.com
|
|
|
|
|
Take a look at the Dockpanel Suite[^] on SourceForge. It's quite good. If your application is meant for the average user though (as opposed to the average developer) I would reconsider using these kinds of controls, as they often find the VS way of doing things overly complex.
Standards are great! Everybody should have one!
|
|
|
|
|
Hi,
1.As application is now almost complete. I want to know how can i add the application to install shield. I have no idea about this ...?
Thank You.
modified on Tuesday, March 18, 2008 12:58 AM
|
|
|
|
|
You will need to install, installshield setup creator software. One you are done with this, you may use install shield to create a setup for it.
You may also check its help file for getting steps to use it.
-Dave.
Dave Traister,
ComponentOne LLC.
www.componentone.com
|
|
|
|
|
Thanks for your reply..
Are there any good free installshield setup creator software ?
|
|
|
|
|
Hello Sir/Mam,
I want to synchronise 2 images.when I perform operations like zooming ,panning on one image the other should get effected automatically. I have performed this in the following way......
In the mouse wheel event i am performing zooming. and mouse down and mousemove events i am performing panning.I am not using any scroll bars...
The problem is when i'm performing zooming(i.e., when i'm rotating the mouse wheel fastly then the images are not synchronised properly..I should overcome this problem.. pls help me..
Thanks,
rekha.
|
|
|
|
|
Well, I'd love to help, but seeing as you didn't post any code, I have no idea what you did wrong.
You should be storing the zoom for both images in one variable, so it's in sync
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
this is the code in user Control
<br />
using System;<br />
using System.Collections;<br />
using System.ComponentModel;<br />
using System.Drawing;<br />
using System.Data;<br />
using System.Windows.Forms;<br />
using System.Drawing.Imaging;<br />
<br />
namespace SynchronizingImages<br />
{<br />
<br />
[System.Runtime.InteropServices.ComVisible(false)]<br />
public class ucSynchImages: System.Windows.Forms.UserControl<br />
{<br />
<br />
private System.ComponentModel.Container components = null;<br />
private System.Windows.Forms.MouseButtons m_MouseButtons = System.Windows.Forms.MouseButtons.Left;<br />
<br />
private System.Drawing.Bitmap m_OriginalImage;<br />
<br />
private System.Drawing.Point m_StartPoint;<br />
private System.Drawing.Point m_Origin = new System.Drawing.Point(0, 0);<br />
<br />
private Graphics g;<br />
public System.Drawing.Rectangle SrcRect;<br />
public System.Drawing.Rectangle DestRect;<br />
<br />
private bool m_ZoomOnMouseWheel = true;<br />
private double m_ZoomFactor = 1.0;<br />
<br />
<br />
private int m_DrawWidth;<br />
private int m_DrawHeight;<br />
<br />
private Point m_centerpoint;<br />
<br />
private bool m_PanMode = true;<br />
private bool m_StretchImageToFit = false;<br />
<br />
private Rectangle m_Select_Rect;<br />
<br />
private Point EndPoint;<br />
<br />
<br />
<br />
#region " Windows Form Designer generated code "<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 />
<br />
<br />
[System.Diagnostics.DebuggerStepThrough()]<br />
private void InitializeComponent()<br />
{<br />
this.Name = "ucSynchImages";<br />
<br />
this.MouseMove += new System.Windows.Forms.MouseEventHandler(this.ucSynchImages_MouseMove);<br />
this.MouseWheel += new System.Windows.Forms.MouseEventHandler(this.ucSynchImages_MouseWheel);<br />
this.MouseDown += new System.Windows.Forms.MouseEventHandler(this.ucSynchImages_MouseDown);<br />
<br />
}<br />
<br />
#endregion<br />
<br />
#region "Public/Private Shadows"<br />
public System.Drawing.Image image <br />
{<br />
get { return m_OriginalImage; }<br />
set <br />
{<br />
if ((m_OriginalImage != null)) <br />
{<br />
m_OriginalImage.Dispose();<br />
m_Select_Rect =Rectangle.Empty ;<br />
m_Origin = new Point(0, 0);<br />
m_ZoomFactor = 1;<br />
GC.Collect();<br />
<br />
}<br />
<br />
if (value == null) <br />
{<br />
m_OriginalImage = null;<br />
this.Invalidate();<br />
return;
}<br />
<br />
Rectangle r = new Rectangle(0, 0, value.Width, value.Height);<br />
m_OriginalImage = new Bitmap(value);<br />
BitmapData bmpData = new BitmapData();<br />
m_OriginalImage = (Bitmap)m_OriginalImage.Clone(r,System .Drawing . Imaging.PixelFormat.Format32bppPArgb);<br />
<br />
this.Invalidate();<br />
}<br />
}<br />
<br />
#endregion<br />
#region "Protected Overrides"<br />
protected override void OnPaint(PaintEventArgs e)<br />
{<br />
e.Graphics.Clear(this.BackColor);<br />
DrawImage(e.Graphics);<br />
base.OnPaint(e);<br />
}<br />
protected override void OnSizeChanged(EventArgs e)<br />
{<br />
DestRect = new System.Drawing.Rectangle(0, 0, ClientSize.Width, ClientSize.Height);<br />
ComputeDrawingArea();<br />
base.OnSizeChanged(e);<br />
}<br />
#endregion<br />
#region "Public Properties"<br />
public void ZoomIn()<br />
{<br />
ZoomImage(true);<br />
}<br />
<br />
public void ZoomOut()<br />
{<br />
ZoomImage(false);<br />
}<br />
private void ZoomImage(bool ZoomIn)<br />
{<br />
<br />
m_centerpoint=new Point(m_Origin.X + SrcRect.Width / 2,m_Origin.Y + SrcRect.Height / 2);<br />
if (ZoomIn) <br />
{<br />
ZoomFactor = Math.Round(ZoomFactor * 1.1, 2);<br />
}<br />
else <br />
{<br />
ZoomFactor = Math.Round(ZoomFactor * 0.9, 2);<br />
}<br />
m_Origin.X = Convert .ToInt32 (m_centerpoint.X - ClientSize.Width / m_ZoomFactor / 2);<br />
m_Origin.Y =Convert .ToInt32( m_centerpoint.Y - ClientSize.Height / m_ZoomFactor / 2);<br />
CheckBounds();<br />
}<br />
public System.Windows.Forms.MouseButtons PanButton <br />
{<br />
get { return m_MouseButtons; }<br />
set { m_MouseButtons = value; }<br />
}<br />
public bool ZoomOnMouseWheel <br />
{<br />
get { return m_ZoomOnMouseWheel; }<br />
set { m_ZoomOnMouseWheel = value; }<br />
}<br />
public double ZoomFactor <br />
{<br />
get { return m_ZoomFactor; }<br />
set <br />
{<br />
m_ZoomFactor = value;<br />
if (m_ZoomFactor > 15)<br />
m_ZoomFactor = 15;<br />
if (m_ZoomFactor < 0.05)<br />
m_ZoomFactor = 0.05;<br />
if ((m_OriginalImage != null)) <br />
{<br />
ComputeDrawingArea();<br />
CheckBounds();<br />
}<br />
this.Invalidate();<br />
}<br />
}<br />
<br />
<br />
public bool PanMode <br />
{<br />
get { return m_PanMode; }<br />
set { m_PanMode = value; }<br />
}<br />
<br />
<br />
#endregion<br />
<br />
<br />
private void DrawImage( Graphics g)<br />
{<br />
if (m_OriginalImage == null)<br />
return;
g.PixelOffsetMode = System.Drawing.Drawing2D .PixelOffsetMode.Half;<br />
g.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.None;<br />
g.InterpolationMode =System.Drawing. Drawing2D.InterpolationMode.NearestNeighbor;<br />
<br />
<br />
if (m_StretchImageToFit) <br />
{<br />
SrcRect = new System.Drawing.Rectangle(0, 0, m_OriginalImage.Width, m_OriginalImage.Height);<br />
}<br />
else <br />
{<br />
SrcRect = new System.Drawing.Rectangle(m_Origin.X, m_Origin.Y, m_DrawWidth, m_DrawHeight);<br />
}<br />
<br />
g.DrawImage(m_OriginalImage, DestRect, SrcRect, GraphicsUnit.Pixel);<br />
<br />
<br />
}<br />
<br />
private void ComputeDrawingArea()<br />
{<br />
<br />
m_DrawHeight = Convert .ToInt32 (this.Height / m_ZoomFactor);<br />
m_DrawWidth = Convert .ToInt32 (this.Width / m_ZoomFactor);<br />
<br />
}<br />
<br />
private void CheckBounds()<br />
{<br />
if (m_OriginalImage == null)<br />
return;
<br />
if (m_Origin.X < 0)<br />
m_Origin.X = 0;<br />
if (m_Origin.Y < 0)<br />
m_Origin.Y = 0;<br />
if (m_Origin.X > m_OriginalImage.Width - (ClientSize.Width / m_ZoomFactor)) <br />
{<br />
m_Origin.X = Convert .ToInt32(m_OriginalImage.Width - (ClientSize.Width / m_ZoomFactor));<br />
}<br />
if (m_Origin.Y > m_OriginalImage.Height - (ClientSize.Height / m_ZoomFactor)) <br />
{<br />
m_Origin.Y =Convert .ToInt32( m_OriginalImage.Height - (ClientSize.Height / m_ZoomFactor));<br />
}<br />
<br />
if (m_Origin.X < 0)<br />
m_Origin.X = 0;<br />
if (m_Origin.Y < 0)<br />
m_Origin.Y = 0;<br />
}<br />
<br />
<br />
<br />
public ucSynchImages()<br />
{<br />
<br />
InitializeComponent();<br />
this.SetStyle(ControlStyles.AllPaintingInWmPaint, true);<br />
this.SetStyle(ControlStyles.DoubleBuffer, true);<br />
}<br />
<br />
<br />
public void ucSynchImages_MouseMove(object sender, System.Windows.Forms.MouseEventArgs e)<br />
{<br />
if (m_OriginalImage == null)<br />
return;
<br />
if (e.Button == m_MouseButtons) <br />
{<br />
<br />
int DeltaX = m_StartPoint.X - e.X;<br />
int DeltaY = m_StartPoint.Y - e.Y;<br />
<br />
if (PanMode) <br />
{<br />
m_Origin.X = Convert .ToInt32 (m_Origin.X + (DeltaX / m_ZoomFactor));<br />
m_Origin.Y = Convert .ToInt32(m_Origin.Y + (DeltaY / m_ZoomFactor));<br />
CheckBounds();<br />
m_StartPoint.X = e.X;<br />
m_StartPoint.Y = e.Y;<br />
this.Invalidate();<br />
<br />
}<br />
}<br />
}<br />
<br />
private void ucSynchImages_MouseWheel(object sender, MouseEventArgs e)<br />
{<br />
if (!ZoomOnMouseWheel)<br />
return;
<br />
if (e.Delta > 0) <br />
{<br />
ZoomImage(true);<br />
}<br />
else if (e.Delta < 0) <br />
{<br />
ZoomImage(false);<br />
}<br />
}<br />
<br />
public void ucSynchImages_MouseDown(object sender, MouseEventArgs e)<br />
{<br />
if (m_OriginalImage == null)<br />
return;
EndPoint = Point.Empty ;<br />
m_StartPoint = new Point(e.X, e.Y);<br />
this.Focus();<br />
}<br />
<br />
<br />
}<br />
<br />
<br />
}<br />
|
|
|
|
|
code in form
<br />
using System;<br />
using System.Drawing;<br />
using System.Collections;<br />
using System.ComponentModel;<br />
using System.Windows.Forms;<br />
using System.Data;<br />
<br />
namespace SynchronizingImages<br />
{<br />
public class SynchImage : System.Windows.Forms.Form<br />
{<br />
private SynchronizingImages.ucSynchImages ucSynchImages1;<br />
private SynchronizingImages.ucSynchImages ucSynchImages2;<br />
private System.Windows.Forms.Button btnOpen;<br />
private System.Windows.Forms.OpenFileDialog ofd1;<br />
private System.Windows.Forms.Button btnopen2;<br />
Bitmap bp,bp1;<br />
private System.ComponentModel.Container components = null;<br />
<br />
public SynchImage()<br />
{<br />
InitializeComponent();<br />
<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 />
this.ucSynchImages1 = new SynchronizingImages.ucSynchImages();<br />
this.ucSynchImages2 = new SynchronizingImages.ucSynchImages();<br />
this.btnOpen = new System.Windows.Forms.Button();<br />
this.ofd1 = new System.Windows.Forms.OpenFileDialog();<br />
this.btnopen2 = new System.Windows.Forms.Button();<br />
this.SuspendLayout();<br />
this.ucSynchImages1.Cursor = System.Windows.Forms.Cursors.Hand;<br />
this.ucSynchImages1.image = null;<br />
this.ucSynchImages1.Location = new System.Drawing.Point(56, 40);<br />
this.ucSynchImages1.Name = "ucSynchImages1";<br />
this.ucSynchImages1.PanButton = System.Windows.Forms.MouseButtons.Left;<br />
this.ucSynchImages1.PanMode = true;<br />
this.ucSynchImages1.Size = new System.Drawing.Size(304, 312);<br />
this.ucSynchImages1.TabIndex = 0;<br />
this.ucSynchImages1.ZoomFactor = 1;<br />
this.ucSynchImages1.ZoomOnMouseWheel = true;<br />
this.ucSynchImages1.Load += new System.EventHandler(this.ucSynchImages1_Load);<br />
this.ucSynchImages2.Cursor = System.Windows.Forms.Cursors.Hand;<br />
this.ucSynchImages2.image = null;<br />
this.ucSynchImages2.Location = new System.Drawing.Point(456, 40);<br />
this.ucSynchImages2.Name = "ucSynchImages2";<br />
this.ucSynchImages2.PanButton = System.Windows.Forms.MouseButtons.Left;<br />
this.ucSynchImages2.PanMode = true;<br />
this.ucSynchImages2.Size = new System.Drawing.Size(304, 312);<br />
this.ucSynchImages2.TabIndex = 1;<br />
this.ucSynchImages2.ZoomFactor = 1;<br />
this.ucSynchImages2.ZoomOnMouseWheel = true;<br />
this.btnOpen.Cursor = System.Windows.Forms.Cursors.Hand;<br />
this.btnOpen.Location = new System.Drawing.Point(168, 384);<br />
this.btnOpen.Name = "btnOpen";<br />
this.btnOpen.TabIndex = 2;<br />
this.btnOpen.Text = "Open";<br />
this.btnOpen.Click += new System.EventHandler(this.btnOpen_Click);<br />
this.btnopen2.Cursor = System.Windows.Forms.Cursors.Hand;<br />
this.btnopen2.Location = new System.Drawing.Point(544, 384);<br />
this.btnopen2.Name = "btnopen2";<br />
this.btnopen2.TabIndex = 3;<br />
this.btnopen2.Text = "Open2";<br />
this.btnopen2.Click += new System.EventHandler(this.btnopen2_Click);<br />
this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);<br />
this.BackColor = System.Drawing.Color.White;<br />
this.ClientSize = new System.Drawing.Size(864, 502);<br />
this.Controls.Add(this.btnopen2);<br />
this.Controls.Add(this.btnOpen);<br />
this.Controls.Add(this.ucSynchImages2);<br />
this.Controls.Add(this.ucSynchImages1);<br />
this.Name = "SynchImage";<br />
this.Text = "SynchronizingImages";<br />
this.Load += new System.EventHandler(this.SynchImage_Load);<br />
this.ResumeLayout(false);<br />
<br />
}<br />
#endregion<br />
<br />
[STAThread]<br />
static void Main() <br />
{<br />
Application.Run(new SynchImage());<br />
}<br />
<br />
<br />
<br />
private void btnOpen_Click(object sender, System.EventArgs e)<br />
{<br />
ofd1.ShowDialog();<br />
if(ofd1.FileName !="")<br />
{<br />
bp=new Bitmap(ofd1.FileName);<br />
ucSynchImages1.image=bp;<br />
if(ofd1.FileName!="")<br />
{<br />
ucSynchImages2 .image =bp1;<br />
ucSynchImages1.Size =ucSynchImages2 .Size ;<br />
}<br />
<br />
}<br />
}<br />
<br />
private void SynchImage_Load(object sender, System.EventArgs e)<br />
{<br />
ucSynchImages1.MouseDown+=new MouseEventHandler(ucSynchImages1_MouseDown);<br />
ucSynchImages1.MouseMove+=new MouseEventHandler(ucSynchImages1_MouseMove);<br />
ucSynchImages1.MouseWheel+=new MouseEventHandler(ucSynchImages1_MouseWheel);<br />
ucSynchImages2.MouseDown+=new MouseEventHandler(ucSynchImages2_MouseDown);<br />
ucSynchImages2.MouseMove+=new MouseEventHandler(ucSynchImages2_MouseMove);<br />
ucSynchImages2.MouseWheel+=new MouseEventHandler(ucSynchImages2_MouseWheel);<br />
<br />
}<br />
private void ucSynchImages1_MouseDown(object sender, MouseEventArgs e)<br />
{<br />
ucSynchImages2.ucSynchImages_MouseDown (sender,e);<br />
}<br />
<br />
private void ucSynchImages1_MouseMove(object sender, MouseEventArgs e)<br />
{<br />
ucSynchImages2.ucSynchImages_MouseMove (sender,e);<br />
}<br />
<br />
private void ucSynchImages1_MouseWheel(object sender, MouseEventArgs e)<br />
{<br />
<br />
<br />
if(e.Delta >0)<br />
{<br />
ucSynchImages2.SrcRect=ucSynchImages1.SrcRect;<br />
ucSynchImages2.DestRect=ucSynchImages1.DestRect;<br />
<br />
ucSynchImages2.ZoomIn();<br />
<br />
<br />
<br />
}<br />
if(e.Delta <0)<br />
{<br />
ucSynchImages2.SrcRect=ucSynchImages1.SrcRect;<br />
ucSynchImages2.DestRect=ucSynchImages1.DestRect;<br />
<br />
ucSynchImages2 .ZoomOut();<br />
<br />
<br />
}<br />
}<br />
<br />
private void ucSynchImages2_MouseDown(object sender, MouseEventArgs e)<br />
{<br />
ucSynchImages1 .Size =ucSynchImages2 .Size ;<br />
ucSynchImages1.ucSynchImages_MouseDown (sender,e);<br />
}<br />
<br />
private void ucSynchImages2_MouseMove(object sender, MouseEventArgs e)<br />
{<br />
ucSynchImages1 .Size =ucSynchImages2 .Size ;<br />
ucSynchImages1.ucSynchImages_MouseMove (sender,e);<br />
}<br />
<br />
private void ucSynchImages2_MouseWheel(object sender, MouseEventArgs e)<br />
{<br />
ucSynchImages2 .Size =ucSynchImages1 .Size ;<br />
<br />
if(e.Delta >0)<br />
{<br />
ucSynchImages2.SrcRect=ucSynchImages1.SrcRect;<br />
ucSynchImages2.DestRect=ucSynchImages1.DestRect;<br />
ucSynchImages1.ZoomIn();<br />
ucSynchImages2.Size =ucSynchImages1.Size ;<br />
<br />
<br />
}<br />
if(e.Delta <0)<br />
{<br />
ucSynchImages2.SrcRect=ucSynchImages1.SrcRect;<br />
ucSynchImages2.DestRect=ucSynchImages1.DestRect;<br />
ucSynchImages1.ZoomOut();<br />
ucSynchImages2.Size =ucSynchImages1.Size ;<br />
<br />
<br />
}<br />
}<br />
<br />
private void btnopen2_Click(object sender, System.EventArgs e)<br />
{<br />
ofd1.ShowDialog();<br />
if(ofd1.FileName !="")<br />
{<br />
bp1=new Bitmap(ofd1.FileName);<br />
ucSynchImages2.image=bp1;<br />
ucSynchImages1 .image =bp;<br />
ucSynchImages2.Size =ucSynchImages1 .Size ;<br />
<br />
}<br />
<br />
}<br />
<br />
private void ucSynchImages1_Load(object sender, System.EventArgs e)<br />
{<br />
<br />
}<br />
<br />
<br />
}<br />
}<br />
<br />
<br />
|
|
|
|
|
B.rekha wrote: // btnopen2
//
this.btnopen2.Cursor = System.Windows.Forms.Cursors.Hand;
this.btnopen2.Location = new System.Drawing.Point(544, 384);
this.btnopen2.Name = "btnopen2";
this.btnopen2.TabIndex = 3;
this.btnopen2.Text = "Open2";
this.btnopen2.Click += new System.EventHandler(this.btnopen2_Click);
//
// SynchImage
//
this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
this.BackColor = System.Drawing.Color.White;
this.ClientSize = new System.Drawing.Size(864, 502);
this.Controls.Add(this.btnopen2);
this.Controls.Add(this.btnOpen);
this.Controls.Add(this.ucSynchImages2);
this.Controls.Add(this.ucSynchImages1);
this.Name = "SynchImage";
this.Text = "SynchronizingImages";
this.Load += new System.EventHandler(this.SynchImage_Load);
this.ResumeLayout(false);
I assume you realise that this code is auto generated. I kind of meant just the pertinent code that you actually wrote.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
actually we have posted every thing,that is why you confused , and you can observe the remaining things
in user control, and form code.
Thank you for your quick response.
|
|
|
|
|
I know what you did, I was asking why you couldn't take the time to create a post where I didn't have to read two huge posts looking for the little bits that are pertinent to the problem.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
When I coding C# language to connect SQL Server and then. I write stored procedure to insert into table, and I want to show data immediately in datagridview in form and orthers controls.
So that, I want to coding procedure or function with C# to refresh datatabase name.
Who can help me?
If posible I thanks so much.
For example:
I using: Namespace
using Microsoft.SqlServer.Management.Smo;
using Microsoft.SqlServer.Management.Common;
Function:
Server srv = new Server();
Database db = srv.Databases["Database_name"];
db.Refresh();
Thanks
Best & Regards
DFGDFGDFG
|
|
|
|
|
Hello
I have the simple code bellow with 1 datatable and two dgv
one DGV is defined at runtime as show the other one is defined empty at design time the first does not fill the second yes
What can be the cause ?
DataGridView tmpDGV = new DataGridView();<br />
<br />
tmpDGV.DataSource = dt;<br />
dgv_addr.DataSource = dt;
Thank you for any help
|
|
|
|
|
baranils wrote: one DGV is defined at runtime as show the other one is defined empty at design time the first does not fill the second yes
???, your question isnt proper, however if you wanna add DGV at runtime, then you will need to add it in the form else it wont show up
code to add control in form :
this.Controls.Add(tmpDGV);
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L
%^]*IRXD#@GKCQ`R\^SF_WcHbORY87??6?N8?BcRAV\Z^&SU~%CSWQ@#2
W_AD`EPABIKRDFVS)EVLQK)JKSQXUFYK[M`UKs*$GwU#(QDXBER@CBN%
Rs0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-i?TV.C\y<p?jxsg-b$f4ia>
--------------------------------------------------------
128 bit encrypted signature, crack if you can
|
|
|
|
|
Thank you
Yes I miss that !
|
|
|
|
|
Hello
One little thing : my intent was not tho show the DGV but to fill it with a datasource to print it with another control
Anyway the problem is the same : if the DGV is not added to the form, the Datasource has no effect.
Thank you
|
|
|
|
|
Hi! I have a data table called maps that had been bind to a list view. I would like to add an event to the list view that is onSelectionChange. Inside this event, when user make a new selection I will display the selected data out into a detail view. Does anyone know how to do this by using listview.SelectedValue? I am building whole thing in wpf and c#. Thanks for your help.
I had try out this code but it always return -1.
DataView view = new DataView(maps);
view.Sort = "mapTitle";
MessageBox.Show(view.Find(mapListView.SelectedValue).ToString());
|
|
|
|
|
Hi,
you have to register for event and create method that will handle that event.
Method could look like this:
void mapListView_SelectionChanged(object sender, SelectionChangedEventArgs e)<br />
{<br />
}
and you have to tell mapListView to call your method. you can do it in xaml like this:
<ListView Name="mapListView" SelectionChanged="listView1_SelectionChanged"
or programatically (after mapListView is created and initialized):
this.listView1.SelectionChanged += new SelectionChangedEventHandler(listView1_SelectionChanged);
|
|
|
|
|
yuenli wrote: I would like to add an event to the list view that is onSelectionChange
why you arnt using SelectedIndexChanged ? its same
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L
%^]*IRXD#@GKCQ`R\^SF_WcHbORY87??6?N8?BcRAV\Z^&SU~%CSWQ@#2
W_AD`EPABIKRDFVS)EVLQK)JKSQXUFYK[M`UKs*$GwU#(QDXBER@CBN%
Rs0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-i?TV.C\y<p?jxsg-b$f4ia>
--------------------------------------------------------
128 bit encrypted signature, crack if you can
|
|
|
|
|
When I try to perform the math below I get an answer of 0, but the result of the below should be 5.76
Int64 lpTotalNumberOfFreeBytes = 41085476864;
Int64 lpTotalNumberOfBytes = 712212955136;
Int64 strAnswer = ((lpTotalNumberOfFreeBytes / lpTotalNumberOfBytes) * 100);
Does anyone see what I am doing wrong here?
Thanks
|
|
|
|