當前位置: 首頁>>代碼示例>>C#>>正文


C# TextBox.setColumns方法代碼示例

本文整理匯總了C#中System.Windows.Forms.TextBox.setColumns方法的典型用法代碼示例。如果您正苦於以下問題:C# TextBox.setColumns方法的具體用法?C# TextBox.setColumns怎麽用?C# TextBox.setColumns使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在System.Windows.Forms.TextBox的用法示例。


在下文中一共展示了TextBox.setColumns方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: actionPerformed

	public virtual void  actionPerformed(System.Object event_sender, System.EventArgs event_Renamed)
	{
		if (event_sender.Equals(openMenu))
		{
			chooser.ShowDialog(this);
			if (new System.IO.FileInfo(chooser.FileName) == null)
				return ;
			try
			{
				sourceImage = ImageIO.read(new System.IO.FileInfo(chooser.FileName));
			}
			catch (System.Exception e)
			{
				SupportClass.WriteStackTrace(e, Console.Error);
			}
		}
		else if (SupportClass.CommandManager.GetCommand(event_sender).Equals("Open from URL"))
		{
			try
			{
				//UPGRADE_TODO: Class 'java.net.URL' was converted to a 'System.Uri' which does not throw an exception if a URL specifies an unknown protocol. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1132'"
				sourceImage = ImageIO.read(new System.Uri(url.Text));
			}
			catch (System.Exception e)
			{
				SupportClass.WriteStackTrace(e, Console.Error);
			}
		}
		else
			return ;
		
		if (sourceImageLabel != null)
		{
			//UPGRADE_TODO: Method 'javax.swing.JFrame.getContentPane' was converted to 'System.Windows.Forms.Form' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javaxswingJFramegetContentPane'"
			((System.Windows.Forms.ContainerControl) this).Controls.Remove(sourceImageLabel);
		}
		
		System.Windows.Forms.Label temp_label;
		temp_label = new System.Windows.Forms.Label();
		temp_label.Image = (System.Drawing.Image) sourceImage.Clone();
		sourceImageLabel = temp_label;
		//UPGRADE_TODO: Method 'javax.swing.JFrame.getContentPane' was converted to 'System.Windows.Forms.Form' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javaxswingJFramegetContentPane'"
		//UPGRADE_TODO: Method 'java.awt.Container.add' was converted to 'System.Windows.Forms.ContainerControl.Controls.Add' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javaawtContaineradd_javaawtComponent_javalangObject'"
		((System.Windows.Forms.ContainerControl) this).Controls.Add(sourceImageLabel);
		sourceImageLabel.Dock = System.Windows.Forms.DockStyle.Left;
		sourceImageLabel.BringToFront();
		
		
		QRCodeDecoder decoder = new QRCodeDecoder();
		if (canvas != null)
		{
			//UPGRADE_TODO: Method 'javax.swing.JFrame.getContentPane' was converted to 'System.Windows.Forms.Form' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javaxswingJFramegetContentPane'"
			((System.Windows.Forms.ContainerControl) this).Controls.Remove(canvas);
			//canvas.setImage(null);
		}
		canvas = new J2SEDebugCanvas();
		QRCodeDecoder.setCanvas(canvas);
		//UPGRADE_TODO: Method 'javax.swing.JFrame.getContentPane' was converted to 'System.Windows.Forms.Form' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javaxswingJFramegetContentPane'"
		//UPGRADE_TODO: Method 'java.awt.Container.add' was converted to 'System.Windows.Forms.ContainerControl.Controls.Add' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javaawtContaineradd_javaawtComponent_javalangObject'"
		((System.Windows.Forms.ContainerControl) this).Controls.Add(canvas);
		canvas.Dock = System.Windows.Forms.DockStyle.Right;
		canvas.BringToFront();
		System.String decodedString = null;
		try
		{
			decodedString = new String(decoder.decode(new J2SEImage(this, sourceImage)));
		}
		catch (DecodingFailedException e)
		{
			canvas.println(e.getMessage());
			canvas.println("--------");
			return ;
		}
		decodedString = ContentConverter.convert(decodedString);
		canvas.println("\nDecode result:");
		canvas.println(decodedString);
		canvas.println("--------");
		if (decodedText != null)
		{
			//UPGRADE_TODO: Method 'javax.swing.JFrame.getContentPane' was converted to 'System.Windows.Forms.Form' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javaxswingJFramegetContentPane'"
			((System.Windows.Forms.ContainerControl) this).Controls.Remove(decodedText);
		}
		System.Windows.Forms.TextBox temp_TextBox;
		temp_TextBox = new System.Windows.Forms.TextBox();
		temp_TextBox.Multiline = true;
		temp_TextBox.WordWrap = false;
		temp_TextBox.ScrollBars = System.Windows.Forms.ScrollBars.Both;
		temp_TextBox.Text = decodedString;
		decodedText = temp_TextBox;
		decodedText.WordWrap = true;
		//UPGRADE_ISSUE: Method 'javax.swing.JTextArea.setRows' was not converted. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1000_javaxswingJTextAreasetRows_int'"
		decodedText.setRows(decodedString.Length / 20 + 1);
		if (decodedString.Length < 20)
		{
			//UPGRADE_ISSUE: Method 'javax.swing.JTextArea.setColumns' was not converted. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1000_javaxswingJTextAreasetColumns_int'"
			decodedText.setColumns(decodedString.Length);
		}
		else
		{
			//UPGRADE_ISSUE: Method 'javax.swing.JTextArea.setColumns' was not converted. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1000_javaxswingJTextAreasetColumns_int'"
//.........這裏部分代碼省略.........
開發者ID:eric-seekas,項目名稱:QR.NET,代碼行數:101,代碼來源:QRCodeDecoderGUIExample.cs


注:本文中的System.Windows.Forms.TextBox.setColumns方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。