我正在使用C#中的Excel工作表,我很惊讶只选择excel表.我尝试了以下代码
OpenFileDialog browseFile = new OpenFileDialog();
browseFile.DereferenceLinks = true;
browseFile.Filter = "Excel|*.xls|Excel 2010|*.xlsx";
// browseFile.Filter = "Link Files (*.lnk)|*.lnk";
browseFile.Title = "Browse Excel file";
if (browseFile.ShowDialog() == DialogResult.Cancel)
Run Code Online (Sandbox Code Playgroud)
使用此代码不仅获得Excel工作表,而且最终获得快捷方式文件.任何人都可以建议我如何限制快捷方式文件.
我有一个相对布局,其中包含很少的图像,如下所示。
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<ImageView
android:id="@+id/image_2"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_alignLeft="@+id/increase"
android:layout_alignParentTop="true"
android:layout_marginLeft="34dp"
android:layout_marginTop="34dp"
android:src="@drawable/ic_launcher" />
<ImageView
android:id="@+id/image_1"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_alignBottom="@+id/image_2"
android:layout_marginBottom="14dp"
android:layout_toRightOf="@+id/increase"
android:src="@drawable/ic_launcher" />
<ImageView
android:id="@+id/image_8"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:src="@drawable/ic_launcher" />
</RelativeLayout>
Run Code Online (Sandbox Code Playgroud)
在我的 java 文件中,我需要执行一个小任务。当我单击图像时,它的大小应该增加。我试过了,它工作正常,这是我的代码
public class MainActivity extends Activity implements OnClickListener {
View imageView;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
ImageView i1 = (ImageView ) findViewById(R.id.image_1);
ImageView i2 = (ImageView ) findViewById(R.id.image_2);
ImageView i3 = (ImageView ) findViewById(R.id.image_8);
i1.setOnClickListener(this);
i2.setOnClickListener(this);
i3.setOnClickListener(this);
}
public void …Run Code Online (Sandbox Code Playgroud)